From 70e71535a0f86ebabcb4985fdf9ef92ed2558377 Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Sat, 28 Sep 2024 22:22:24 +0200 Subject: [PATCH 01/36] Initial setup and experiments with OPFS --- .../example-filesystem-initialization.ts | 28 +- .../browserfs-filesystem-initialization.ts | 35 +- .../browserfs-filesystem-provider.ts | 437 ++++++------------ 3 files changed, 158 insertions(+), 342 deletions(-) diff --git a/examples/api-samples/src/browser-only/filesystem/example-filesystem-initialization.ts b/examples/api-samples/src/browser-only/filesystem/example-filesystem-initialization.ts index f048231f977a5..6eb822bb01c34 100644 --- a/examples/api-samples/src/browser-only/filesystem/example-filesystem-initialization.ts +++ b/examples/api-samples/src/browser-only/filesystem/example-filesystem-initialization.ts @@ -19,7 +19,6 @@ import { inject, injectable, interfaces } from '@theia/core/shared/inversify'; import { EncodingService } from '@theia/core/lib/common/encoding-service'; import { BrowserFSInitialization, DefaultBrowserFSInitialization } from '@theia/filesystem/lib/browser-only/browserfs-filesystem-initialization'; import { BrowserFSFileSystemProvider } from '@theia/filesystem/lib/browser-only/browserfs-filesystem-provider'; -import type { FSModule } from 'browserfs/dist/node/core/FS'; @injectable() export class ExampleBrowserFSInitialization extends DefaultBrowserFSInitialization { @@ -27,18 +26,35 @@ export class ExampleBrowserFSInitialization extends DefaultBrowserFSInitializati @inject(EncodingService) protected encodingService: EncodingService; - override async initializeFS(fs: FSModule, provider: BrowserFSFileSystemProvider): Promise { + override async initializeFS(dir: FileSystemDirectoryHandle, provider: BrowserFSFileSystemProvider): Promise { try { - if (!fs.existsSync('/home/workspace')) { + // Check whether the directory exists + try { + await provider.readdir(new URI('/home/workspace')); + } catch (e) { + console.error('An error occurred while reading the demo workspaces', e); await provider.mkdir(new URI('/home/workspace')); await provider.writeFile(new URI('/home/workspace/my-file.txt'), this.encodingService.encode('foo').buffer, { create: true, overwrite: false }); - await provider.writeFile(new URI('/home/workspace/my-file2.txt'), this.encodingService.encode('bar').buffer, { create: true, overwrite: false }); } - if (!fs.existsSync('/home/workspace2')) { + + try { + await provider.readdir(new URI('/home/workspace2')); + } catch (e) { + console.error('An error occurred while reading the demo workspaces', e); await provider.mkdir(new URI('/home/workspace2')); await provider.writeFile(new URI('/home/workspace2/my-file.json'), this.encodingService.encode('{ foo: true }').buffer, { create: true, overwrite: false }); - await provider.writeFile(new URI('/home/workspace2/my-file2.json'), this.encodingService.encode('{ bar: false }').buffer, { create: true, overwrite: false }); } + + // if (!fs.existsSync('/home/workspace')) { + // await provider.mkdir(new URI('/home/workspace')); + // await provider.writeFile(new URI('/home/workspace/my-file.txt'), this.encodingService.encode('foo').buffer, { create: true, overwrite: false }); + // await provider.writeFile(new URI('/home/workspace/my-file2.txt'), this.encodingService.encode('bar').buffer, { create: true, overwrite: false }); + // } + // if (!fs.existsSync('/home/workspace2')) { + // await provider.mkdir(new URI('/home/workspace2')); + // await provider.writeFile(new URI('/home/workspace2/my-file.json'), this.encodingService.encode('{ foo: true }').buffer, { create: true, overwrite: false }); + // await provider.writeFile(new URI('/home/workspace2/my-file2.json'), this.encodingService.encode('{ bar: false }').buffer, { create: true, overwrite: false }); + // } } catch (e) { console.error('An error occurred while initializing the demo workspaces', e); } diff --git a/packages/filesystem/src/browser-only/browserfs-filesystem-initialization.ts b/packages/filesystem/src/browser-only/browserfs-filesystem-initialization.ts index 0b17d3076a468..939ee38b2bd9a 100644 --- a/packages/filesystem/src/browser-only/browserfs-filesystem-initialization.ts +++ b/packages/filesystem/src/browser-only/browserfs-filesystem-initialization.ts @@ -14,48 +14,23 @@ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 // ***************************************************************************** -import type { FSModule } from 'browserfs/dist/node/core/FS'; import type { BrowserFSFileSystemProvider } from './browserfs-filesystem-provider'; import { injectable } from '@theia/core/shared/inversify'; -import { FileSystem, initialize } from 'browserfs'; -import MountableFileSystem from 'browserfs/dist/node/backend/MountableFileSystem'; export const BrowserFSInitialization = Symbol('BrowserFSInitialization'); export interface BrowserFSInitialization { - createMountableFileSystem(): Promise - initializeFS: (fs: FSModule, provider: BrowserFSFileSystemProvider) => Promise; + createMountableFileSystem(): Promise + initializeFS: (fs: FileSystemDirectoryHandle, provider: BrowserFSFileSystemProvider) => Promise; } @injectable() export class DefaultBrowserFSInitialization implements BrowserFSInitialization { - createMountableFileSystem(): Promise { - return new Promise(resolve => { - FileSystem.IndexedDB.Create({}, (e, persistedFS) => { - if (e) { - throw e; - } - if (!persistedFS) { - throw Error('Could not create filesystem'); - } - FileSystem.MountableFileSystem.Create({ - '/home': persistedFS - - }, (error, mountableFS) => { - if (error) { - throw error; - } - if (!mountableFS) { - throw Error('Could not create filesystem'); - } - initialize(mountableFS); - resolve(mountableFS); - }); - }); - }); + createMountableFileSystem(): Promise { + return navigator.storage.getDirectory() } - async initializeFS(fs: FSModule, provider: BrowserFSFileSystemProvider): Promise { + async initializeFS(dir: FileSystemDirectoryHandle, provider: BrowserFSFileSystemProvider): Promise { } } diff --git a/packages/filesystem/src/browser-only/browserfs-filesystem-provider.ts b/packages/filesystem/src/browser-only/browserfs-filesystem-provider.ts index ca833d9536313..3db6722231b4d 100644 --- a/packages/filesystem/src/browser-only/browserfs-filesystem-provider.ts +++ b/packages/filesystem/src/browser-only/browserfs-filesystem-provider.ts @@ -23,25 +23,15 @@ import { inject, injectable } from '@theia/core/shared/inversify'; import { - FileChange, FileDeleteOptions, FileOpenOptions, - FileOverwriteOptions, FileReadStreamOptions, FileSystemProviderCapabilities, + FileChange, FileDeleteOptions, + FileOverwriteOptions, FileSystemProviderCapabilities, FileSystemProviderError, FileSystemProviderErrorCode, FileSystemProviderWithFileReadWriteCapability, - FileType, FileUpdateOptions, FileUpdateResult, FileWriteOptions, Stat, WatchOptions, createFileSystemProviderError + FileType, FileWriteOptions, Stat, WatchOptions, createFileSystemProviderError } from '../common/files'; -import { Event, URI, Disposable, CancellationToken } from '@theia/core'; -import { TextDocumentContentChangeEvent } from '@theia/core/shared/vscode-languageserver-protocol'; -import { ReadableStreamEvents } from '@theia/core/lib/common/stream'; -import { BFSRequire } from 'browserfs'; -import type { FSModule } from 'browserfs/dist/node/core/FS'; -import type { FileSystem } from 'browserfs/dist/node/core/file_system'; -import MountableFileSystem from 'browserfs/dist/node/backend/MountableFileSystem'; -import { basename, dirname, normalize } from 'path'; -import Stats from 'browserfs/dist/node/core/node_fs_stats'; -import { retry } from '@theia/core/lib/common/promise-util'; +import { Event, URI, Disposable } from '@theia/core'; import { BrowserFSInitialization } from './browserfs-filesystem-initialization'; - // adapted from DiskFileSystemProvider @injectable() export class BrowserFSFileSystemProvider implements FileSystemProviderWithFileReadWriteCapability { @@ -49,19 +39,14 @@ export class BrowserFSFileSystemProvider implements FileSystemProviderWithFileRe onDidChangeCapabilities: Event = Event.None; onDidChangeFile: Event = Event.None; onFileWatchError: Event = Event.None; - private mapHandleToPos: Map = new Map(); - private writeHandles: Set = new Set(); - private canFlush: boolean = true; - private fs: FSModule; - private mountableFS: MountableFileSystem; + private directoryHandle: FileSystemDirectoryHandle; private initialized: Promise; constructor(@inject(BrowserFSInitialization) readonly initialization: BrowserFSInitialization) { const init = async (): Promise => { - this.mountableFS = await initialization.createMountableFileSystem(); - this.fs = BFSRequire('fs'); - await initialization.initializeFS(this.fs, new Proxy(this, { + this.directoryHandle = await initialization.createMountableFileSystem(); + await initialization.initializeFS(this.directoryHandle, new Proxy(this, { get(target, prop, receiver): unknown { if (prop === 'initialized') { return Promise.resolve(true); @@ -74,113 +59,118 @@ export class BrowserFSFileSystemProvider implements FileSystemProviderWithFileRe this.initialized = init(); } - async mount(mountPoint: string, fs: FileSystem): Promise { - await this.initialized; - this.mountableFS.mount(mountPoint, fs); - }; - watch(_resource: URI, _opts: WatchOptions): Disposable { return Disposable.NULL; } async stat(resource: URI): Promise { await this.initialized; - const path = this.toFilePath(resource); - - let stats: Stats; - try { - stats = await this.promisify(this.fs.stat)(path) as Stats; - } catch (error) { - throw this.toFileSystemProviderError(error); + let handle = await this.toFileSystemHandle(resource); + + if (handle.kind === 'file') { + let fileHandle = handle as FileSystemFileHandle + let file = await fileHandle.getFile(); + return { + type: FileType.File, + ctime: file.lastModified, + mtime: file.lastModified, + size: file.size + }; + } else if (handle.kind === 'directory') { + return { + type: FileType.Directory, + ctime: 0, + mtime: 0, + size: 0 + }; } - if (stats === undefined) { - throw new Error(`Could not read file stat for resource '${path}'`); - } - return { - type: this.toType(stats, /* symbolicLink */undefined), // FIXME: missing symbolicLink - ctime: stats.birthtime.getTime(), // intentionally not using ctime here, we want the creation time - mtime: stats.mtime.getTime(), - size: stats.size, - // FIXME: missing mode, permissions - }; - + throw new Error('Method not implemented.'); } async mkdir(resource: URI): Promise { await this.initialized; - try { - await this.promisify(this.fs.mkdir)(this.toFilePath(resource)); - } catch (error) { - throw this.toFileSystemProviderError(error); - } + + await this.toFileSystemHandle(resource, true, true); } + async readdir(resource: URI): Promise<[string, FileType][]> { await this.initialized; + try { + // Get the directory handle from the directoryHandle + const directoryHandle = await this.toFileSystemHandle(resource, false, true) as FileSystemDirectoryHandle; - const children = await this.promisify(this.fs.readdir)(this.toFilePath(resource)) as string[]; const result: [string, FileType][] = []; - await Promise.all(children.map(async child => { + + // Iterate through the entries in the directory (files and subdirectories) + for await (const [name, handle] of (directoryHandle as any).entries()) { try { - const stat = await this.stat(resource.resolve(child)); - result.push([child, stat.type]); + // Determine the type of the entry (file or directory) + if (handle.kind === 'file') { + result.push([name, FileType.File]); + } else if (handle.kind === 'directory') { + result.push([name, FileType.Directory]); + } } catch (error) { - console.trace(error); // ignore errors for individual entries that can arise from permission denied + console.trace(error); // Ignore errors for individual entries } - })); + } + console.info('readdir', resource.path.toString(), result); return result; } catch (error) { throw this.toFileSystemProviderError(error); } } + async delete(resource: URI, _opts: FileDeleteOptions): Promise { await this.initialized; + throw new Error('Method not implemented.'); // FIXME use options - try { - await this.promisify(this.fs.unlink)(this.toFilePath(resource)); - } catch (error) { - throw this.toFileSystemProviderError(error); - } + // try { + // await this.promisify(this.fs.unlink)(this.toFilePath(resource)); + // } catch (error) { + // throw this.toFileSystemProviderError(error); + // } } async rename(from: URI, to: URI, opts: FileOverwriteOptions): Promise { await this.initialized; - const fromFilePath = this.toFilePath(from); - const toFilePath = this.toFilePath(to); - if (fromFilePath === toFilePath) { - return; // simulate node.js behaviour here and do a no-op if paths match - } - try { - // assume FS is path case sensitive - correct? - const targetExists = await this.promisify(this.fs.exists)(toFilePath); - if (targetExists) { - throw Error(`File '${toFilePath}' already exists.`); - } - if (fromFilePath === toFilePath) { - return Promise.resolve(); - } - - await this.promisify(this.fs.rename)(fromFilePath, toFilePath); - - const stat = await this.promisify(this.fs.lstat)(toFilePath) as Stats; - if (stat.isDirectory() || stat.isSymbolicLink()) { - return Promise.resolve(); // only for files - } - const fd = await this.promisify(open)(toFilePath, 'a'); - try { - await this.promisify(this.fs.futimes)(fd, stat.atime, new Date()); - } catch (error) { - // ignore - } - - this.promisify(this.fs.close)(fd); - } catch (error) { - // rewrite some typical errors that can happen especially around symlinks - // to something the user can better understand - if (error.code === 'EINVAL' || error.code === 'EBUSY' || error.code === 'ENAMETOOLONG') { - error = new Error(`Unable to move '${basename(fromFilePath)}' into '${basename(dirname(toFilePath))}' (${error.toString()}).`); - } - - throw this.toFileSystemProviderError(error); - } + // const fromFilePath = this.toFilePath(from); + // const toFilePath = this.toFilePath(to); + // if (fromFilePath === toFilePath) { + // return; // simulate node.js behaviour here and do a no-op if paths match + // } + // try { + // // assume FS is path case sensitive - correct? + // const targetExists = await this.promisify(this.fs.exists)(toFilePath); + // if (targetExists) { + // throw Error(`File '${toFilePath}' already exists.`); + // } + // if (fromFilePath === toFilePath) { + // return Promise.resolve(); + // } + + // await this.promisify(this.fs.rename)(fromFilePath, toFilePath); + + // const stat = await this.promisify(this.fs.lstat)(toFilePath) as Stats; + // if (stat.isDirectory() || stat.isSymbolicLink()) { + // return Promise.resolve(); // only for files + // } + // const fd = await this.promisify(open)(toFilePath, 'a'); + // try { + // await this.promisify(this.fs.futimes)(fd, stat.atime, new Date()); + // } catch (error) { + // // ignore + // } + + // this.promisify(this.fs.close)(fd); + // } catch (error) { + // // rewrite some typical errors that can happen especially around symlinks + // // to something the user can better understand + // if (error.code === 'EINVAL' || error.code === 'EBUSY' || error.code === 'ENAMETOOLONG') { + // error = new Error(`Unable to move '${basename(fromFilePath)}' into '${basename(dirname(toFilePath))}' (${error.toString()}).`); + // } + + // throw this.toFileSystemProviderError(error); + // } } async copy?(from: URI, to: URI, opts: FileOverwriteOptions): Promise { await this.initialized; @@ -188,247 +178,82 @@ export class BrowserFSFileSystemProvider implements FileSystemProviderWithFileRe } async readFile(resource: URI): Promise { await this.initialized; + try { - const filePath = this.toFilePath(resource); - return await this.promisify(this.fs.readFile)(filePath) as Uint8Array; + // Get the file handle from the directoryHandle + const fileHandle = await this.toFileSystemHandle(resource, false, false) as FileSystemFileHandle; + + // Get the file itself (which includes the content) + const file = await fileHandle.getFile(); + + // Read the file as an ArrayBuffer and convert it to Uint8Array + const arrayBuffer = await file.arrayBuffer(); + return new Uint8Array(arrayBuffer); + } catch (error) { throw this.toFileSystemProviderError(error); } } + async writeFile(resource: URI, content: Uint8Array, opts: FileWriteOptions): Promise { + // TODO implement overwrite await this.initialized; - let handle: number | undefined = undefined; + let writeableHandle: FileSystemWritableFileStream | undefined = undefined; try { - const filePath = this.toFilePath(resource); - - // Validate target unless { create: true, overwrite: true } - if (!opts.create || !opts.overwrite) { - const fileExists = await this.promisify(this.fs.exists)(filePath); - if (fileExists) { - if (!opts.overwrite) { - throw createFileSystemProviderError('File already exists', FileSystemProviderErrorCode.FileExists); - } - } else { - if (!opts.create) { - throw createFileSystemProviderError('File does not exist', FileSystemProviderErrorCode.FileNotFound); - } - } - } + let handle = await this.toFileSystemHandle(resource, true, false) as FileSystemFileHandle; // Open - handle = await this.open(resource, { create: true }); + writeableHandle = await handle?.createWritable(); // Write content at once - await this.write(handle, 0, content, 0, content.byteLength); + console.info('writeFile', resource.path.toString(), content); + await writeableHandle?.write(content); } catch (error) { throw this.toFileSystemProviderError(error); } finally { - if (typeof handle === 'number') { - await this.close(handle); + if (typeof writeableHandle !== 'undefined') { + await writeableHandle.close(); } } } - readFileStream?(resource: URI, opts: FileReadStreamOptions, token: CancellationToken): ReadableStreamEvents { - throw new Error('Method not implemented.'); - } - async open(resource: URI, opts: FileOpenOptions): Promise { - await this.initialized; - try { - const filePath = this.toFilePath(resource); - - let flags: string | undefined = undefined; - if (opts.create) { - // we take opts.create as a hint that the file is opened for writing - // as such we use 'w' to truncate an existing or create the - // file otherwise. we do not allow reading. - if (!flags) { - flags = 'w'; - } - } else { - // otherwise we assume the file is opened for reading - // as such we use 'r' to neither truncate, nor create - // the file. - flags = 'r'; - } - - const handle = await this.promisify(this.fs.open)(filePath, flags) as number; - - // remember this handle to track file position of the handle - // we init the position to 0 since the file descriptor was - // just created and the position was not moved so far (see - // also http://man7.org/linux/man-pages/man2/open.2.html - - // "The file offset is set to the beginning of the file.") - this.mapHandleToPos.set(handle, 0); - // remember that this handle was used for writing - if (opts.create) { - this.writeHandles.add(handle); - } - - return handle; - } catch (error) { - throw this.toFileSystemProviderError(error); - } - } - async close(fd: number): Promise { - await this.initialized; - // remove this handle from map of positions - this.mapHandleToPos.delete(fd); - - // if a handle is closed that was used for writing, ensure - // to flush the contents to disk if possible. - if (this.writeHandles.delete(fd) && this.canFlush) { - try { - await this.promisify(this.fs.fdatasync)(fd); - } catch (error) { - // In some exotic setups it is well possible that node fails to sync - // In that case we disable flushing and log the error to our logger - this.canFlush = false; - console.error(error); - } - } + private async toFileSystemHandle(resource: URI, create?: boolean, is_dir?: boolean): Promise { + const pathParts = resource.path.toString().split('/').filter(Boolean); - await this.promisify(this.fs.close)(fd); + return this.recursiveFileSystemHandle(this.directoryHandle, pathParts, create, is_dir); } - async read(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise { - await this.initialized; - const normalizedPos = this.normalizePos(fd, pos); - - let bytesRead: number | null = null; - try { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const result: { bytesRead: number, buffer: Uint8Array } | number = (await this.promisify(this.fs.read)(fd, data, offset, length, normalizedPos)) as any; - if (typeof result === 'number') { - bytesRead = result; // node.d.ts fail - } else { - bytesRead = result.bytesRead; - } - - return bytesRead; - } catch (error) { - throw this.toFileSystemProviderError(error); - } finally { - this.updatePos(fd, normalizedPos, bytesRead); + private async recursiveFileSystemHandle(handle: FileSystemDirectoryHandle, pathParts: string[], create?: boolean, is_dir?: boolean): Promise { + // We reached the end of the path, this happens only when not creating + if (pathParts.length === 0) { + return handle; } - } - async write(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise { - await this.initialized; - // we know at this point that the file to write to is truncated and thus empty - // if the write now fails, the file remains empty. as such we really try hard - // to ensure the write succeeds by retrying up to three times. - return retry(() => this.doWrite(fd, pos, data, offset, length), 100 /* ms delay */, 3 /* retries */); - - } - private async doWrite(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise { - await this.initialized; - const normalizedPos = this.normalizePos(fd, pos); - - let bytesWritten: number | null = null; - try { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const result: { bytesWritten: number, buffer: Uint8Array } | number = (await this.promisify(this.fs.write)(fd, data, offset, length, normalizedPos)) as any; - - if (typeof result === 'number') { - bytesWritten = result; // node.d.ts fail + // We need to create it and thus we need to stop early to create the file or directory + if (pathParts.length === 1 && create) { + if (is_dir) { + return handle.getDirectoryHandle(pathParts[0], { create: create }); } else { - bytesWritten = result.bytesWritten; + return handle.getFileHandle(pathParts[0], { create: create }); } - - return bytesWritten; - } catch (error) { - throw this.toFileSystemProviderError(error); - } finally { - this.updatePos(fd, normalizedPos, bytesWritten); - } - } - private normalizePos(fd: number, pos: number): number | null { - - // when calling fs.read/write we try to avoid passing in the "pos" argument and - // rather prefer to pass in "null" because this avoids an extra seek(pos) - // call that in some cases can even fail (e.g. when opening a file over FTP - - // see https://github.com/microsoft/vscode/issues/73884). - // - // as such, we compare the passed in position argument with our last known - // position for the file descriptor and use "null" if they match. - if (pos === this.mapHandleToPos.get(fd)) { - return null; } - return pos; - } - private updatePos(fd: number, pos: number | null, bytesLength: number | null): void { - const lastKnownPos = this.mapHandleToPos.get(fd); - if (typeof lastKnownPos === 'number') { - - // pos !== null signals that previously a position was used that is - // not null. node.js documentation explains, that in this case - // the internal file pointer is not moving and as such we do not move - // our position pointer. - // - // Docs: "If position is null, data will be read from the current file position, - // and the file position will be updated. If position is an integer, the file position - // will remain unchanged." - if (typeof pos === 'number') { - // do not modify the position - } else if (typeof bytesLength === 'number') { - this.mapHandleToPos.set(fd, lastKnownPos + bytesLength); - } else { - this.mapHandleToPos.delete(fd); + // Continue to resolve the path + const part = pathParts.shift()!; + for await (const entry of (handle as any).entries()) { + if (entry[0] === part) { + return this.recursiveFileSystemHandle(entry[1], pathParts, create, is_dir); } } - } - async access?(resource: URI, mode?: number | undefined): Promise { - await this.initialized; - throw new Error('Method not implemented.'); - } - async fsPath?(resource: URI): Promise { - await this.initialized; - throw new Error('Method not implemented.'); - } - async updateFile?(resource: URI, changes: TextDocumentContentChangeEvent[], opts: FileUpdateOptions): Promise { - await this.initialized; - throw new Error('Method not implemented.'); - } - - private toFilePath(resource: URI): string { - return normalize(resource.path.toString()); - } - - private toType(entry: Stats, symbolicLink?: { dangling: boolean }): FileType { - // Signal file type by checking for file / directory, except: - // - symbolic links pointing to non-existing files are FileType.Unknown - // - files that are neither file nor directory are FileType.Unknown - let type: FileType; - if (symbolicLink?.dangling) { - type = FileType.Unknown; - } else if (entry.isFile()) { - type = FileType.File; - } else if (entry.isDirectory()) { - type = FileType.Directory; - } else { - type = FileType.Unknown; - } - // Always signal symbolic link as file type additionally - if (symbolicLink) { - type |= FileType.SymbolicLink; + // If we haven't found the part, we need to create it along the way + if (create) { + let newHandle = await (handle as FileSystemDirectoryHandle).getDirectoryHandle(part, { create: true }); + return this.recursiveFileSystemHandle(newHandle, pathParts, create, is_dir); } - return type; + throw FileSystemProviderErrorCode.FileNotFound; } - // FIXME typing - // eslint-disable-next-line @typescript-eslint/no-explicit-any - private promisify(f: Function): (...args: any[]) => Promise { - // eslint-disable-next-line @typescript-eslint/tslint/config, @typescript-eslint/no-explicit-any - return function (...args: any[]) { - return new Promise((resolve, reject) => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - f(...args, (err: Error, result: T) => err ? reject(err) : resolve(result)); - }); - }; - } private toFileSystemProviderError(error: NodeJS.ErrnoException): FileSystemProviderError { if (error instanceof FileSystemProviderError) { From a28a085365178719fc5a711e20203cb36f4ef791 Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Sat, 28 Sep 2024 23:00:18 +0200 Subject: [PATCH 02/36] Add missing methods and event emitter --- .../browserfs-filesystem-provider.ts | 84 +++++++------------ 1 file changed, 32 insertions(+), 52 deletions(-) diff --git a/packages/filesystem/src/browser-only/browserfs-filesystem-provider.ts b/packages/filesystem/src/browser-only/browserfs-filesystem-provider.ts index 3db6722231b4d..ba2fd30ea5e0e 100644 --- a/packages/filesystem/src/browser-only/browserfs-filesystem-provider.ts +++ b/packages/filesystem/src/browser-only/browserfs-filesystem-provider.ts @@ -23,21 +23,23 @@ import { inject, injectable } from '@theia/core/shared/inversify'; import { - FileChange, FileDeleteOptions, + FileChange, FileChangeType, FileDeleteOptions, FileOverwriteOptions, FileSystemProviderCapabilities, FileSystemProviderError, FileSystemProviderErrorCode, FileSystemProviderWithFileReadWriteCapability, FileType, FileWriteOptions, Stat, WatchOptions, createFileSystemProviderError } from '../common/files'; -import { Event, URI, Disposable } from '@theia/core'; +import { Emitter, Event, URI, Disposable } from '@theia/core'; import { BrowserFSInitialization } from './browserfs-filesystem-initialization'; // adapted from DiskFileSystemProvider @injectable() export class BrowserFSFileSystemProvider implements FileSystemProviderWithFileReadWriteCapability { capabilities: FileSystemProviderCapabilities = FileSystemProviderCapabilities.FileReadWrite; onDidChangeCapabilities: Event = Event.None; - onDidChangeFile: Event = Event.None; + + private readonly onDidChangeFileEmitter = new Emitter(); + readonly onDidChangeFile = this.onDidChangeFileEmitter.event; onFileWatchError: Event = Event.None; private directoryHandle: FileSystemDirectoryHandle; @@ -123,59 +125,35 @@ export class BrowserFSFileSystemProvider implements FileSystemProviderWithFileRe async delete(resource: URI, _opts: FileDeleteOptions): Promise { await this.initialized; - throw new Error('Method not implemented.'); - // FIXME use options - // try { - // await this.promisify(this.fs.unlink)(this.toFilePath(resource)); - // } catch (error) { - // throw this.toFileSystemProviderError(error); - // } + try { + const parentURI = resource.parent; + const parentHandle = await this.toFileSystemHandle(parentURI, false, true); + if (parentHandle.kind !== 'directory') { + throw createFileSystemProviderError(new Error('Parent is not a directory'), FileSystemProviderErrorCode.FileNotADirectory); + } + const dirHandle = parentHandle as FileSystemDirectoryHandle; + const name = resource.path.base; + return await dirHandle.removeEntry(name, { recursive: _opts.recursive }); + } catch (error) { + throw this.toFileSystemProviderError(error); + } finally { + this.onDidChangeFileEmitter.fire([{ resource, type: FileChangeType.DELETED }]); + } } async rename(from: URI, to: URI, opts: FileOverwriteOptions): Promise { await this.initialized; - // const fromFilePath = this.toFilePath(from); - // const toFilePath = this.toFilePath(to); - // if (fromFilePath === toFilePath) { - // return; // simulate node.js behaviour here and do a no-op if paths match - // } - // try { - // // assume FS is path case sensitive - correct? - // const targetExists = await this.promisify(this.fs.exists)(toFilePath); - // if (targetExists) { - // throw Error(`File '${toFilePath}' already exists.`); - // } - // if (fromFilePath === toFilePath) { - // return Promise.resolve(); - // } - - // await this.promisify(this.fs.rename)(fromFilePath, toFilePath); - - // const stat = await this.promisify(this.fs.lstat)(toFilePath) as Stats; - // if (stat.isDirectory() || stat.isSymbolicLink()) { - // return Promise.resolve(); // only for files - // } - // const fd = await this.promisify(open)(toFilePath, 'a'); - // try { - // await this.promisify(this.fs.futimes)(fd, stat.atime, new Date()); - // } catch (error) { - // // ignore - // } - - // this.promisify(this.fs.close)(fd); - // } catch (error) { - // // rewrite some typical errors that can happen especially around symlinks - // // to something the user can better understand - // if (error.code === 'EINVAL' || error.code === 'EBUSY' || error.code === 'ENAMETOOLONG') { - // error = new Error(`Unable to move '${basename(fromFilePath)}' into '${basename(dirname(toFilePath))}' (${error.toString()}).`); - // } - - // throw this.toFileSystemProviderError(error); - // } - } - async copy?(from: URI, to: URI, opts: FileOverwriteOptions): Promise { - await this.initialized; - throw new Error('Method not implemented.'); + try { + console.info('rename', from.path.toString(), to.path.toString()); + const content = await this.readFile(from); + await this.writeFile(to, content, { create: true, overwrite: true }); + await this.delete(from, { recursive: true, useTrash: false }); + + this.onDidChangeFileEmitter.fire([{ resource: to, type: FileChangeType.ADDED }]); + } catch (error) { + throw this.toFileSystemProviderError(error); + } } + async readFile(resource: URI): Promise { await this.initialized; @@ -208,6 +186,8 @@ export class BrowserFSFileSystemProvider implements FileSystemProviderWithFileRe // Write content at once console.info('writeFile', resource.path.toString(), content); await writeableHandle?.write(content); + + this.onDidChangeFileEmitter.fire([{ resource: resource, type: FileChangeType.ADDED }]); } catch (error) { throw this.toFileSystemProviderError(error); } finally { From 6578c25057cc26d109d94cb16e1d8ae97fbe1a2a Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Thu, 3 Oct 2024 13:36:17 +0200 Subject: [PATCH 03/36] Remove references to browserfs and replace it with OPFS --- .../api-samples-frontend-only-module.ts | 4 +-- .../example-filesystem-initialization.ts | 25 ++++++------------- packages/filesystem/package.json | 1 - ...browser-only-filesystem-frontend-module.ts | 14 +++++------ ...n.ts => opfs-filesystem-initialization.ts} | 14 +++++------ ...rovider.ts => opfs-filesystem-provider.ts} | 20 ++++++++------- 6 files changed, 34 insertions(+), 44 deletions(-) rename packages/filesystem/src/browser-only/{browserfs-filesystem-initialization.ts => opfs-filesystem-initialization.ts} (70%) rename packages/filesystem/src/browser-only/{browserfs-filesystem-provider.ts => opfs-filesystem-provider.ts} (92%) diff --git a/examples/api-samples/src/browser-only/api-samples-frontend-only-module.ts b/examples/api-samples/src/browser-only/api-samples-frontend-only-module.ts index 2fe1703ffa8b1..6de6d07280007 100644 --- a/examples/api-samples/src/browser-only/api-samples-frontend-only-module.ts +++ b/examples/api-samples/src/browser-only/api-samples-frontend-only-module.ts @@ -15,7 +15,7 @@ // ***************************************************************************** import { ContainerModule, interfaces } from '@theia/core/shared/inversify'; -import { bindBrowserFSInitialization } from './filesystem/example-filesystem-initialization'; +import { bindOPFSInitialization } from './filesystem/example-filesystem-initialization'; export default new ContainerModule(( bind: interfaces.Bind, @@ -23,5 +23,5 @@ export default new ContainerModule(( _isBound: interfaces.IsBound, rebind: interfaces.Rebind, ) => { - bindBrowserFSInitialization(bind, rebind); + bindOPFSInitialization(bind, rebind); }); diff --git a/examples/api-samples/src/browser-only/filesystem/example-filesystem-initialization.ts b/examples/api-samples/src/browser-only/filesystem/example-filesystem-initialization.ts index 6eb822bb01c34..69a09fb07595a 100644 --- a/examples/api-samples/src/browser-only/filesystem/example-filesystem-initialization.ts +++ b/examples/api-samples/src/browser-only/filesystem/example-filesystem-initialization.ts @@ -17,16 +17,16 @@ import { URI } from '@theia/core'; import { inject, injectable, interfaces } from '@theia/core/shared/inversify'; import { EncodingService } from '@theia/core/lib/common/encoding-service'; -import { BrowserFSInitialization, DefaultBrowserFSInitialization } from '@theia/filesystem/lib/browser-only/browserfs-filesystem-initialization'; -import { BrowserFSFileSystemProvider } from '@theia/filesystem/lib/browser-only/browserfs-filesystem-provider'; +import { OPFSInitialization, DefaultOPFSInitialization } from '@theia/filesystem/lib/browser-only/opfs-filesystem-initialization'; +import { OPFSFileSystemProvider } from '@theia/filesystem/lib/browser-only/opfs-filesystem-provider'; @injectable() -export class ExampleBrowserFSInitialization extends DefaultBrowserFSInitialization { +export class ExampleOPFSInitialization extends DefaultOPFSInitialization { @inject(EncodingService) protected encodingService: EncodingService; - override async initializeFS(dir: FileSystemDirectoryHandle, provider: BrowserFSFileSystemProvider): Promise { + override async initializeFS(dir: FileSystemDirectoryHandle, provider: OPFSFileSystemProvider): Promise { try { // Check whether the directory exists try { @@ -44,24 +44,13 @@ export class ExampleBrowserFSInitialization extends DefaultBrowserFSInitializati await provider.mkdir(new URI('/home/workspace2')); await provider.writeFile(new URI('/home/workspace2/my-file.json'), this.encodingService.encode('{ foo: true }').buffer, { create: true, overwrite: false }); } - - // if (!fs.existsSync('/home/workspace')) { - // await provider.mkdir(new URI('/home/workspace')); - // await provider.writeFile(new URI('/home/workspace/my-file.txt'), this.encodingService.encode('foo').buffer, { create: true, overwrite: false }); - // await provider.writeFile(new URI('/home/workspace/my-file2.txt'), this.encodingService.encode('bar').buffer, { create: true, overwrite: false }); - // } - // if (!fs.existsSync('/home/workspace2')) { - // await provider.mkdir(new URI('/home/workspace2')); - // await provider.writeFile(new URI('/home/workspace2/my-file.json'), this.encodingService.encode('{ foo: true }').buffer, { create: true, overwrite: false }); - // await provider.writeFile(new URI('/home/workspace2/my-file2.json'), this.encodingService.encode('{ bar: false }').buffer, { create: true, overwrite: false }); - // } } catch (e) { console.error('An error occurred while initializing the demo workspaces', e); } } } -export const bindBrowserFSInitialization = (bind: interfaces.Bind, rebind: interfaces.Rebind): void => { - bind(ExampleBrowserFSInitialization).toSelf(); - rebind(BrowserFSInitialization).toService(ExampleBrowserFSInitialization); +export const bindOPFSInitialization = (bind: interfaces.Bind, rebind: interfaces.Rebind): void => { + bind(ExampleOPFSInitialization).toSelf(); + rebind(OPFSInitialization).toService(ExampleOPFSInitialization); }; diff --git a/packages/filesystem/package.json b/packages/filesystem/package.json index 7c1a60322c673..afb810c516d6b 100644 --- a/packages/filesystem/package.json +++ b/packages/filesystem/package.json @@ -10,7 +10,6 @@ "@types/tar-fs": "^1.16.1", "async-mutex": "^0.3.1", "body-parser": "^1.18.3", - "browserfs": "^1.4.3", "http-status-codes": "^1.3.0", "minimatch": "^5.1.0", "multer": "1.4.4-lts.1", diff --git a/packages/filesystem/src/browser-only/browser-only-filesystem-frontend-module.ts b/packages/filesystem/src/browser-only/browser-only-filesystem-frontend-module.ts index eae27435b6d90..bc3ff5b51808b 100644 --- a/packages/filesystem/src/browser-only/browser-only-filesystem-frontend-module.ts +++ b/packages/filesystem/src/browser-only/browser-only-filesystem-frontend-module.ts @@ -16,19 +16,19 @@ import { ContainerModule } from '@theia/core/shared/inversify'; import { FileSystemProvider } from '../common/files'; -import { BrowserFSFileSystemProvider } from './browserfs-filesystem-provider'; +import { OPFSFileSystemProvider } from './opfs-filesystem-provider'; import { RemoteFileSystemProvider, RemoteFileSystemServer } from '../common/remote-file-system-provider'; -import { BrowserFSInitialization, DefaultBrowserFSInitialization } from './browserfs-filesystem-initialization'; +import { OPFSInitialization, DefaultOPFSInitialization } from './opfs-filesystem-initialization'; import { BrowserOnlyFileSystemProviderServer } from './browser-only-filesystem-provider-server'; export default new ContainerModule((bind, _unbind, isBound, rebind) => { - bind(DefaultBrowserFSInitialization).toSelf(); - bind(BrowserFSFileSystemProvider).toSelf(); - bind(BrowserFSInitialization).toService(DefaultBrowserFSInitialization); + bind(DefaultOPFSInitialization).toSelf(); + bind(OPFSFileSystemProvider).toSelf(); + bind(OPFSInitialization).toService(DefaultOPFSInitialization); if (isBound(FileSystemProvider)) { - rebind(FileSystemProvider).to(BrowserFSFileSystemProvider).inSingletonScope(); + rebind(FileSystemProvider).to(OPFSFileSystemProvider).inSingletonScope(); } else { - bind(FileSystemProvider).to(BrowserFSFileSystemProvider).inSingletonScope(); + bind(FileSystemProvider).to(OPFSFileSystemProvider).inSingletonScope(); } if (isBound(RemoteFileSystemProvider)) { rebind(RemoteFileSystemServer).to(BrowserOnlyFileSystemProviderServer).inSingletonScope(); diff --git a/packages/filesystem/src/browser-only/browserfs-filesystem-initialization.ts b/packages/filesystem/src/browser-only/opfs-filesystem-initialization.ts similarity index 70% rename from packages/filesystem/src/browser-only/browserfs-filesystem-initialization.ts rename to packages/filesystem/src/browser-only/opfs-filesystem-initialization.ts index 939ee38b2bd9a..b36df0e26a9ab 100644 --- a/packages/filesystem/src/browser-only/browserfs-filesystem-initialization.ts +++ b/packages/filesystem/src/browser-only/opfs-filesystem-initialization.ts @@ -14,23 +14,23 @@ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 // ***************************************************************************** -import type { BrowserFSFileSystemProvider } from './browserfs-filesystem-provider'; +import type { OPFSFileSystemProvider } from './opfs-filesystem-provider'; import { injectable } from '@theia/core/shared/inversify'; -export const BrowserFSInitialization = Symbol('BrowserFSInitialization'); -export interface BrowserFSInitialization { +export const OPFSInitialization = Symbol('OPFSInitialization'); +export interface OPFSInitialization { createMountableFileSystem(): Promise - initializeFS: (fs: FileSystemDirectoryHandle, provider: BrowserFSFileSystemProvider) => Promise; + initializeFS: (fs: FileSystemDirectoryHandle, provider: OPFSFileSystemProvider) => Promise; } @injectable() -export class DefaultBrowserFSInitialization implements BrowserFSInitialization { +export class DefaultOPFSInitialization implements OPFSInitialization { createMountableFileSystem(): Promise { - return navigator.storage.getDirectory() + return navigator.storage.getDirectory(); } - async initializeFS(dir: FileSystemDirectoryHandle, provider: BrowserFSFileSystemProvider): Promise { + async initializeFS(dir: FileSystemDirectoryHandle, provider: OPFSFileSystemProvider): Promise { } } diff --git a/packages/filesystem/src/browser-only/browserfs-filesystem-provider.ts b/packages/filesystem/src/browser-only/opfs-filesystem-provider.ts similarity index 92% rename from packages/filesystem/src/browser-only/browserfs-filesystem-provider.ts rename to packages/filesystem/src/browser-only/opfs-filesystem-provider.ts index ba2fd30ea5e0e..89b345694c46c 100644 --- a/packages/filesystem/src/browser-only/browserfs-filesystem-provider.ts +++ b/packages/filesystem/src/browser-only/opfs-filesystem-provider.ts @@ -31,10 +31,10 @@ import { FileType, FileWriteOptions, Stat, WatchOptions, createFileSystemProviderError } from '../common/files'; import { Emitter, Event, URI, Disposable } from '@theia/core'; -import { BrowserFSInitialization } from './browserfs-filesystem-initialization'; +import { OPFSInitialization } from './opfs-filesystem-initialization'; // adapted from DiskFileSystemProvider @injectable() -export class BrowserFSFileSystemProvider implements FileSystemProviderWithFileReadWriteCapability { +export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWriteCapability { capabilities: FileSystemProviderCapabilities = FileSystemProviderCapabilities.FileReadWrite; onDidChangeCapabilities: Event = Event.None; @@ -45,7 +45,7 @@ export class BrowserFSFileSystemProvider implements FileSystemProviderWithFileRe private directoryHandle: FileSystemDirectoryHandle; private initialized: Promise; - constructor(@inject(BrowserFSInitialization) readonly initialization: BrowserFSInitialization) { + constructor(@inject(OPFSInitialization) readonly initialization: OPFSInitialization) { const init = async (): Promise => { this.directoryHandle = await initialization.createMountableFileSystem(); await initialization.initializeFS(this.directoryHandle, new Proxy(this, { @@ -66,11 +66,11 @@ export class BrowserFSFileSystemProvider implements FileSystemProviderWithFileRe } async stat(resource: URI): Promise { await this.initialized; - let handle = await this.toFileSystemHandle(resource); + const handle = await this.toFileSystemHandle(resource); if (handle.kind === 'file') { - let fileHandle = handle as FileSystemFileHandle - let file = await fileHandle.getFile(); + const fileHandle = handle as FileSystemFileHandle; + const file = await fileHandle.getFile(); return { type: FileType.File, ctime: file.lastModified, @@ -103,6 +103,7 @@ export class BrowserFSFileSystemProvider implements FileSystemProviderWithFileRe const result: [string, FileType][] = []; // Iterate through the entries in the directory (files and subdirectories) + // eslint-disable-next-line @typescript-eslint/no-explicit-any for await (const [name, handle] of (directoryHandle as any).entries()) { try { // Determine the type of the entry (file or directory) @@ -178,7 +179,7 @@ export class BrowserFSFileSystemProvider implements FileSystemProviderWithFileRe await this.initialized; let writeableHandle: FileSystemWritableFileStream | undefined = undefined; try { - let handle = await this.toFileSystemHandle(resource, true, false) as FileSystemFileHandle; + const handle = await this.toFileSystemHandle(resource, true, false) as FileSystemFileHandle; // Open writeableHandle = await handle?.createWritable(); @@ -198,6 +199,7 @@ export class BrowserFSFileSystemProvider implements FileSystemProviderWithFileRe } private async toFileSystemHandle(resource: URI, create?: boolean, is_dir?: boolean): Promise { + // TODO use constants instead of / for path separator const pathParts = resource.path.toString().split('/').filter(Boolean); return this.recursiveFileSystemHandle(this.directoryHandle, pathParts, create, is_dir); @@ -219,6 +221,7 @@ export class BrowserFSFileSystemProvider implements FileSystemProviderWithFileRe // Continue to resolve the path const part = pathParts.shift()!; + // eslint-disable-next-line @typescript-eslint/no-explicit-any for await (const entry of (handle as any).entries()) { if (entry[0] === part) { return this.recursiveFileSystemHandle(entry[1], pathParts, create, is_dir); @@ -227,14 +230,13 @@ export class BrowserFSFileSystemProvider implements FileSystemProviderWithFileRe // If we haven't found the part, we need to create it along the way if (create) { - let newHandle = await (handle as FileSystemDirectoryHandle).getDirectoryHandle(part, { create: true }); + const newHandle = await (handle as FileSystemDirectoryHandle).getDirectoryHandle(part, { create: true }); return this.recursiveFileSystemHandle(newHandle, pathParts, create, is_dir); } throw FileSystemProviderErrorCode.FileNotFound; } - private toFileSystemProviderError(error: NodeJS.ErrnoException): FileSystemProviderError { if (error instanceof FileSystemProviderError) { return error; // avoid double conversion From e928eec148939e238ad378a9875ee6fb41f20ad3 Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Fri, 4 Oct 2024 19:59:44 +0200 Subject: [PATCH 04/36] Improve coding style and remove logging --- .../browser-only/opfs-filesystem-provider.ts | 57 ++++++++++++------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/packages/filesystem/src/browser-only/opfs-filesystem-provider.ts b/packages/filesystem/src/browser-only/opfs-filesystem-provider.ts index 89b345694c46c..f687d533670df 100644 --- a/packages/filesystem/src/browser-only/opfs-filesystem-provider.ts +++ b/packages/filesystem/src/browser-only/opfs-filesystem-provider.ts @@ -32,6 +32,12 @@ import { } from '../common/files'; import { Emitter, Event, URI, Disposable } from '@theia/core'; import { OPFSInitialization } from './opfs-filesystem-initialization'; + +interface ToFileSystemOptions { + isDirectory?: boolean; + create?: boolean; +} + // adapted from DiskFileSystemProvider @injectable() export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWriteCapability { @@ -85,12 +91,12 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri size: 0 }; } - throw new Error('Method not implemented.'); + throw createFileSystemProviderError('File does not exist', FileSystemProviderErrorCode.FileNotFound); } async mkdir(resource: URI): Promise { await this.initialized; - await this.toFileSystemHandle(resource, true, true); + await this.toFileSystemHandle(resource, { create: true, isDirectory: true }); } async readdir(resource: URI): Promise<[string, FileType][]> { @@ -98,7 +104,7 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri try { // Get the directory handle from the directoryHandle - const directoryHandle = await this.toFileSystemHandle(resource, false, true) as FileSystemDirectoryHandle; + const directoryHandle = await this.toFileSystemHandle(resource, { create: false, isDirectory: true }) as FileSystemDirectoryHandle; const result: [string, FileType][] = []; @@ -113,11 +119,10 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri result.push([name, FileType.Directory]); } } catch (error) { - console.trace(error); // Ignore errors for individual entries + console.error(error); // Ignore errors for individual entries, log them and continue } } - console.info('readdir', resource.path.toString(), result); return result; } catch (error) { throw this.toFileSystemProviderError(error); @@ -128,7 +133,7 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri await this.initialized; try { const parentURI = resource.parent; - const parentHandle = await this.toFileSystemHandle(parentURI, false, true); + const parentHandle = await this.toFileSystemHandle(parentURI, { create: false, isDirectory: true }); if (parentHandle.kind !== 'directory') { throw createFileSystemProviderError(new Error('Parent is not a directory'), FileSystemProviderErrorCode.FileNotADirectory); } @@ -144,7 +149,6 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri async rename(from: URI, to: URI, opts: FileOverwriteOptions): Promise { await this.initialized; try { - console.info('rename', from.path.toString(), to.path.toString()); const content = await this.readFile(from); await this.writeFile(to, content, { create: true, overwrite: true }); await this.delete(from, { recursive: true, useTrash: false }); @@ -160,7 +164,7 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri try { // Get the file handle from the directoryHandle - const fileHandle = await this.toFileSystemHandle(resource, false, false) as FileSystemFileHandle; + const fileHandle = await this.toFileSystemHandle(resource, { create: false, isDirectory: false }) as FileSystemFileHandle; // Get the file itself (which includes the content) const file = await fileHandle.getFile(); @@ -179,13 +183,26 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri await this.initialized; let writeableHandle: FileSystemWritableFileStream | undefined = undefined; try { - const handle = await this.toFileSystemHandle(resource, true, false) as FileSystemFileHandle; + // Validate target unless { create: true, overwrite: true } + if (!opts.create || !opts.overwrite) { + const fileExists = await this.stat(resource).then(() => true, () => false); + if (fileExists) { + if (!opts.overwrite) { + throw createFileSystemProviderError('File already exists', FileSystemProviderErrorCode.FileExists); + } + } else { + if (!opts.create) { + throw createFileSystemProviderError('File does not exist', FileSystemProviderErrorCode.FileNotFound); + } + } + } + + const handle = await this.toFileSystemHandle(resource, { create: true, isDirectory: false }) as FileSystemFileHandle; // Open writeableHandle = await handle?.createWritable(); // Write content at once - console.info('writeFile', resource.path.toString(), content); await writeableHandle?.write(content); this.onDidChangeFileEmitter.fire([{ resource: resource, type: FileChangeType.ADDED }]); @@ -198,24 +215,24 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri } } - private async toFileSystemHandle(resource: URI, create?: boolean, is_dir?: boolean): Promise { + private async toFileSystemHandle(resource: URI, options?: ToFileSystemOptions): Promise { // TODO use constants instead of / for path separator const pathParts = resource.path.toString().split('/').filter(Boolean); - return this.recursiveFileSystemHandle(this.directoryHandle, pathParts, create, is_dir); + return this.recursiveFileSystemHandle(this.directoryHandle, pathParts, options); } - private async recursiveFileSystemHandle(handle: FileSystemDirectoryHandle, pathParts: string[], create?: boolean, is_dir?: boolean): Promise { + private async recursiveFileSystemHandle(handle: FileSystemDirectoryHandle, pathParts: string[], options?: ToFileSystemOptions): Promise { // We reached the end of the path, this happens only when not creating if (pathParts.length === 0) { return handle; } // We need to create it and thus we need to stop early to create the file or directory - if (pathParts.length === 1 && create) { - if (is_dir) { - return handle.getDirectoryHandle(pathParts[0], { create: create }); + if (pathParts.length === 1 && options?.create) { + if (options?.isDirectory) { + return handle.getDirectoryHandle(pathParts[0], { create: options.create }); } else { - return handle.getFileHandle(pathParts[0], { create: create }); + return handle.getFileHandle(pathParts[0], { create: options.create }); } } @@ -224,14 +241,14 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri // eslint-disable-next-line @typescript-eslint/no-explicit-any for await (const entry of (handle as any).entries()) { if (entry[0] === part) { - return this.recursiveFileSystemHandle(entry[1], pathParts, create, is_dir); + return this.recursiveFileSystemHandle(entry[1], pathParts, options); } } // If we haven't found the part, we need to create it along the way - if (create) { + if (options?.create) { const newHandle = await (handle as FileSystemDirectoryHandle).getDirectoryHandle(part, { create: true }); - return this.recursiveFileSystemHandle(newHandle, pathParts, create, is_dir); + return this.recursiveFileSystemHandle(newHandle, pathParts, options); } throw FileSystemProviderErrorCode.FileNotFound; From 05e26adae069f228c54bd95b928bb000fb5eed66 Mon Sep 17 00:00:00 2001 From: Robert Jandow <38583713+robertjndw@users.noreply.github.com> Date: Mon, 7 Oct 2024 23:01:37 +0200 Subject: [PATCH 05/36] Update CHANGELOG.md --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8aed2f4a66368..5d5de4178aeb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ - [Previous Changelogs](https://github.com/eclipse-theia/theia/tree/master/doc/changelogs/) + + ## 1.54.0 - 09/26/2024 - [ai] add Theia AI LLM Support [Experimental] [#14048](https://github.com/eclipse-theia/theia/pull/14048) From 4fa415864138be368fdf987c4c20bba0111e68aa Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Wed, 16 Oct 2024 15:33:43 +0200 Subject: [PATCH 06/36] Add yarn.lock file and AsyncIterable to base tsconfig --- configs/base.tsconfig.json | 3 ++- yarn.lock | 15 +-------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/configs/base.tsconfig.json b/configs/base.tsconfig.json index 731dcdfd7106f..794060005aafd 100644 --- a/configs/base.tsconfig.json +++ b/configs/base.tsconfig.json @@ -22,7 +22,8 @@ "lib": [ "ES2019", "ES2020.Promise", - "DOM" + "DOM", + "DOM.AsyncIterable" ], "sourceMap": true } diff --git a/yarn.lock b/yarn.lock index 29d43d8b58818..326d7df5e5f8a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3250,7 +3250,7 @@ async-mutex@^0.4.0: dependencies: tslib "^2.4.0" -async@^2.1.4, async@^2.6.4: +async@^2.6.4: version "2.6.4" resolved "https://registry.yarnpkg.com/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221" integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA== @@ -3537,14 +3537,6 @@ browser-stdout@1.3.1: resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== -browserfs@^1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/browserfs/-/browserfs-1.4.3.tgz#92ffc6063967612daccdb8566d3fc03f521205fb" - integrity sha512-tz8HClVrzTJshcyIu8frE15cjqjcBIu15Bezxsvl/i+6f59iNCN3kznlWjz0FEb3DlnDx3gW5szxeT6D1x0s0w== - dependencies: - async "^2.1.4" - pako "^1.0.4" - browserslist@^4.21.10, browserslist@^4.22.2, browserslist@^4.22.3: version "4.23.0" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.0.tgz#8f3acc2bbe73af7213399430890f86c63a5674ab" @@ -9353,11 +9345,6 @@ pacote@^15.2.0: ssri "^10.0.0" tar "^6.1.11" -pako@^1.0.4: - version "1.0.11" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" - integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== - parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" From 263815e02c728332defc674f3e62e9046722a682 Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Wed, 16 Oct 2024 15:34:16 +0200 Subject: [PATCH 07/36] Implement feedback from PR and fix directory renaming bug --- .../example-filesystem-initialization.ts | 30 +- .../opfs-filesystem-initialization.ts | 8 +- .../browser-only/opfs-filesystem-provider.ts | 292 ++++++++++-------- 3 files changed, 184 insertions(+), 146 deletions(-) diff --git a/examples/api-samples/src/browser-only/filesystem/example-filesystem-initialization.ts b/examples/api-samples/src/browser-only/filesystem/example-filesystem-initialization.ts index 69a09fb07595a..8f9b65defdcee 100644 --- a/examples/api-samples/src/browser-only/filesystem/example-filesystem-initialization.ts +++ b/examples/api-samples/src/browser-only/filesystem/example-filesystem-initialization.ts @@ -26,26 +26,22 @@ export class ExampleOPFSInitialization extends DefaultOPFSInitialization { @inject(EncodingService) protected encodingService: EncodingService; - override async initializeFS(dir: FileSystemDirectoryHandle, provider: OPFSFileSystemProvider): Promise { + override async initializeFS(provider: OPFSFileSystemProvider): Promise { + // Check whether the directory exists try { - // Check whether the directory exists - try { - await provider.readdir(new URI('/home/workspace')); - } catch (e) { - console.error('An error occurred while reading the demo workspaces', e); - await provider.mkdir(new URI('/home/workspace')); - await provider.writeFile(new URI('/home/workspace/my-file.txt'), this.encodingService.encode('foo').buffer, { create: true, overwrite: false }); - } + await provider.readdir(new URI('/home/workspace')); + } catch (e) { + console.error('An error occurred while reading the demo workspaces', e); + await provider.mkdir(new URI('/home/workspace')); + await provider.writeFile(new URI('/home/workspace/my-file.txt'), this.encodingService.encode('foo').buffer, { create: true, overwrite: false }); + } - try { - await provider.readdir(new URI('/home/workspace2')); - } catch (e) { - console.error('An error occurred while reading the demo workspaces', e); - await provider.mkdir(new URI('/home/workspace2')); - await provider.writeFile(new URI('/home/workspace2/my-file.json'), this.encodingService.encode('{ foo: true }').buffer, { create: true, overwrite: false }); - } + try { + await provider.readdir(new URI('/home/workspace2')); } catch (e) { - console.error('An error occurred while initializing the demo workspaces', e); + console.error('An error occurred while reading the demo workspaces', e); + await provider.mkdir(new URI('/home/workspace2')); + await provider.writeFile(new URI('/home/workspace2/my-file.json'), this.encodingService.encode('{ foo: true }').buffer, { create: true, overwrite: false }); } } } diff --git a/packages/filesystem/src/browser-only/opfs-filesystem-initialization.ts b/packages/filesystem/src/browser-only/opfs-filesystem-initialization.ts index b36df0e26a9ab..d7e6e072e6da5 100644 --- a/packages/filesystem/src/browser-only/opfs-filesystem-initialization.ts +++ b/packages/filesystem/src/browser-only/opfs-filesystem-initialization.ts @@ -19,18 +19,18 @@ import { injectable } from '@theia/core/shared/inversify'; export const OPFSInitialization = Symbol('OPFSInitialization'); export interface OPFSInitialization { - createMountableFileSystem(): Promise - initializeFS: (fs: FileSystemDirectoryHandle, provider: OPFSFileSystemProvider) => Promise; + getRootDirectory(): Promise + initializeFS(provider: OPFSFileSystemProvider): Promise; } @injectable() export class DefaultOPFSInitialization implements OPFSInitialization { - createMountableFileSystem(): Promise { + getRootDirectory(): Promise { return navigator.storage.getDirectory(); } - async initializeFS(dir: FileSystemDirectoryHandle, provider: OPFSFileSystemProvider): Promise { + async initializeFS(provider: OPFSFileSystemProvider): Promise { } } diff --git a/packages/filesystem/src/browser-only/opfs-filesystem-provider.ts b/packages/filesystem/src/browser-only/opfs-filesystem-provider.ts index f687d533670df..b7b0ef19f69ae 100644 --- a/packages/filesystem/src/browser-only/opfs-filesystem-provider.ts +++ b/packages/filesystem/src/browser-only/opfs-filesystem-provider.ts @@ -1,27 +1,4 @@ -// ***************************************************************************** -// Copyright (C) 2023 EclipseSource and others. -// -// This program and the accompanying materials are made available under the -// terms of the Eclipse Public License v. 2.0 which is available at -// http://www.eclipse.org/legal/epl-2.0. -// -// This Source Code may also be made available under the following Secondary -// Licenses when the conditions for such availability set forth in the Eclipse -// Public License v. 2.0 are satisfied: GNU General Public License, version 2 -// with the GNU Classpath Exception which is available at -// https://www.gnu.org/software/classpath/license.html. -// -// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 -// ***************************************************************************** -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -// based on https://github.com/microsoft/vscode/blob/04c36be045a94fee58e5f8992d3e3fd980294a84/src/vs/platform/files/node/diskFileSystemProvider.ts - -/* eslint-disable no-null/no-null */ - -import { inject, injectable } from '@theia/core/shared/inversify'; +import { inject, injectable, postConstruct } from '@theia/core/shared/inversify'; import { FileChange, FileChangeType, FileDeleteOptions, FileOverwriteOptions, FileSystemProviderCapabilities, @@ -30,15 +7,15 @@ import { FileSystemProviderWithFileReadWriteCapability, FileType, FileWriteOptions, Stat, WatchOptions, createFileSystemProviderError } from '../common/files'; -import { Emitter, Event, URI, Disposable } from '@theia/core'; +import { Emitter, Event, URI, Disposable, Path } from '@theia/core'; import { OPFSInitialization } from './opfs-filesystem-initialization'; -interface ToFileSystemOptions { +/** Options to be used when traversing the file system handles */ +interface CreateFileSystemHandleOptions { isDirectory?: boolean; create?: boolean; } -// adapted from DiskFileSystemProvider @injectable() export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWriteCapability { capabilities: FileSystemProviderCapabilities = FileSystemProviderCapabilities.FileReadWrite; @@ -48,13 +25,18 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri readonly onDidChangeFile = this.onDidChangeFileEmitter.event; onFileWatchError: Event = Event.None; + @inject(OPFSInitialization) + protected readonly initialization: OPFSInitialization; + private directoryHandle: FileSystemDirectoryHandle; private initialized: Promise; - constructor(@inject(OPFSInitialization) readonly initialization: OPFSInitialization) { - const init = async (): Promise => { - this.directoryHandle = await initialization.createMountableFileSystem(); - await initialization.initializeFS(this.directoryHandle, new Proxy(this, { + // MARK: constructor + @postConstruct() + protected init(): void { + const setup = async (): Promise => { + this.directoryHandle = await this.initialization.getRootDirectory(); + await this.initialization.initializeFS(new Proxy(this, { get(target, prop, receiver): unknown { if (prop === 'initialized') { return Promise.resolve(true); @@ -64,41 +46,55 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri })); return true; }; - this.initialized = init(); + this.initialized = setup(); } watch(_resource: URI, _opts: WatchOptions): Disposable { return Disposable.NULL; } + // MARK: stat async stat(resource: URI): Promise { - await this.initialized; - const handle = await this.toFileSystemHandle(resource); + try { + await this.initialized; + + const handle = await this.toFileSystemHandle(resource); + + if (handle.kind === 'file') { + const fileHandle = handle as FileSystemFileHandle; + const file = await fileHandle.getFile(); + return { + type: FileType.File, + ctime: file.lastModified, + mtime: file.lastModified, + size: file.size + }; + } else if (handle.kind === 'directory') { + return { + type: FileType.Directory, + ctime: 0, + mtime: 0, + size: 0 + }; + } - if (handle.kind === 'file') { - const fileHandle = handle as FileSystemFileHandle; - const file = await fileHandle.getFile(); - return { - type: FileType.File, - ctime: file.lastModified, - mtime: file.lastModified, - size: file.size - }; - } else if (handle.kind === 'directory') { - return { - type: FileType.Directory, - ctime: 0, - mtime: 0, - size: 0 - }; + throw createFileSystemProviderError('File does not exist', FileSystemProviderErrorCode.FileNotFound); + + } catch (error) { + throw createFileSystemProviderError('File does not exist', FileSystemProviderErrorCode.FileNotFound); } - throw createFileSystemProviderError('File does not exist', FileSystemProviderErrorCode.FileNotFound); } + // MARK: mkdir async mkdir(resource: URI): Promise { await this.initialized; - - await this.toFileSystemHandle(resource, { create: true, isDirectory: true }); + try { + await this.toFileSystemHandle(resource, { create: true, isDirectory: true }); + this.onDidChangeFileEmitter.fire([{ resource, type: FileChangeType.ADDED }]); + } catch (error) { + throw toFileSystemProviderError(error, true); + } } + // MARK: readdir async readdir(resource: URI): Promise<[string, FileType][]> { await this.initialized; @@ -109,8 +105,7 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri const result: [string, FileType][] = []; // Iterate through the entries in the directory (files and subdirectories) - // eslint-disable-next-line @typescript-eslint/no-explicit-any - for await (const [name, handle] of (directoryHandle as any).entries()) { + for await (const [name, handle] of directoryHandle.entries()) { try { // Determine the type of the entry (file or directory) if (handle.kind === 'file') { @@ -119,16 +114,17 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri result.push([name, FileType.Directory]); } } catch (error) { - console.error(error); // Ignore errors for individual entries, log them and continue + // Ignore errors for individual entries, log them and continue + // console.error(error); } } return result; } catch (error) { - throw this.toFileSystemProviderError(error); + throw toFileSystemProviderError(error, true); } } - + // MARK: delete async delete(resource: URI, _opts: FileDeleteOptions): Promise { await this.initialized; try { @@ -137,28 +133,41 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri if (parentHandle.kind !== 'directory') { throw createFileSystemProviderError(new Error('Parent is not a directory'), FileSystemProviderErrorCode.FileNotADirectory); } - const dirHandle = parentHandle as FileSystemDirectoryHandle; const name = resource.path.base; - return await dirHandle.removeEntry(name, { recursive: _opts.recursive }); + return (parentHandle as FileSystemDirectoryHandle).removeEntry(name, { recursive: _opts.recursive }); } catch (error) { - throw this.toFileSystemProviderError(error); + throw toFileSystemProviderError(error); } finally { this.onDidChangeFileEmitter.fire([{ resource, type: FileChangeType.DELETED }]); } } + // MARK: rename async rename(from: URI, to: URI, opts: FileOverwriteOptions): Promise { await this.initialized; + try { - const content = await this.readFile(from); - await this.writeFile(to, content, { create: true, overwrite: true }); - await this.delete(from, { recursive: true, useTrash: false }); + const fromHandle = await this.toFileSystemHandle(from); + // Check whether the source is a file or directory + if (fromHandle.kind === 'directory') { + // Create the new directory and get the handle + await this.mkdir(to); + const toHandle = await this.toFileSystemHandle(to) as FileSystemDirectoryHandle; + await copyDirectoryContents(fromHandle as FileSystemDirectoryHandle, toHandle); + + // Delete the old directory + await this.delete(from, { recursive: true, useTrash: false }); + } else { + const content = await this.readFile(from); + await this.writeFile(to, content, { create: true, overwrite: opts.overwrite }); + await this.delete(from, { recursive: true, useTrash: false }); + } this.onDidChangeFileEmitter.fire([{ resource: to, type: FileChangeType.ADDED }]); } catch (error) { - throw this.toFileSystemProviderError(error); + throw toFileSystemProviderError(error); } } - + // MARK: readFile async readFile(resource: URI): Promise { await this.initialized; @@ -172,14 +181,12 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri // Read the file as an ArrayBuffer and convert it to Uint8Array const arrayBuffer = await file.arrayBuffer(); return new Uint8Array(arrayBuffer); - } catch (error) { - throw this.toFileSystemProviderError(error); + throw toFileSystemProviderError(error, false); } } - + // MARK: writeFile async writeFile(resource: URI, content: Uint8Array, opts: FileWriteOptions): Promise { - // TODO implement overwrite await this.initialized; let writeableHandle: FileSystemWritableFileStream | undefined = undefined; try { @@ -205,9 +212,9 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri // Write content at once await writeableHandle?.write(content); - this.onDidChangeFileEmitter.fire([{ resource: resource, type: FileChangeType.ADDED }]); + this.onDidChangeFileEmitter.fire([{ resource: resource, type: FileChangeType.UPDATED }]); } catch (error) { - throw this.toFileSystemProviderError(error); + throw toFileSystemProviderError(error, false); } finally { if (typeof writeableHandle !== 'undefined') { await writeableHandle.close(); @@ -215,72 +222,107 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri } } - private async toFileSystemHandle(resource: URI, options?: ToFileSystemOptions): Promise { - // TODO use constants instead of / for path separator - const pathParts = resource.path.toString().split('/').filter(Boolean); + /** MARK: copy + * Returns the FileSystemHandle for the given resource given by a URI. + * @param resource URI/path of the resource + * @param options Options for the creation of the handle while traversing the path + * @returns FileSystemHandle for the given resource + */ + private async toFileSystemHandle(resource: URI, options?: CreateFileSystemHandleOptions): Promise { + const pathParts = resource.path.toString().split(Path.separator).filter(Boolean); - return this.recursiveFileSystemHandle(this.directoryHandle, pathParts, options); + return recursiveFileSystemHandle(this.directoryHandle, pathParts, options); } +} - private async recursiveFileSystemHandle(handle: FileSystemDirectoryHandle, pathParts: string[], options?: ToFileSystemOptions): Promise { - // We reached the end of the path, this happens only when not creating - if (pathParts.length === 0) { - return handle; - } - // We need to create it and thus we need to stop early to create the file or directory - if (pathParts.length === 1 && options?.create) { - if (options?.isDirectory) { - return handle.getDirectoryHandle(pathParts[0], { create: options.create }); - } else { - return handle.getFileHandle(pathParts[0], { create: options.create }); - } - } - - // Continue to resolve the path - const part = pathParts.shift()!; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - for await (const entry of (handle as any).entries()) { - if (entry[0] === part) { - return this.recursiveFileSystemHandle(entry[1], pathParts, options); - } +// #region Helper functions +async function recursiveFileSystemHandle(handle: FileSystemHandle, pathParts: string[], options?: CreateFileSystemHandleOptions): Promise { + // We reached the end of the path, this happens only when not creating + if (pathParts.length === 0) { + return handle; + } + // If there are parts left, the handle must be a directory + if (handle.kind !== 'directory') { + throw FileSystemProviderErrorCode.FileNotADirectory; + } + const dirHandle = handle as FileSystemDirectoryHandle; + // We need to create it and thus we need to stop early to create the file or directory + if (pathParts.length === 1 && options?.create) { + if (options?.isDirectory) { + return dirHandle.getDirectoryHandle(pathParts[0], { create: options.create }); + } else { + return dirHandle.getFileHandle(pathParts[0], { create: options.create }); } + } - // If we haven't found the part, we need to create it along the way - if (options?.create) { - const newHandle = await (handle as FileSystemDirectoryHandle).getDirectoryHandle(part, { create: true }); - return this.recursiveFileSystemHandle(newHandle, pathParts, options); + // Continue to resolve the path + const part = pathParts.shift()!; + for await (const entry of dirHandle.entries()) { + // Check the entry name in the current directory + if (entry[0] === part) { + return recursiveFileSystemHandle(entry[1], pathParts, options); } + } - throw FileSystemProviderErrorCode.FileNotFound; + // If we haven't found the part, we need to create it along the way + if (options?.create) { + const newHandle = await dirHandle.getDirectoryHandle(part, { create: true }); + return recursiveFileSystemHandle(newHandle, pathParts, options); } - private toFileSystemProviderError(error: NodeJS.ErrnoException): FileSystemProviderError { - if (error instanceof FileSystemProviderError) { - return error; // avoid double conversion + throw FileSystemProviderErrorCode.FileNotFound; +} + +// Function to copy directory contents recursively +async function copyDirectoryContents(sourceHandle: FileSystemDirectoryHandle, destinationHandle: FileSystemDirectoryHandle): Promise { + for await (const [name, handle] of sourceHandle.entries()) { + if (handle.kind === 'file') { + const file = await (handle as FileSystemFileHandle).getFile(); + const newFileHandle = await destinationHandle.getFileHandle(name, { create: true }); + const writable = await newFileHandle.createWritable(); + try { + await writable.write(await file.arrayBuffer()); + } finally { + await writable.close(); + } + } else if (handle.kind === 'directory') { + const newSubDirHandle = await destinationHandle.getDirectoryHandle(name, { create: true }); + await copyDirectoryContents(handle as FileSystemDirectoryHandle, newSubDirHandle); } + } +} - let code: FileSystemProviderErrorCode; - switch (error.code) { - case 'ENOENT': - code = FileSystemProviderErrorCode.FileNotFound; - break; - case 'EISDIR': +function toFileSystemProviderError(error: DOMException, is_dir?: boolean): FileSystemProviderError { + if (error instanceof FileSystemProviderError) { + return error; // avoid double conversion + } + + let code: FileSystemProviderErrorCode; + switch (error.name) { + case 'NotFoundError': + code = FileSystemProviderErrorCode.FileNotFound; + break; + case 'InvalidModificationError': + code = FileSystemProviderErrorCode.FileExists; + break; + case 'NotAllowedError': + code = FileSystemProviderErrorCode.NoPermissions; + break; + case 'TypeMismatchError': + if (!is_dir) { code = FileSystemProviderErrorCode.FileIsADirectory; - break; - case 'ENOTDIR': + } else { code = FileSystemProviderErrorCode.FileNotADirectory; - break; - case 'EEXIST': - code = FileSystemProviderErrorCode.FileExists; - break; - case 'EPERM': - case 'EACCES': - code = FileSystemProviderErrorCode.NoPermissions; - break; - default: - code = FileSystemProviderErrorCode.Unknown; - } + } - return createFileSystemProviderError(error, code); + break; + case 'QuotaExceededError': + code = FileSystemProviderErrorCode.FileTooLarge; + break; + default: + code = FileSystemProviderErrorCode.Unknown; } + + return createFileSystemProviderError(error, code); } +// #endregion From e24978cfb186aec6b6eeddf04763ba411c3f310e Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Thu, 17 Oct 2024 11:18:57 +0200 Subject: [PATCH 08/36] Adapt eslintrc config --- configs/build.eslintrc.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configs/build.eslintrc.json b/configs/build.eslintrc.json index c0a2c52c0f081..7e8ee574ecab0 100644 --- a/configs/build.eslintrc.json +++ b/configs/build.eslintrc.json @@ -2,5 +2,12 @@ "extends": [ "./base.eslintrc.json", "./errors.eslintrc.json" - ] + ], + "parserOptions": { + "lib": [ + "ES2019", + "ES2020.Promise", + "DOM" + ] + } } From 8fa511ba01df2676567209a9f9a4e4e88cd8f8d2 Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Thu, 17 Oct 2024 13:20:17 +0200 Subject: [PATCH 09/36] Fix linting issues --- .../browser-only/opfs-filesystem-provider.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/filesystem/src/browser-only/opfs-filesystem-provider.ts b/packages/filesystem/src/browser-only/opfs-filesystem-provider.ts index b7b0ef19f69ae..855a97eef9a65 100644 --- a/packages/filesystem/src/browser-only/opfs-filesystem-provider.ts +++ b/packages/filesystem/src/browser-only/opfs-filesystem-provider.ts @@ -1,3 +1,19 @@ +// ***************************************************************************** +// Copyright (C) 2024 EclipseSource and others. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// ***************************************************************************** + import { inject, injectable, postConstruct } from '@theia/core/shared/inversify'; import { FileChange, FileChangeType, FileDeleteOptions, @@ -222,12 +238,13 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri } } - /** MARK: copy + /** * Returns the FileSystemHandle for the given resource given by a URI. * @param resource URI/path of the resource * @param options Options for the creation of the handle while traversing the path * @returns FileSystemHandle for the given resource */ + // MARK: copy private async toFileSystemHandle(resource: URI, options?: CreateFileSystemHandleOptions): Promise { const pathParts = resource.path.toString().split(Path.separator).filter(Boolean); From 39ab4f26fc913c542839afafb9bfc6fb4bb192bd Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Wed, 23 Oct 2024 22:05:02 +0200 Subject: [PATCH 10/36] Add empty files for the plugin-ext for browser-only --- packages/plugin-ext/package.json | 3 ++ .../frontend-hosted-plugin-server.ts | 51 +++++++++++++++++++ .../frontend-plugin-path-service.ts | 29 +++++++++++ .../browser-only/frontend-plugin-server.ts | 41 +++++++++++++++ .../src/plugin-ext-frontend-only-module.ts | 28 ++++++++++ 5 files changed, 152 insertions(+) create mode 100644 packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts create mode 100644 packages/plugin-ext/src/hosted/browser-only/frontend-plugin-path-service.ts create mode 100644 packages/plugin-ext/src/hosted/browser-only/frontend-plugin-server.ts create mode 100644 packages/plugin-ext/src/plugin-ext-frontend-only-module.ts diff --git a/packages/plugin-ext/package.json b/packages/plugin-ext/package.json index 3143dc53e15be..55ea2fac38bfb 100644 --- a/packages/plugin-ext/package.json +++ b/packages/plugin-ext/package.json @@ -59,6 +59,9 @@ "backendElectron": "lib/plugin-ext-backend-electron-module", "frontend": "lib/plugin-ext-frontend-module" }, + { + "frontendOnly": "lib/plugin-ext-frontend-only-module" + }, { "frontendElectron": "lib/plugin-ext-frontend-electron-module" } diff --git a/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts b/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts new file mode 100644 index 0000000000000..5ea7d705c5975 --- /dev/null +++ b/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts @@ -0,0 +1,51 @@ +// ***************************************************************************** +// Copyright (C) 2023 EclipseSource and others. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// **************************************************************************** + +import { injectable } from '@theia/core/shared/inversify'; +import { DeployedPlugin, ExtPluginApi, GetDeployedPluginsParams, HostedPluginClient, HostedPluginServer } from '../../common'; +import { Event, RpcConnectionEventEmitter } from '@theia/core'; + +@injectable() +export class FrontendHostedPluginServer implements HostedPluginServer, RpcConnectionEventEmitter { + readonly onDidOpenConnection: Event = Event.None; + readonly onDidCloseConnection: Event = Event.None; + async getDeployedPluginIds(): Promise<`${string}.${string}@${string}`[]> { + return []; + } + async getUninstalledPluginIds(): Promise { + return []; + + } + async getDeployedPlugins(params: GetDeployedPluginsParams): Promise { + return []; + } + + async getExtPluginAPI(): Promise { + return []; + } + onMessage(targetHost: string, message: Uint8Array): Promise { + throw new Error('Method not implemented.'); + } + dispose(): void { + throw new Error('Method not implemented.'); + } + setClient(client: HostedPluginClient | undefined): void { + throw new Error('Method not implemented.'); + } + getClient?(): HostedPluginClient | undefined { + throw new Error('Method not implemented.'); + } +} diff --git a/packages/plugin-ext/src/hosted/browser-only/frontend-plugin-path-service.ts b/packages/plugin-ext/src/hosted/browser-only/frontend-plugin-path-service.ts new file mode 100644 index 0000000000000..3d780467a5646 --- /dev/null +++ b/packages/plugin-ext/src/hosted/browser-only/frontend-plugin-path-service.ts @@ -0,0 +1,29 @@ +// ***************************************************************************** +// Copyright (C) 2023 EclipseSource and others. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// **************************************************************************** + +import { injectable } from '@theia/core/shared/inversify'; +import { PluginPathsService } from '../../main/common/plugin-paths-protocol'; + +@injectable() +export class FrontendPluginPathService implements PluginPathsService { + async getHostLogPath(): Promise { + return ''; + } + async getHostStoragePath(workspaceUri: string | undefined, rootUris: string[]): Promise { + return ''; + } + +} diff --git a/packages/plugin-ext/src/hosted/browser-only/frontend-plugin-server.ts b/packages/plugin-ext/src/hosted/browser-only/frontend-plugin-server.ts new file mode 100644 index 0000000000000..1ebed69f6f264 --- /dev/null +++ b/packages/plugin-ext/src/hosted/browser-only/frontend-plugin-server.ts @@ -0,0 +1,41 @@ +// ***************************************************************************** +// Copyright (C) 2023 EclipseSource and others. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// **************************************************************************** +import { injectable } from '@theia/core/shared/inversify'; +import { PluginDeployOptions, PluginServer, PluginStorageKind, PluginType } from '../../common'; +import { KeysToAnyValues, KeysToKeysToAnyValue } from '../../common/types'; + +@injectable() +export class FrontendPluginServer implements PluginServer { + deploy(pluginEntry: string, type?: PluginType | undefined, options?: PluginDeployOptions | undefined): Promise { + throw new Error('Method not implemented.'); + } + uninstall(pluginId: `${string}.${string}@${string}`): Promise { + throw new Error('Method not implemented.'); + } + undeploy(pluginId: `${string}.${string}@${string}`): Promise { + throw new Error('Method not implemented.'); + } + setStorageValue(key: string, value: KeysToAnyValues, kind: PluginStorageKind): Promise { + throw new Error('Method not implemented.'); + } + getStorageValue(key: string, kind: PluginStorageKind): Promise { + throw new Error('Method not implemented.'); + } + async getAllStorageValues(kind: PluginStorageKind): Promise { + return {}; + } + +} diff --git a/packages/plugin-ext/src/plugin-ext-frontend-only-module.ts b/packages/plugin-ext/src/plugin-ext-frontend-only-module.ts new file mode 100644 index 0000000000000..af6d713ec69a2 --- /dev/null +++ b/packages/plugin-ext/src/plugin-ext-frontend-only-module.ts @@ -0,0 +1,28 @@ +// ***************************************************************************** +// Copyright (C) 2023 EclipseSource and others. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// ***************************************************************************** + +import { ContainerModule } from '@theia/core/shared/inversify'; +import { HostedPluginServer, PluginServer } from './common/plugin-protocol'; +import { FrontendHostedPluginServer } from './hosted/browser-only/frontend-hosted-plugin-server'; +import { PluginPathsService } from './main/common/plugin-paths-protocol'; +import { FrontendPluginPathService } from './hosted/browser-only/frontend-plugin-path-service'; +import { FrontendPluginServer } from './hosted/browser-only/frontend-plugin-server'; + +export default new ContainerModule((bind, unbind, isBound, rebind) => { + rebind(HostedPluginServer).to(FrontendHostedPluginServer).inSingletonScope(); + rebind(PluginServer).to(FrontendPluginServer).inSingletonScope(); + rebind(PluginPathsService).to(FrontendPluginPathService).inSingletonScope(); +}); From 969c31b07b6bc5f329df899cab1ba8ae714be9b2 Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Mon, 18 Nov 2024 14:21:08 +0100 Subject: [PATCH 11/36] Add initial implementation; still WIP --- .../api-samples-frontend-only-module.ts | 2 + .../example-plugin-initialization.ts | 12 + .../plugin-sample/mock-plugin-metadata.ts | 13799 ++++++++++++++++ examples/browser-only/package.json | 5 + .../frontend-hosted-plugin-server.ts | 19 +- 5 files changed, 13834 insertions(+), 3 deletions(-) create mode 100644 examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts create mode 100644 examples/api-samples/src/browser-only/plugin-sample/mock-plugin-metadata.ts diff --git a/examples/api-samples/src/browser-only/api-samples-frontend-only-module.ts b/examples/api-samples/src/browser-only/api-samples-frontend-only-module.ts index 6de6d07280007..a7341f7bc2738 100644 --- a/examples/api-samples/src/browser-only/api-samples-frontend-only-module.ts +++ b/examples/api-samples/src/browser-only/api-samples-frontend-only-module.ts @@ -16,6 +16,7 @@ import { ContainerModule, interfaces } from '@theia/core/shared/inversify'; import { bindOPFSInitialization } from './filesystem/example-filesystem-initialization'; +import { bindPluginInitialization } from './plugin-sample/example-plugin-initialization'; export default new ContainerModule(( bind: interfaces.Bind, @@ -24,4 +25,5 @@ export default new ContainerModule(( rebind: interfaces.Rebind, ) => { bindOPFSInitialization(bind, rebind); + bindPluginInitialization(bind, rebind); }); diff --git a/examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts b/examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts new file mode 100644 index 0000000000000..5c3f3b233216a --- /dev/null +++ b/examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts @@ -0,0 +1,12 @@ +import { interfaces } from '@theia/core/shared/inversify'; +import { PluginLocalOptions } from '@theia/plugin-ext/lib/hosted/browser-only/frontend-hosted-plugin-server'; +import { mockData } from './mock-plugin-metadata'; + + +export const bindPluginInitialization = (bind: interfaces.Bind, rebind: interfaces.Rebind): void => { + const pluginLocalOptions = { + pluginDirectory: '', + pluginMetadata: mockData, + }; + bind(PluginLocalOptions).toConstantValue(pluginLocalOptions); +}; diff --git a/examples/api-samples/src/browser-only/plugin-sample/mock-plugin-metadata.ts b/examples/api-samples/src/browser-only/plugin-sample/mock-plugin-metadata.ts new file mode 100644 index 0000000000000..b23c7d98e5f80 --- /dev/null +++ b/examples/api-samples/src/browser-only/plugin-sample/mock-plugin-metadata.ts @@ -0,0 +1,13799 @@ +// ***************************************************************************** +// Copyright (C) 2023 EclipseSource and others. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// **************************************************************************** + +export const mockData: any[] = [ + { + metadata: { + host: 'main', + model: { + packagePath: '/Users/robertjandow/Documents/Development/theia/examples/browser-only/plugins/vscode.typescript/extension', + packageUri: 'file:///Users/robertjandow/Documents/Development/theia/examples/browser-only/plugins/vscode.typescript/extension', + id: 'vscode.typescript-language-features', + name: 'typescript-language-features', + publisher: 'vscode', + version: '1.88.1', + displayName: 'TypeScript and JavaScript Language Features (built-in)', + description: 'Provides rich language support for JavaScript and TypeScript.', + engine: { + type: 'vscode', + version: '^1.30.0', + }, + entryPoint: { + frontend: './dist/browser/extension.js', + }, + iconUrl: 'plugins/vscode.typescript/media%2Ficon.png', + l10n: undefined, + readmeUrl: 'plugins/vscode.typescript/.%2FREADME.md', + licenseUrl: 'plugins/vscode.typescript/.%2FLICENSE', + }, + lifecycle: { + startMethod: 'activate', + stopMethod: 'deactivate', + frontendModuleName: 'vscode.typescript', + frontendInitPath: 'plugin-vscode-init-fe.js', + backendInitPath: '/Users/robertjandow/Documents/Development/theia/examples/browser/lib/backend/plugin-vscode-init', + }, + outOfSync: false, + isUnderDevelopment: false, + }, + type: 0, + contributes: { + activationEvents: [ + 'onLanguage:javascript', + 'onLanguage:javascriptreact', + 'onLanguage:typescript', + 'onLanguage:typescriptreact', + 'onLanguage:jsx-tags', + 'onCommand:typescript.tsserverRequest', + 'onCommand:_typescript.configurePlugin', + 'onCommand:_typescript.learnMoreAboutRefactorings', + 'onCommand:typescript.fileReferences', + 'onTaskType:typescript', + 'onLanguage:jsonc', + 'onWalkthrough:nodejsWelcome', + 'onCommand:typescript.reloadProjects', + 'onCommand:javascript.reloadProjects', + 'onCommand:typescript.selectTypeScriptVersion', + 'onCommand:typescript.goToProjectConfig', + 'onCommand:javascript.goToProjectConfig', + 'onCommand:typescript.openTsServerLog', + 'onCommand:typescript.restartTsServer', + 'onCommand:typescript.findAllFileReferences', + 'onCommand:typescript.goToSourceDefinition', + 'onCommand:typescript.sortImports', + 'onCommand:javascript.sortImports', + 'onCommand:typescript.removeUnusedImports', + 'onCommand:javascript.removeUnusedImports', + ], + configuration: [ + { + type: 'object', + title: 'TypeScript', + order: 20, + properties: { + 'typescript.tsdk': { + type: 'string', + markdownDescription: 'Specifies the folder path to the tsserver and `lib*.d.ts` files under a TypeScript install to use for IntelliSense, for example: `./node_modules/typescript/lib`.\n\n- When specified as a user setting, the TypeScript version from `typescript.tsdk` automatically replaces the built-in TypeScript version.\n- When specified as a workspace setting, `typescript.tsdk` allows you to switch to use that workspace version of TypeScript for IntelliSense with the `TypeScript: Select TypeScript version` command.\n\nSee the [TypeScript documentation](https://code.visualstudio.com/docs/typescript/typescript-compiling#_using-newer-typescript-versions) for more detail about managing TypeScript versions.', + scope: 'window', + }, + 'typescript.disableAutomaticTypeAcquisition': { + type: 'boolean', + default: false, + markdownDescription: 'Disables [automatic type acquisition](https://code.visualstudio.com/docs/nodejs/working-with-javascript#_typings-and-automatic-type-acquisition). Automatic type acquisition fetches `@types` packages from npm to improve IntelliSense for external libraries.', + scope: 'window', + tags: [ + 'usesOnlineServices', + ], + }, + 'typescript.enablePromptUseWorkspaceTsdk': { + type: 'boolean', + default: false, + description: 'Enables prompting of users to use the TypeScript version configured in the workspace for Intellisense.', + scope: 'window', + }, + 'typescript.npm': { + type: 'string', + markdownDescription: 'Specifies the path to the npm executable used for [Automatic Type Acquisition](https://code.visualstudio.com/docs/nodejs/working-with-javascript#_typings-and-automatic-type-acquisition).', + scope: 'machine', + }, + 'typescript.check.npmIsInstalled': { + type: 'boolean', + default: true, + markdownDescription: 'Check if npm is installed for [Automatic Type Acquisition](https://code.visualstudio.com/docs/nodejs/working-with-javascript#_typings-and-automatic-type-acquisition).', + scope: 'window', + }, + 'javascript.referencesCodeLens.enabled': { + type: 'boolean', + default: false, + description: 'Enable/disable references CodeLens in JavaScript files.', + scope: 'window', + }, + 'javascript.referencesCodeLens.showOnAllFunctions': { + type: 'boolean', + default: false, + description: 'Enable/disable references CodeLens on all functions in JavaScript files.', + scope: 'window', + }, + 'typescript.referencesCodeLens.enabled': { + type: 'boolean', + default: false, + description: 'Enable/disable references CodeLens in TypeScript files.', + scope: 'window', + }, + 'typescript.referencesCodeLens.showOnAllFunctions': { + type: 'boolean', + default: false, + description: 'Enable/disable references CodeLens on all functions in TypeScript files.', + scope: 'window', + }, + 'typescript.implementationsCodeLens.enabled': { + type: 'boolean', + default: false, + description: 'Enable/disable implementations CodeLens. This CodeLens shows the implementers of an interface.', + scope: 'window', + }, + 'typescript.tsserver.enableTracing': { + type: 'boolean', + default: false, + description: 'Enables tracing TS server performance to a directory. These trace files can be used to diagnose TS Server performance issues. The log may contain file paths, source code, and other potentially sensitive information from your project.', + scope: 'window', + }, + 'typescript.tsserver.log': { + type: 'string', + enum: [ + 'off', + 'terse', + 'normal', + 'verbose', + ], + default: 'off', + description: 'Enables logging of the TS server to a file. This log can be used to diagnose TS Server issues. The log may contain file paths, source code, and other potentially sensitive information from your project.', + scope: 'window', + }, + 'typescript.tsserver.pluginPaths': { + type: 'array', + items: { + type: 'string', + description: 'Either an absolute or relative path. Relative path will be resolved against workspace folder(s).', + }, + default: [ + ], + description: 'Additional paths to discover TypeScript Language Service plugins.', + scope: 'machine', + }, + 'typescript.tsserver.trace': { + type: 'string', + enum: [ + 'off', + 'messages', + 'verbose', + ], + default: 'off', + description: 'Enables tracing of messages sent to the TS server. This trace can be used to diagnose TS Server issues. The trace may contain file paths, source code, and other potentially sensitive information from your project.', + scope: 'window', + }, + 'javascript.suggest.completeFunctionCalls': { + type: 'boolean', + default: false, + description: 'Complete functions with their parameter signature.', + scope: 'resource', + }, + 'typescript.suggest.completeFunctionCalls': { + type: 'boolean', + default: false, + description: 'Complete functions with their parameter signature.', + scope: 'resource', + }, + 'javascript.suggest.includeAutomaticOptionalChainCompletions': { + type: 'boolean', + default: true, + description: 'Enable/disable showing completions on potentially undefined values that insert an optional chain call. Requires strict null checks to be enabled.', + scope: 'resource', + }, + 'typescript.suggest.includeAutomaticOptionalChainCompletions': { + type: 'boolean', + default: true, + description: 'Enable/disable showing completions on potentially undefined values that insert an optional chain call. Requires strict null checks to be enabled.', + scope: 'resource', + }, + 'typescript.inlayHints.parameterNames.enabled': { + type: 'string', + enum: [ + 'none', + 'literals', + 'all', + ], + enumDescriptions: [ + 'Disable parameter name hints.', + 'Enable parameter name hints only for literal arguments.', + 'Enable parameter name hints for literal and non-literal arguments.', + ], + default: 'none', + markdownDescription: "Enable/disable inlay hints for parameter names:\n```typescript\n\nparseInt(/* str: */ '123', /* radix: */ 8)\n \n```", + scope: 'resource', + }, + 'typescript.inlayHints.parameterNames.suppressWhenArgumentMatchesName': { + type: 'boolean', + default: true, + markdownDescription: 'Suppress parameter name hints on arguments whose text is identical to the parameter name.', + scope: 'resource', + }, + 'typescript.inlayHints.parameterTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: "Enable/disable inlay hints for implicit parameter types:\n```typescript\n\nel.addEventListener('click', e /* :MouseEvent */ => ...)\n \n```", + scope: 'resource', + }, + 'typescript.inlayHints.variableTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for implicit variable types:\n```typescript\n\nconst foo /* :number */ = Date.now();\n \n```', + scope: 'resource', + }, + 'typescript.inlayHints.variableTypes.suppressWhenTypeMatchesName': { + type: 'boolean', + default: true, + markdownDescription: 'Suppress type hints on variables whose name is identical to the type name. Requires using TypeScript 4.8+ in the workspace.', + scope: 'resource', + }, + 'typescript.inlayHints.propertyDeclarationTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for implicit types on property declarations:\n```typescript\n\nclass Foo {\n\tprop /* :number */ = Date.now();\n}\n \n```', + scope: 'resource', + }, + 'typescript.inlayHints.functionLikeReturnTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for implicit return types on function signatures:\n```typescript\n\nfunction foo() /* :number */ {\n\treturn Date.now();\n} \n \n```', + scope: 'resource', + }, + 'typescript.inlayHints.enumMemberValues.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for member values in enum declarations:\n```typescript\n\nenum MyValue {\n\tA /* = 0 */;\n\tB /* = 1 */;\n}\n \n```', + scope: 'resource', + }, + 'javascript.inlayHints.parameterNames.enabled': { + type: 'string', + enum: [ + 'none', + 'literals', + 'all', + ], + enumDescriptions: [ + 'Disable parameter name hints.', + 'Enable parameter name hints only for literal arguments.', + 'Enable parameter name hints for literal and non-literal arguments.', + ], + default: 'none', + markdownDescription: "Enable/disable inlay hints for parameter names:\n```typescript\n\nparseInt(/* str: */ '123', /* radix: */ 8)\n \n```", + scope: 'resource', + }, + 'javascript.inlayHints.parameterNames.suppressWhenArgumentMatchesName': { + type: 'boolean', + default: true, + markdownDescription: 'Suppress parameter name hints on arguments whose text is identical to the parameter name.', + scope: 'resource', + }, + 'javascript.inlayHints.parameterTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: "Enable/disable inlay hints for implicit parameter types:\n```typescript\n\nel.addEventListener('click', e /* :MouseEvent */ => ...)\n \n```", + scope: 'resource', + }, + 'javascript.inlayHints.variableTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for implicit variable types:\n```typescript\n\nconst foo /* :number */ = Date.now();\n \n```', + scope: 'resource', + }, + 'javascript.inlayHints.variableTypes.suppressWhenTypeMatchesName': { + type: 'boolean', + default: true, + markdownDescription: 'Suppress type hints on variables whose name is identical to the type name. Requires using TypeScript 4.8+ in the workspace.', + scope: 'resource', + }, + 'javascript.inlayHints.propertyDeclarationTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for implicit types on property declarations:\n```typescript\n\nclass Foo {\n\tprop /* :number */ = Date.now();\n}\n \n```', + scope: 'resource', + }, + 'javascript.inlayHints.functionLikeReturnTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for implicit return types on function signatures:\n```typescript\n\nfunction foo() /* :number */ {\n\treturn Date.now();\n} \n \n```', + scope: 'resource', + }, + 'javascript.inlayHints.enumMemberValues.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for member values in enum declarations:\n```typescript\n\nenum MyValue {\n\tA /* = 0 */;\n\tB /* = 1 */;\n}\n \n```', + scope: 'resource', + }, + 'javascript.suggest.includeCompletionsForImportStatements': { + type: 'boolean', + default: true, + description: 'Enable/disable auto-import-style completions on partially-typed import statements.', + scope: 'resource', + }, + 'typescript.suggest.includeCompletionsForImportStatements': { + type: 'boolean', + default: true, + description: 'Enable/disable auto-import-style completions on partially-typed import statements.', + scope: 'resource', + }, + 'typescript.reportStyleChecksAsWarnings': { + type: 'boolean', + default: true, + description: 'Report style checks as warnings.', + scope: 'window', + }, + 'typescript.validate.enable': { + type: 'boolean', + default: true, + description: 'Enable/disable TypeScript validation.', + scope: 'window', + }, + 'typescript.format.enable': { + type: 'boolean', + default: true, + description: 'Enable/disable default TypeScript formatter.', + scope: 'window', + }, + 'typescript.format.insertSpaceAfterCommaDelimiter': { + type: 'boolean', + default: true, + description: 'Defines space handling after a comma delimiter.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterConstructor': { + type: 'boolean', + default: false, + description: 'Defines space handling after the constructor keyword.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterSemicolonInForStatements': { + type: 'boolean', + default: true, + description: 'Defines space handling after a semicolon in a for statement.', + scope: 'resource', + }, + 'typescript.format.insertSpaceBeforeAndAfterBinaryOperators': { + type: 'boolean', + default: true, + description: 'Defines space handling after a binary operator.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterKeywordsInControlFlowStatements': { + type: 'boolean', + default: true, + description: 'Defines space handling after keywords in a control flow statement.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions': { + type: 'boolean', + default: true, + description: 'Defines space handling after function keyword for anonymous functions.', + scope: 'resource', + }, + 'typescript.format.insertSpaceBeforeFunctionParenthesis': { + type: 'boolean', + default: false, + description: 'Defines space handling before function argument parentheses.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing non-empty parenthesis.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing non-empty brackets.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces': { + type: 'boolean', + default: true, + description: 'Defines space handling after opening and before closing non-empty braces.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces': { + type: 'boolean', + default: true, + description: 'Defines space handling after opening and before closing empty braces.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing template string braces.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing JSX expression braces.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterTypeAssertion': { + type: 'boolean', + default: false, + description: 'Defines space handling after type assertions in TypeScript.', + scope: 'resource', + }, + 'typescript.format.placeOpenBraceOnNewLineForFunctions': { + type: 'boolean', + default: false, + description: 'Defines whether an open brace is put onto a new line for functions or not.', + scope: 'resource', + }, + 'typescript.format.placeOpenBraceOnNewLineForControlBlocks': { + type: 'boolean', + default: false, + description: 'Defines whether an open brace is put onto a new line for control blocks or not.', + scope: 'resource', + }, + 'typescript.format.semicolons': { + type: 'string', + default: 'ignore', + description: 'Defines handling of optional semicolons.', + scope: 'resource', + enum: [ + 'ignore', + 'insert', + 'remove', + ], + enumDescriptions: [ + "Don't insert or remove any semicolons.", + 'Insert semicolons at statement ends.', + 'Remove unnecessary semicolons.', + ], + }, + 'javascript.validate.enable': { + type: 'boolean', + default: true, + description: 'Enable/disable JavaScript validation.', + scope: 'window', + }, + 'javascript.format.enable': { + type: 'boolean', + default: true, + description: 'Enable/disable default JavaScript formatter.', + scope: 'window', + }, + 'javascript.format.insertSpaceAfterCommaDelimiter': { + type: 'boolean', + default: true, + description: 'Defines space handling after a comma delimiter.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterConstructor': { + type: 'boolean', + default: false, + description: 'Defines space handling after the constructor keyword.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterSemicolonInForStatements': { + type: 'boolean', + default: true, + description: 'Defines space handling after a semicolon in a for statement.', + scope: 'resource', + }, + 'javascript.format.insertSpaceBeforeAndAfterBinaryOperators': { + type: 'boolean', + default: true, + description: 'Defines space handling after a binary operator.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterKeywordsInControlFlowStatements': { + type: 'boolean', + default: true, + description: 'Defines space handling after keywords in a control flow statement.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions': { + type: 'boolean', + default: true, + description: 'Defines space handling after function keyword for anonymous functions.', + scope: 'resource', + }, + 'javascript.format.insertSpaceBeforeFunctionParenthesis': { + type: 'boolean', + default: false, + description: 'Defines space handling before function argument parentheses.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing non-empty parenthesis.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing non-empty brackets.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces': { + type: 'boolean', + default: true, + description: 'Defines space handling after opening and before closing non-empty braces.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces': { + type: 'boolean', + default: true, + description: 'Defines space handling after opening and before closing empty braces.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing template string braces.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing JSX expression braces.', + scope: 'resource', + }, + 'javascript.format.placeOpenBraceOnNewLineForFunctions': { + type: 'boolean', + default: false, + description: 'Defines whether an open brace is put onto a new line for functions or not.', + scope: 'resource', + }, + 'javascript.format.placeOpenBraceOnNewLineForControlBlocks': { + type: 'boolean', + default: false, + description: 'Defines whether an open brace is put onto a new line for control blocks or not.', + scope: 'resource', + }, + 'javascript.format.semicolons': { + type: 'string', + default: 'ignore', + description: 'Defines handling of optional semicolons.', + scope: 'resource', + enum: [ + 'ignore', + 'insert', + 'remove', + ], + enumDescriptions: [ + "Don't insert or remove any semicolons.", + 'Insert semicolons at statement ends.', + 'Remove unnecessary semicolons.', + ], + }, + 'js/ts.implicitProjectConfig.module': { + type: 'string', + markdownDescription: 'Sets the module system for the program. See more: https://www.typescriptlang.org/tsconfig#module.', + default: 'ESNext', + enum: [ + 'CommonJS', + 'AMD', + 'System', + 'UMD', + 'ES6', + 'ES2015', + 'ES2020', + 'ESNext', + 'None', + 'ES2022', + 'Node12', + 'NodeNext', + ], + scope: 'window', + }, + 'js/ts.implicitProjectConfig.target': { + type: 'string', + default: 'ES2020', + markdownDescription: 'Set target JavaScript language version for emitted JavaScript and include library declarations. See more: https://www.typescriptlang.org/tsconfig#target.', + enum: [ + 'ES3', + 'ES5', + 'ES6', + 'ES2015', + 'ES2016', + 'ES2017', + 'ES2018', + 'ES2019', + 'ES2020', + 'ES2021', + 'ES2022', + 'ESNext', + ], + scope: 'window', + }, + 'javascript.implicitProjectConfig.checkJs': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable semantic checking of JavaScript files. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', + markdownDeprecationMessage: 'This setting has been deprecated in favor of `js/ts.implicitProjectConfig.checkJs`.', + scope: 'window', + }, + 'js/ts.implicitProjectConfig.checkJs': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable semantic checking of JavaScript files. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', + scope: 'window', + }, + 'javascript.implicitProjectConfig.experimentalDecorators': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable `experimentalDecorators` in JavaScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', + markdownDeprecationMessage: 'This setting has been deprecated in favor of `js/ts.implicitProjectConfig.experimentalDecorators`.', + scope: 'window', + }, + 'js/ts.implicitProjectConfig.experimentalDecorators': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable `experimentalDecorators` in JavaScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', + scope: 'window', + }, + 'js/ts.implicitProjectConfig.strictNullChecks': { + type: 'boolean', + default: true, + markdownDescription: 'Enable/disable [strict null checks](https://www.typescriptlang.org/tsconfig#strictNullChecks) in JavaScript and TypeScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', + scope: 'window', + }, + 'js/ts.implicitProjectConfig.strictFunctionTypes': { + type: 'boolean', + default: true, + markdownDescription: 'Enable/disable [strict function types](https://www.typescriptlang.org/tsconfig#strictFunctionTypes) in JavaScript and TypeScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', + scope: 'window', + }, + 'javascript.suggest.names': { + type: 'boolean', + default: true, + markdownDescription: 'Enable/disable including unique names from the file in JavaScript suggestions. Note that name suggestions are always disabled in JavaScript code that is semantically checked using `@ts-check` or `checkJs`.', + scope: 'resource', + }, + 'typescript.tsc.autoDetect': { + type: 'string', + default: 'on', + enum: [ + 'on', + 'off', + 'build', + 'watch', + ], + markdownEnumDescriptions: [ + 'Create both build and watch tasks.', + 'Disable this feature.', + 'Only create single run compile tasks.', + 'Only create compile and watch tasks.', + ], + description: 'Controls auto detection of tsc tasks.', + scope: 'window', + }, + 'javascript.suggest.paths': { + type: 'boolean', + default: true, + description: 'Enable/disable suggestions for paths in import statements and require calls.', + scope: 'resource', + }, + 'typescript.suggest.paths': { + type: 'boolean', + default: true, + description: 'Enable/disable suggestions for paths in import statements and require calls.', + scope: 'resource', + }, + 'javascript.suggest.autoImports': { + type: 'boolean', + default: true, + description: 'Enable/disable auto import suggestions.', + scope: 'resource', + }, + 'typescript.suggest.autoImports': { + type: 'boolean', + default: true, + description: 'Enable/disable auto import suggestions.', + scope: 'resource', + }, + 'javascript.suggest.completeJSDocs': { + type: 'boolean', + default: true, + description: 'Enable/disable suggestion to complete JSDoc comments.', + scope: 'language-overridable', + }, + 'typescript.suggest.completeJSDocs': { + type: 'boolean', + default: true, + description: 'Enable/disable suggestion to complete JSDoc comments.', + scope: 'language-overridable', + }, + 'javascript.suggest.jsdoc.generateReturns': { + type: 'boolean', + default: true, + markdownDescription: 'Enable/disable generating `@returns` annotations for JSDoc templates.', + scope: 'language-overridable', + }, + 'typescript.suggest.jsdoc.generateReturns': { + type: 'boolean', + default: true, + markdownDescription: 'Enable/disable generating `@returns` annotations for JSDoc templates.', + scope: 'language-overridable', + }, + 'typescript.locale': { + type: 'string', + default: 'auto', + enum: [ + 'auto', + 'de', + 'es', + 'en', + 'fr', + 'it', + 'ja', + 'ko', + 'ru', + 'zh-CN', + 'zh-TW', + ], + markdownDescription: "Sets the locale used to report JavaScript and TypeScript errors. Defaults to use VS Code's locale.", + scope: 'window', + }, + 'javascript.suggestionActions.enabled': { + type: 'boolean', + default: true, + description: 'Enable/disable suggestion diagnostics for JavaScript files in the editor.', + scope: 'resource', + }, + 'typescript.suggestionActions.enabled': { + type: 'boolean', + default: true, + description: 'Enable/disable suggestion diagnostics for TypeScript files in the editor.', + scope: 'resource', + }, + 'javascript.preferences.quoteStyle': { + type: 'string', + enum: [ + 'auto', + 'single', + 'double', + ], + default: 'auto', + markdownDescription: 'Preferred quote style to use for Quick Fixes.', + markdownEnumDescriptions: [ + 'Infer quote type from existing code', + "Always use single quotes: `'`", + 'Always use double quotes: `"`', + ], + scope: 'language-overridable', + }, + 'typescript.preferences.quoteStyle': { + type: 'string', + enum: [ + 'auto', + 'single', + 'double', + ], + default: 'auto', + markdownDescription: 'Preferred quote style to use for Quick Fixes.', + markdownEnumDescriptions: [ + 'Infer quote type from existing code', + "Always use single quotes: `'`", + 'Always use double quotes: `"`', + ], + scope: 'language-overridable', + }, + 'javascript.preferences.importModuleSpecifier': { + type: 'string', + enum: [ + 'shortest', + 'relative', + 'non-relative', + 'project-relative', + ], + markdownEnumDescriptions: [ + 'Prefers a non-relative import only if one is available that has fewer path segments than a relative import.', + 'Prefers a relative path to the imported file location.', + 'Prefers a non-relative import based on the `baseUrl` or `paths` configured in your `jsconfig.json` / `tsconfig.json`.', + 'Prefers a non-relative import only if the relative import path would leave the package or project directory.', + ], + default: 'shortest', + description: 'Preferred path style for auto imports.', + scope: 'language-overridable', + }, + 'typescript.preferences.importModuleSpecifier': { + type: 'string', + enum: [ + 'shortest', + 'relative', + 'non-relative', + 'project-relative', + ], + markdownEnumDescriptions: [ + 'Prefers a non-relative import only if one is available that has fewer path segments than a relative import.', + 'Prefers a relative path to the imported file location.', + 'Prefers a non-relative import based on the `baseUrl` or `paths` configured in your `jsconfig.json` / `tsconfig.json`.', + 'Prefers a non-relative import only if the relative import path would leave the package or project directory.', + ], + default: 'shortest', + description: 'Preferred path style for auto imports.', + scope: 'language-overridable', + }, + 'javascript.preferences.importModuleSpecifierEnding': { + type: 'string', + enum: [ + 'auto', + 'minimal', + 'index', + 'js', + ], + markdownEnumDescriptions: [ + 'Use project settings to select a default.', + 'Shorten `./component/index.js` to `./component`.', + 'Shorten `./component/index.js` to `./component/index`.', + 'Do not shorten path endings; include the `.js` extension.', + ], + default: 'auto', + description: 'Preferred path ending for auto imports.', + scope: 'language-overridable', + }, + 'typescript.preferences.importModuleSpecifierEnding': { + type: 'string', + enum: [ + 'auto', + 'minimal', + 'index', + 'js', + ], + markdownEnumDescriptions: [ + 'Use project settings to select a default.', + 'Shorten `./component/index.js` to `./component`.', + 'Shorten `./component/index.js` to `./component/index`.', + 'Do not shorten path endings; include the `.js` extension.', + ], + default: 'auto', + description: 'Preferred path ending for auto imports.', + scope: 'language-overridable', + }, + 'javascript.preferences.jsxAttributeCompletionStyle': { + type: 'string', + enum: [ + 'auto', + 'braces', + 'none', + ], + markdownEnumDescriptions: [ + 'Insert `={}` or `=""` after attribute names based on the prop type. See `javascript.preferences.quoteStyle` to control the type of quotes used for string attributes.', + 'Insert `={}` after attribute names.', + 'Only insert attribute names.', + ], + default: 'auto', + description: 'Preferred style for JSX attribute completions.', + scope: 'language-overridable', + }, + 'typescript.preferences.jsxAttributeCompletionStyle': { + type: 'string', + enum: [ + 'auto', + 'braces', + 'none', + ], + markdownEnumDescriptions: [ + 'Insert `={}` or `=""` after attribute names based on the prop type. See `typescript.preferences.quoteStyle` to control the type of quotes used for string attributes.', + 'Insert `={}` after attribute names.', + 'Only insert attribute names.', + ], + default: 'auto', + description: 'Preferred style for JSX attribute completions.', + scope: 'language-overridable', + }, + 'typescript.preferences.includePackageJsonAutoImports': { + type: 'string', + enum: [ + 'auto', + 'on', + 'off', + ], + enumDescriptions: [ + 'Search dependencies based on estimated performance impact.', + 'Always search dependencies.', + 'Never search dependencies.', + ], + default: 'auto', + markdownDescription: 'Enable/disable searching `package.json` dependencies for available auto imports.', + scope: 'window', + }, + 'typescript.preferences.autoImportFileExcludePatterns': { + type: 'array', + items: { + type: 'string', + }, + markdownDescription: 'Specify glob patterns of files to exclude from auto imports. Requires using TypeScript 4.8 or newer in the workspace.', + scope: 'resource', + }, + 'javascript.preferences.autoImportFileExcludePatterns': { + type: 'array', + items: { + type: 'string', + }, + markdownDescription: 'Specify glob patterns of files to exclude from auto imports. Requires using TypeScript 4.8 or newer in the workspace.', + scope: 'resource', + }, + 'javascript.preferences.renameShorthandProperties': { + type: 'boolean', + default: true, + description: 'Enable/disable introducing aliases for object shorthand properties during renames.', + deprecationMessage: "The setting 'typescript.preferences.renameShorthandProperties' has been deprecated in favor of 'typescript.preferences.useAliasesForRenames'", + scope: 'language-overridable', + }, + 'typescript.preferences.renameShorthandProperties': { + type: 'boolean', + default: true, + description: 'Enable/disable introducing aliases for object shorthand properties during renames.', + deprecationMessage: "The setting 'typescript.preferences.renameShorthandProperties' has been deprecated in favor of 'typescript.preferences.useAliasesForRenames'", + scope: 'language-overridable', + }, + 'javascript.preferences.useAliasesForRenames': { + type: 'boolean', + default: true, + description: 'Enable/disable introducing aliases for object shorthand properties during renames.', + scope: 'language-overridable', + }, + 'typescript.preferences.useAliasesForRenames': { + type: 'boolean', + default: true, + description: 'Enable/disable introducing aliases for object shorthand properties during renames.', + scope: 'language-overridable', + }, + 'typescript.updateImportsOnFileMove.enabled': { + type: 'string', + enum: [ + 'prompt', + 'always', + 'never', + ], + markdownEnumDescriptions: [ + 'Prompt on each rename.', + 'Always update paths automatically.', + "Never rename paths and don't prompt.", + ], + default: 'prompt', + description: 'Enable/disable automatic updating of import paths when you rename or move a file in VS Code.', + scope: 'resource', + }, + 'javascript.updateImportsOnFileMove.enabled': { + type: 'string', + enum: [ + 'prompt', + 'always', + 'never', + ], + markdownEnumDescriptions: [ + 'Prompt on each rename.', + 'Always update paths automatically.', + "Never rename paths and don't prompt.", + ], + default: 'prompt', + description: 'Enable/disable automatic updating of import paths when you rename or move a file in VS Code.', + scope: 'resource', + }, + 'typescript.autoClosingTags': { + type: 'boolean', + default: true, + description: 'Enable/disable automatic closing of JSX tags.', + scope: 'language-overridable', + }, + 'javascript.autoClosingTags': { + type: 'boolean', + default: true, + description: 'Enable/disable automatic closing of JSX tags.', + scope: 'language-overridable', + }, + 'javascript.suggest.enabled': { + type: 'boolean', + default: true, + description: 'Enabled/disable autocomplete suggestions.', + scope: 'language-overridable', + }, + 'typescript.suggest.enabled': { + type: 'boolean', + default: true, + description: 'Enabled/disable autocomplete suggestions.', + scope: 'language-overridable', + }, + 'typescript.surveys.enabled': { + type: 'boolean', + default: true, + description: "Enabled/disable occasional surveys that help us improve VS Code's JavaScript and TypeScript support.", + scope: 'window', + }, + 'typescript.tsserver.useSeparateSyntaxServer': { + type: 'boolean', + default: true, + description: 'Enable/disable spawning a separate TypeScript server that can more quickly respond to syntax related operations, such as calculating folding or computing document symbols.', + markdownDeprecationMessage: 'This setting has been deprecated in favor of `typescript.tsserver.useSyntaxServer`.', + scope: 'window', + }, + 'typescript.tsserver.useSyntaxServer': { + type: 'string', + scope: 'window', + description: 'Controls if TypeScript launches a dedicated server to more quickly handle syntax related operations, such as computing code folding.', + default: 'auto', + enum: [ + 'always', + 'never', + 'auto', + ], + enumDescriptions: [ + 'Use a lighter weight syntax server to handle all IntelliSense operations. This syntax server can only provide IntelliSense for opened files.', + "Don't use a dedicated syntax server. Use a single server to handle all IntelliSense operations.", + 'Spawn both a full server and a lighter weight server dedicated to syntax operations. The syntax server is used to speed up syntax operations and provide IntelliSense while projects are loading.', + ], + }, + 'typescript.tsserver.maxTsServerMemory': { + type: 'number', + default: 3072, + description: 'The maximum amount of memory (in MB) to allocate to the TypeScript server process.', + scope: 'window', + }, + 'typescript.tsserver.experimental.enableProjectDiagnostics': { + type: 'boolean', + default: false, + description: '(Experimental) Enables project wide error reporting.', + scope: 'window', + tags: [ + 'experimental', + ], + }, + 'typescript.tsserver.watchOptions': { + type: 'object', + description: 'Configure which watching strategies should be used to keep track of files and directories.', + scope: 'window', + properties: { + watchFile: { + type: 'string', + description: 'Strategy for how individual files are watched.', + enum: [ + 'fixedChunkSizePolling', + 'fixedPollingInterval', + 'priorityPollingInterval', + 'dynamicPriorityPolling', + 'useFsEvents', + 'useFsEventsOnParentDirectory', + ], + enumDescriptions: [ + 'Polls files in chunks at regular interval.', + 'Check every file for changes several times a second at a fixed interval.', + 'Check every file for changes several times a second, but use heuristics to check certain types of files less frequently than others.', + 'Use a dynamic queue where less-frequently modified files will be checked less often.', + "Attempt to use the operating system/file system's native events for file changes.", + "Attempt to use the operating system/file system's native events to listen for changes on a file's containing directories. This can use fewer file watchers, but might be less accurate.", + ], + default: 'useFsEvents', + }, + watchDirectory: { + type: 'string', + description: 'Strategy for how entire directory trees are watched under systems that lack recursive file-watching functionality.', + enum: [ + 'fixedChunkSizePolling', + 'fixedPollingInterval', + 'dynamicPriorityPolling', + 'useFsEvents', + ], + enumDescriptions: [ + 'Polls directories in chunks at regular interval.', + 'Check every directory for changes several times a second at a fixed interval.', + 'Use a dynamic queue where less-frequently modified directories will be checked less often.', + "Attempt to use the operating system/file system's native events for directory changes.", + ], + default: 'useFsEvents', + }, + fallbackPolling: { + type: 'string', + description: "When using file system events, this option specifies the polling strategy that gets used when the system runs out of native file watchers and/or doesn't support native file watchers.", + enum: [ + 'fixedPollingInterval', + 'priorityPollingInterval', + 'dynamicPriorityPolling', + ], + enumDescriptions: [ + 'configuration.tsserver.watchOptions.fallbackPolling.fixedPollingInterval', + 'configuration.tsserver.watchOptions.fallbackPolling.priorityPollingInterval', + 'configuration.tsserver.watchOptions.fallbackPolling.dynamicPriorityPolling', + ], + }, + synchronousWatchDirectory: { + type: 'boolean', + description: 'Disable deferred watching on directories. Deferred watching is useful when lots of file changes might occur at once (e.g. a change in node_modules from running npm install), but you might want to disable it with this flag for some less-common setups.', + }, + }, + }, + 'typescript.workspaceSymbols.scope': { + type: 'string', + enum: [ + 'allOpenProjects', + 'currentProject', + ], + enumDescriptions: [ + 'Search all open JavaScript or TypeScript projects for symbols.', + 'Only search for symbols in the current JavaScript or TypeScript project.', + ], + default: 'allOpenProjects', + markdownDescription: 'Controls which files are searched by [Go to Symbol in Workspace](https://code.visualstudio.com/docs/editor/editingevolved#_open-symbol-by-name).', + scope: 'window', + }, + 'javascript.suggest.classMemberSnippets.enabled': { + type: 'boolean', + default: true, + description: 'Enable/disable snippet completions for class members.', + scope: 'resource', + }, + 'typescript.suggest.classMemberSnippets.enabled': { + type: 'boolean', + default: true, + description: 'Enable/disable snippet completions for class members.', + scope: 'resource', + }, + 'typescript.suggest.objectLiteralMethodSnippets.enabled': { + type: 'boolean', + default: true, + description: 'Enable/disable snippet completions for methods in object literals. Requires using TypeScript 4.7+ in the workspace.', + scope: 'resource', + }, + 'typescript.experimental.tsserver.web.enableProjectWideIntellisense': { + type: 'boolean', + default: false, + description: 'Enable/disable project-wide IntelliSense on web. Requires that VS Code is running in a trusted context.', + scope: 'window', + tags: [ + 'experimental', + ], + }, + }, + }, + ], + configurationDefaults: undefined, + commands: [ + { + command: 'typescript.reloadProjects', + title: 'Reload Project', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'javascript.reloadProjects', + title: 'Reload Project', + originalTitle: undefined, + category: 'JavaScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.selectTypeScriptVersion', + title: 'Select TypeScript Version...', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.goToProjectConfig', + title: 'Go to Project Configuration', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'javascript.goToProjectConfig', + title: 'Go to Project Configuration', + originalTitle: undefined, + category: 'JavaScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.openTsServerLog', + title: 'Open TS Server log', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.restartTsServer', + title: 'Restart TS Server', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.findAllFileReferences', + title: 'Find File References', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.goToSourceDefinition', + title: 'Go to Source Definition', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.sortImports', + title: 'Sort Imports', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'javascript.sortImports', + title: 'Sort Imports', + originalTitle: undefined, + category: 'JavaScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.removeUnusedImports', + title: 'Remove Unused Imports', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'javascript.removeUnusedImports', + title: 'Remove Unused Imports', + originalTitle: undefined, + category: 'JavaScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + ], + menus: { + commandPalette: [ + { + command: 'typescript.reloadProjects', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == typescript && typescript.isManagedFile', + }, + { + command: 'typescript.reloadProjects', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == typescriptreact && typescript.isManagedFile', + }, + { + command: 'javascript.reloadProjects', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == javascript && typescript.isManagedFile', + }, + { + command: 'javascript.reloadProjects', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == javascriptreact && typescript.isManagedFile', + }, + { + command: 'typescript.goToProjectConfig', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == typescript && typescript.isManagedFile', + }, + { + command: 'typescript.goToProjectConfig', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == typescriptreact', + }, + { + command: 'javascript.goToProjectConfig', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == javascript && typescript.isManagedFile', + }, + { + command: 'javascript.goToProjectConfig', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == javascriptreact && typescript.isManagedFile', + }, + { + command: 'typescript.selectTypeScriptVersion', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'typescript.isManagedFile', + }, + { + command: 'typescript.openTsServerLog', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'typescript.isManagedFile', + }, + { + command: 'typescript.restartTsServer', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'typescript.isManagedFile', + }, + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'tsSupportsFileReferences && typescript.isManagedFile', + }, + { + command: 'typescript.goToSourceDefinition', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'tsSupportsSourceDefinition && typescript.isManagedFile', + }, + { + command: 'typescript.sortImports', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'supportedCodeAction =~ /(\\s|^)source\\.sortImports\\b/ && editorLangId =~ /^typescript(react)?$/', + }, + { + command: 'javascript.sortImports', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'supportedCodeAction =~ /(\\s|^)source\\.sortImports\\b/ && editorLangId =~ /^javascript(react)?$/', + }, + { + command: 'typescript.removeUnusedImports', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'supportedCodeAction =~ /(\\s|^)source\\.removeUnusedImports\\b/ && editorLangId =~ /^typescript(react)?$/', + }, + { + command: 'javascript.removeUnusedImports', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'supportedCodeAction =~ /(\\s|^)source\\.removeUnusedImports\\b/ && editorLangId =~ /^javascript(react)?$/', + }, + ], + 'editor/context': [ + { + command: 'typescript.goToSourceDefinition', + submenu: undefined, + alt: undefined, + group: 'navigation@9', + when: 'tsSupportsSourceDefinition && resourceLangId == typescript', + }, + { + command: 'typescript.goToSourceDefinition', + submenu: undefined, + alt: undefined, + group: 'navigation@9', + when: 'tsSupportsSourceDefinition && resourceLangId == typescriptreact', + }, + { + command: 'typescript.goToSourceDefinition', + submenu: undefined, + alt: undefined, + group: 'navigation@9', + when: 'tsSupportsSourceDefinition && resourceLangId == javascript', + }, + { + command: 'typescript.goToSourceDefinition', + submenu: undefined, + alt: undefined, + group: 'navigation@9', + when: 'tsSupportsSourceDefinition && resourceLangId == javascriptreact', + }, + ], + 'explorer/context': [ + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: '4_search', + when: 'tsSupportsFileReferences && resourceLangId == typescript', + }, + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: '4_search', + when: 'tsSupportsFileReferences && resourceLangId == typescriptreact', + }, + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: '4_search', + when: 'tsSupportsFileReferences && resourceLangId == javascript', + }, + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: '4_search', + when: 'tsSupportsFileReferences && resourceLangId == javascriptreact', + }, + ], + 'editor/title/context': [ + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'tsSupportsFileReferences && resourceLangId == javascript', + }, + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'tsSupportsFileReferences && resourceLangId == javascriptreact', + }, + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'tsSupportsFileReferences && resourceLangId == typescript', + }, + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'tsSupportsFileReferences && resourceLangId == typescriptreact', + }, + ], + }, + taskDefinitions: [ + { + taskType: 'typescript', + source: 'typescript-language-features', + properties: { + required: [ + 'tsconfig', + ], + all: [ + 'tsconfig', + 'option', + ], + schema: { + type: 'object', + required: [ + 'tsconfig', + ], + properties: { + tsconfig: { + type: 'string', + description: 'The tsconfig file that defines the TS build.', + }, + option: { + type: 'string', + }, + type: { + type: 'string', + const: 'typescript', + }, + }, + when: 'shellExecutionSupported', + }, + }, + }, + ], + problemMatchers: [ + { + name: 'tsc', + label: 'TypeScript problems', + owner: 'typescript', + source: 'ts', + applyTo: 'closedDocuments', + fileLocation: [ + 'relative', + '${cwd}', + ], + pattern: '$tsc', + }, + { + name: 'tsc-watch', + label: 'TypeScript problems (watch mode)', + owner: 'typescript', + source: 'ts', + applyTo: 'closedDocuments', + fileLocation: [ + 'relative', + '${cwd}', + ], + pattern: '$tsc', + background: { + activeOnStart: true, + beginsPattern: { + regexp: '^\\s*(?:message TS6032:|\\[?\\D*.{1,2}[:.].{1,2}[:.].{1,2}\\D*(├\\D*\\d{1,2}\\D+┤)?(?:\\]| -)) (Starting compilation in watch mode|File change detected\\. Starting incremental compilation)\\.\\.\\.', + }, + endsPattern: { + regexp: '^\\s*(?:message TS6042:|\\[?\\D*.{1,2}[:.].{1,2}[:.].{1,2}\\D*(├\\D*\\d{1,2}\\D+┤)?(?:\\]| -)) (?:Compilation complete\\.|Found \\d+ errors?\\.) Watching for file changes\\.', + }, + }, + }, + ], + problemPatterns: [ + { + name: 'tsc', + regexp: '^([^\\s].*)[\\(:](\\d+)[,:](\\d+)(?:\\):\\s+|\\s+-\\s+)(error|warning|info)\\s+TS(\\d+)\\s*:\\s*(.*)$', + file: 1, + line: 2, + column: 3, + severity: 4, + code: 5, + message: 6, + }, + ], + resourceLabelFormatters: undefined, + authentication: undefined, + notebooks: undefined, + snippets: undefined, + themes: undefined, + iconThemes: undefined, + colors: undefined, + localizations: undefined, + terminalProfiles: undefined, + }, + }, + { + metadata: { + host: 'main', + model: { + packagePath: '/home/tobias/Git/OpenSource/theia/theia/plugins/ts-base/extension', + packageUri: 'file:///home/tobias/Git/OpenSource/theia/theia/plugins/ts-base/extension', + id: 'vscode.typescript', + name: 'typescript', + publisher: 'vscode', + version: '1.88.1', + displayName: 'TypeScript Language Basics (built-in)', + description: 'Provides snippets, syntax highlighting, bracket matching and folding in TypeScript files.', + engine: { + type: 'vscode', + version: '*', + }, + entryPoint: { + backend: undefined, + }, + iconUrl: undefined, + l10n: undefined, + readmeUrl: 'hostedPlugin/vscode_typescript/.%2FREADME.md', + licenseUrl: 'hostedPlugin/vscode_typescript/.%2FLICENSE', + }, + lifecycle: { + startMethod: 'activate', + stopMethod: 'deactivate', + frontendModuleName: 'vscode_typescript', + frontendInitPath: 'plugin-vscode-init-fe.js', + backendInitPath: '/home/tobias/Git/OpenSource/theia/theia/examples/browser/lib/backend/plugin-vscode-init', + }, + outOfSync: false, + isUnderDevelopment: false, + }, + type: 0, + contributes: { + activationEvents: [ + 'onLanguage:typescript', + 'onLanguage:typescriptreact', + 'onLanguage:jsonc', + 'onLanguage:json', + ], + configurationDefaults: undefined, + languages: [ + { + id: 'typescript', + aliases: [ + 'TypeScript', + 'ts', + 'typescript', + ], + extensions: [ + '.ts', + '.cts', + '.mts', + ], + filenamePatterns: undefined, + filenames: undefined, + firstLine: undefined, + mimetypes: undefined, + configuration: { + brackets: [ + [ + '${', + '}', + ], + [ + '{', + '}', + ], + [ + '[', + ']', + ], + [ + '(', + ')', + ], + ], + comments: { + lineComment: '//', + blockComment: [ + '/*', + '*/', + ], + }, + folding: { + markers: { + start: '^\\s*//\\s*#?region\\b', + end: '^\\s*//\\s*#?endregion\\b', + }, + }, + wordPattern: { + pattern: "(-?\\d*\\.\\d\\w*)|([^\\`\\@\\~\\!\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>/\\?\\s]+)", + }, + autoClosingPairs: [ + { + open: '{', + close: '}', + notIn: undefined, + }, + { + open: '[', + close: ']', + notIn: undefined, + }, + { + open: '(', + close: ')', + notIn: undefined, + }, + { + open: "'", + close: "'", + notIn: [ + 'string', + 'comment', + ], + }, + { + open: '"', + close: '"', + notIn: [ + 'string', + ], + }, + { + open: '`', + close: '`', + notIn: [ + 'string', + 'comment', + ], + }, + { + open: '/**', + close: ' */', + notIn: [ + 'string', + ], + }, + ], + indentationRules: { + decreaseIndentPattern: { + pattern: '^((?!.*?/\\*).*\\*/)?\\s*[\\}\\]].*$', + }, + increaseIndentPattern: { + pattern: "^((?!//).)*(\\{([^}\"'`/]*|(\\t|[ ])*//.*)|\\([^)\"'`/]*|\\[[^\\]\"'`/]*)$", + }, + unIndentedLinePattern: { + pattern: '^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$', + }, + }, + surroundingPairs: [ + { + open: '{', + close: '}', + }, + { + open: '[', + close: ']', + }, + { + open: '(', + close: ')', + }, + { + open: "'", + close: "'", + }, + { + open: '"', + close: '"', + }, + { + open: '`', + close: '`', + }, + { + open: '<', + close: '>', + }, + ], + onEnterRules: [ + { + beforeText: { + pattern: '^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$', + }, + afterText: { + pattern: '^\\s*\\*/$', + }, + action: { + indent: 'indentOutdent', + appendText: ' * ', + }, + }, + { + beforeText: { + pattern: '^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$', + }, + action: { + indent: 'none', + appendText: ' * ', + }, + }, + { + beforeText: { + pattern: '^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$', + }, + previousLineText: { + pattern: '(?=^(\\s*(/\\*\\*|\\*)).*)(?=(?!(\\s*\\*/)))', + }, + action: { + indent: 'none', + appendText: '* ', + }, + }, + { + beforeText: { + pattern: '^(\\t|[ ])*[ ]\\*/\\s*$', + }, + action: { + indent: 'none', + removeText: 1, + }, + }, + { + beforeText: { + pattern: '^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$', + }, + action: { + indent: 'none', + removeText: 1, + }, + }, + { + beforeText: { + pattern: '^\\s*(\\bcase\\s.+:|\\bdefault:)$', + }, + afterText: { + pattern: '^(?!\\s*(\\bcase\\b|\\bdefault\\b))', + }, + action: { + indent: 'indent', + }, + }, + ], + }, + }, + { + id: 'typescriptreact', + aliases: [ + 'TypeScript JSX', + 'TypeScript React', + 'tsx', + ], + extensions: [ + '.tsx', + ], + filenamePatterns: undefined, + filenames: undefined, + firstLine: undefined, + mimetypes: undefined, + configuration: { + brackets: [ + [ + '${', + '}', + ], + [ + '{', + '}', + ], + [ + '[', + ']', + ], + [ + '(', + ')', + ], + ], + comments: { + lineComment: '//', + blockComment: [ + '/*', + '*/', + ], + }, + folding: { + markers: { + start: '^\\s*//\\s*#?region\\b', + end: '^\\s*//\\s*#?endregion\\b', + }, + }, + wordPattern: { + pattern: "(-?\\d*\\.\\d\\w*)|([^\\`\\@\\~\\!\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>/\\?\\s]+)", + }, + autoClosingPairs: [ + { + open: '{', + close: '}', + notIn: undefined, + }, + { + open: '[', + close: ']', + notIn: undefined, + }, + { + open: '(', + close: ')', + notIn: undefined, + }, + { + open: "'", + close: "'", + notIn: [ + 'string', + 'comment', + ], + }, + { + open: '"', + close: '"', + notIn: [ + 'string', + ], + }, + { + open: '`', + close: '`', + notIn: [ + 'string', + 'comment', + ], + }, + { + open: '/**', + close: ' */', + notIn: [ + 'string', + ], + }, + ], + indentationRules: { + decreaseIndentPattern: { + pattern: '^((?!.*?/\\*).*\\*/)?\\s*[\\}\\]].*$', + }, + increaseIndentPattern: { + pattern: "^((?!//).)*(\\{([^}\"'`/]*|(\\t|[ ])*//.*)|\\([^)\"'`/]*|\\[[^\\]\"'`/]*)$", + }, + unIndentedLinePattern: { + pattern: '^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$', + }, + }, + surroundingPairs: [ + { + open: '{', + close: '}', + }, + { + open: '[', + close: ']', + }, + { + open: '(', + close: ')', + }, + { + open: "'", + close: "'", + }, + { + open: '"', + close: '"', + }, + { + open: '`', + close: '`', + }, + { + open: '<', + close: '>', + }, + ], + onEnterRules: [ + { + beforeText: { + pattern: '^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$', + }, + afterText: { + pattern: '^\\s*\\*/$', + }, + action: { + indent: 'indentOutdent', + appendText: ' * ', + }, + }, + { + beforeText: { + pattern: '^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$', + }, + action: { + indent: 'none', + appendText: ' * ', + }, + }, + { + beforeText: { + pattern: '^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$', + }, + previousLineText: { + pattern: '(?=^(\\s*(/\\*\\*|\\*)).*)(?=(?!(\\s*\\*/)))', + }, + action: { + indent: 'none', + appendText: '* ', + }, + }, + { + beforeText: { + pattern: '^(\\t|[ ])*[ ]\\*/\\s*$', + }, + action: { + indent: 'none', + removeText: 1, + }, + }, + { + beforeText: { + pattern: '^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$', + }, + action: { + indent: 'none', + removeText: 1, + }, + }, + { + beforeText: { + pattern: '^\\s*(\\bcase\\s.+:|\\bdefault:)$', + }, + afterText: { + pattern: '^(?!\\s*(\\bcase\\b|\\bdefault\\b))', + }, + action: { + indent: 'indent', + }, + }, + ], + }, + }, + { + id: 'jsonc', + aliases: undefined, + extensions: undefined, + filenamePatterns: [ + 'tsconfig.*.json', + 'jsconfig.*.json', + 'tsconfig-*.json', + 'jsconfig-*.json', + ], + filenames: [ + 'tsconfig.json', + 'jsconfig.json', + ], + firstLine: undefined, + mimetypes: undefined, + }, + { + id: 'json', + aliases: undefined, + extensions: undefined, + filenamePatterns: undefined, + filenames: [ + 'tsconfig.tsbuildinfo', + ], + firstLine: undefined, + mimetypes: undefined, + }, + ], + grammars: [ + { + language: 'typescript', + scope: 'source.ts', + format: 'json', + grammar: { + information_for_contributors: [ + 'This file has been converted from https://github.com/microsoft/TypeScript-TmLanguage/blob/master/TypeScript.tmLanguage', + 'If you want to provide a fix or improvement, please create a pull request against the original repository.', + 'Once accepted there, we are happy to receive an update request.', + ], + version: 'https://github.com/microsoft/TypeScript-TmLanguage/commit/0d73d1117e0a9b1d6635ebbe9aa37d615171b02d', + name: 'TypeScript', + scopeName: 'source.ts', + patterns: [ + { + include: '#directives', + }, + { + include: '#statements', + }, + { + include: '#shebang', + }, + ], + repository: { + shebang: { + name: 'comment.line.shebang.ts', + match: '\\A(#!).*(?=$)', + captures: { + '1': { + name: 'punctuation.definition.comment.ts', + }, + }, + }, + statements: { + patterns: [ + { + include: '#declaration', + }, + { + include: '#control-statement', + }, + { + include: '#after-operator-block-as-object-literal', + }, + { + include: '#decl-block', + }, + { + include: '#label', + }, + { + include: '#expression', + }, + { + include: '#punctuation-semicolon', + }, + { + include: '#string', + }, + { + include: '#comment', + }, + ], + }, + declaration: { + patterns: [ + { + include: '#decorator', + }, + { + include: '#var-expr', + }, + { + include: '#function-declaration', + }, + { + include: '#class-declaration', + }, + { + include: '#interface-declaration', + }, + { + include: '#enum-declaration', + }, + { + include: '#namespace-declaration', + }, + { + include: '#type-alias-declaration', + }, + { + include: '#import-equals-declaration', + }, + { + include: '#import-declaration', + }, + { + include: '#export-declaration', + }, + { + name: 'storage.modifier.ts', + match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + beginCaptures: { + '1': { + name: 'meta.definition.variable.ts entity.name.function.ts', + }, + '2': { + name: 'keyword.operator.definiteassignment.ts', + }, + }, + end: '(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + beginCaptures: { + '1': { + name: 'meta.definition.variable.ts variable.other.constant.ts entity.name.function.ts', + }, + }, + end: '(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '1': { + name: 'storage.modifier.ts', + }, + '2': { + name: 'keyword.operator.rest.ts', + }, + '3': { + name: 'entity.name.function.ts variable.language.this.ts', + }, + '4': { + name: 'entity.name.function.ts', + }, + '5': { + name: 'keyword.operator.optional.ts', + }, + }, + }, + { + match: '(?x)(?:(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '1': { + name: 'meta.definition.property.ts entity.name.function.ts', + }, + '2': { + name: 'keyword.operator.optional.ts', + }, + '3': { + name: 'keyword.operator.definiteassignment.ts', + }, + }, + }, + { + name: 'meta.definition.property.ts variable.object.property.ts', + match: '\\#?[_$[:alpha:]][_$[:alnum:]]*', + }, + { + name: 'keyword.operator.optional.ts', + match: '\\?', + }, + { + name: 'keyword.operator.definiteassignment.ts', + match: '\\!', + }, + ], + }, + 'variable-initializer': { + patterns: [ + { + begin: '(?\\s*$)', + beginCaptures: { + '1': { + name: 'keyword.operator.assignment.ts', + }, + }, + end: '(?=$|^|[,);}\\]]|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])', + beginCaptures: { + '1': { + name: 'storage.modifier.ts', + }, + '2': { + name: 'storage.modifier.ts', + }, + '3': { + name: 'storage.modifier.ts', + }, + '4': { + name: 'storage.modifier.async.ts', + }, + '5': { + name: 'keyword.operator.new.ts', + }, + '6': { + name: 'keyword.generator.asterisk.ts', + }, + }, + end: '(?=\\}|;|,|$)|(?<=\\})', + patterns: [ + { + include: '#method-declaration-name', + }, + { + include: '#function-body', + }, + ], + }, + { + name: 'meta.method.declaration.ts', + begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + beginCaptures: { + '1': { + name: 'storage.modifier.ts', + }, + '2': { + name: 'storage.modifier.ts', + }, + '3': { + name: 'storage.modifier.ts', + }, + '4': { + name: 'storage.modifier.async.ts', + }, + '5': { + name: 'storage.type.property.ts', + }, + '6': { + name: 'keyword.generator.asterisk.ts', + }, + }, + end: '(?=\\}|;|,|$)|(?<=\\})', + patterns: [ + { + include: '#method-declaration-name', + }, + { + include: '#function-body', + }, + ], + }, + ], + }, + 'object-literal-method-declaration': { + name: 'meta.method.declaration.ts', + begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + '2': { + name: 'storage.type.property.ts', + }, + '3': { + name: 'keyword.generator.asterisk.ts', + }, + }, + end: '(?=\\}|;|,)|(?<=\\})', + patterns: [ + { + include: '#method-declaration-name', + }, + { + include: '#function-body', + }, + { + begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + '2': { + name: 'storage.type.property.ts', + }, + '3': { + name: 'keyword.generator.asterisk.ts', + }, + }, + end: '(?=\\(|\\<)', + patterns: [ + { + include: '#method-declaration-name', + }, + ], + }, + ], + }, + 'method-declaration-name': { + begin: "(?x)(?=((\\b(?)', + captures: { + '1': { + name: 'storage.modifier.async.ts', + }, + '2': { + name: 'variable.parameter.ts', + }, + }, + }, + { + name: 'meta.arrow.ts', + begin: "(?x) (?:\n (? is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n )\n)", + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + }, + end: '(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', + patterns: [ + { + include: '#comment', + }, + { + include: '#type-parameters', + }, + { + include: '#function-parameters', + }, + { + include: '#arrow-return-type', + }, + { + include: '#possibly-arrow-return-type', + }, + ], + }, + { + name: 'meta.arrow.ts', + begin: '=>', + beginCaptures: { + '0': { + name: 'storage.type.function.arrow.ts', + }, + }, + end: '((?<=\\}|\\S)(?)|((?!\\{)(?=\\S)))(?!\\/[\\/\\*])', + patterns: [ + { + include: '#single-line-comment-consuming-line-ending', + }, + { + include: '#decl-block', + }, + { + include: '#expression', + }, + ], + }, + ], + }, + 'indexer-declaration': { + name: 'meta.indexer.declaration.ts', + begin: '(?:(?]|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^yield|[^\\._$[:alnum:]]yield|^throw|[^\\._$[:alnum:]]throw|^in|[^\\._$[:alnum:]]in|^of|[^\\._$[:alnum:]]of|^typeof|[^\\._$[:alnum:]]typeof|&&|\\|\\||\\*)\\s*(\\{)', + beginCaptures: { + '1': { + name: 'punctuation.definition.block.ts', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.block.ts', + }, + }, + patterns: [ + { + include: '#object-member', + }, + ], + }, + 'object-literal': { + name: 'meta.objectliteral.ts', + begin: '\\{', + beginCaptures: { + '0': { + name: 'punctuation.definition.block.ts', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.block.ts', + }, + }, + patterns: [ + { + include: '#object-member', + }, + ], + }, + 'object-member': { + patterns: [ + { + include: '#comment', + }, + { + include: '#object-literal-method-declaration', + }, + { + name: 'meta.object.member.ts meta.object-literal.key.ts', + begin: '(?=\\[)', + end: '(?=:)|((?<=[\\]])(?=\\s*[\\(\\<]))', + patterns: [ + { + include: '#comment', + }, + { + include: '#array-literal', + }, + ], + }, + { + name: 'meta.object.member.ts meta.object-literal.key.ts', + begin: "(?=[\\'\\\"\\`])", + end: "(?=:)|((?<=[\\'\\\"\\`])(?=((\\s*[\\(\\<,}])|(\\s+(as|satisifies)\\s+))))", + patterns: [ + { + include: '#comment', + }, + { + include: '#string', + }, + ], + }, + { + name: 'meta.object.member.ts meta.object-literal.key.ts', + begin: '(?x)(?=(\\b(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '0': { + name: 'meta.object-literal.key.ts', + }, + '1': { + name: 'entity.name.function.ts', + }, + }, + }, + { + name: 'meta.object.member.ts', + match: '(?:[_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:)', + captures: { + '0': { + name: 'meta.object-literal.key.ts', + }, + }, + }, + { + name: 'meta.object.member.ts', + begin: '\\.\\.\\.', + beginCaptures: { + '0': { + name: 'keyword.operator.spread.ts', + }, + }, + end: '(?=,|\\})', + patterns: [ + { + include: '#expression', + }, + ], + }, + { + name: 'meta.object.member.ts', + match: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=,|\\}|$|\\/\\/|\\/\\*)', + captures: { + '1': { + name: 'variable.other.readwrite.ts', + }, + }, + }, + { + name: 'meta.object.member.ts', + match: '(?]|\\|\\||\\&\\&|\\!\\=\\=|$|^|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + }, + end: '(?<=\\))', + patterns: [ + { + include: '#type-parameters', + }, + { + begin: '\\(', + beginCaptures: { + '0': { + name: 'meta.brace.round.ts', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.ts', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + ], + }, + { + begin: '(?<=:)\\s*(async)?\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + '2': { + name: 'meta.brace.round.ts', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.ts', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + { + begin: '(?<=:)\\s*(async)?\\s*(?=\\<\\s*$)', + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + }, + end: '(?<=\\>)', + patterns: [ + { + include: '#type-parameters', + }, + ], + }, + { + begin: '(?<=\\>)\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'meta.brace.round.ts', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.ts', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + { + include: '#possibly-arrow-return-type', + }, + { + include: '#expression', + }, + ], + }, + { + include: '#punctuation-comma', + }, + { + include: '#decl-block', + }, + ], + }, + 'ternary-expression': { + begin: '(?!\\?\\.\\s*[^[:digit:]])(\\?)(?!\\?)', + beginCaptures: { + '1': { + name: 'keyword.operator.ternary.ts', + }, + }, + end: '\\s*(:)', + endCaptures: { + '1': { + name: 'keyword.operator.ternary.ts', + }, + }, + patterns: [ + { + include: '#expression', + }, + ], + }, + 'function-call': { + patterns: [ + { + begin: "(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", + end: "(?<=\\))(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", + patterns: [ + { + name: 'meta.function-call.ts', + begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))', + end: "(?=\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", + patterns: [ + { + include: '#function-call-target', + }, + ], + }, + { + include: '#comment', + }, + { + include: '#function-call-optionals', + }, + { + include: '#type-arguments', + }, + { + include: '#paren-expression', + }, + ], + }, + { + begin: '(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))(<\\s*[\\{\\[\\(]\\s*$))', + end: '(?<=\\>)(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))(<\\s*[\\{\\[\\(]\\s*$))', + patterns: [ + { + name: 'meta.function-call.ts', + begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))', + end: '(?=(<\\s*[\\{\\[\\(]\\s*$))', + patterns: [ + { + include: '#function-call-target', + }, + ], + }, + { + include: '#comment', + }, + { + include: '#function-call-optionals', + }, + { + include: '#type-arguments', + }, + ], + }, + ], + }, + 'function-call-target': { + patterns: [ + { + include: '#support-function-call-identifiers', + }, + { + name: 'entity.name.function.ts', + match: '(\\#?[_$[:alpha:]][_$[:alnum:]]*)', + }, + ], + }, + 'function-call-optionals': { + patterns: [ + { + name: 'meta.function-call.ts punctuation.accessor.optional.ts', + match: '\\?\\.', + }, + { + name: 'meta.function-call.ts keyword.operator.definiteassignment.ts', + match: '\\!', + }, + ], + }, + 'support-function-call-identifiers': { + patterns: [ + { + include: '#literal', + }, + { + include: '#support-objects', + }, + { + include: '#object-identifiers', + }, + { + include: '#punctuation-accessor', + }, + { + name: 'keyword.operator.expression.import.ts', + match: "(?:(?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|(===|!==|==|!=)|(([\\&\\~\\^\\|]\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s+instanceof(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + }, + end: '(?<=\\))', + patterns: [ + { + include: '#paren-expression-possibly-arrow-with-typeparameters', + }, + ], + }, + { + begin: '(?<=[(=,]|=>|^return|[^\\._$[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\()|(<)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)))\\s*$)', + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + }, + end: '(?<=\\))', + patterns: [ + { + include: '#paren-expression-possibly-arrow-with-typeparameters', + }, + ], + }, + { + include: '#possibly-arrow-return-type', + }, + ], + }, + 'paren-expression-possibly-arrow-with-typeparameters': { + patterns: [ + { + include: '#type-parameters', + }, + { + begin: '\\(', + beginCaptures: { + '0': { + name: 'meta.brace.round.ts', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.ts', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + ], + }, + 'expression-inside-possibly-arrow-parens': { + patterns: [ + { + include: '#expressionWithoutIdentifiers', + }, + { + include: '#comment', + }, + { + include: '#string', + }, + { + include: '#decorator', + }, + { + include: '#destructuring-parameter', + }, + { + match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '1': { + name: 'storage.modifier.ts', + }, + '2': { + name: 'keyword.operator.rest.ts', + }, + '3': { + name: 'entity.name.function.ts variable.language.this.ts', + }, + '4': { + name: 'entity.name.function.ts', + }, + '5': { + name: 'keyword.operator.optional.ts', + }, + }, + }, + { + match: '(?x)(?:(?)', + captures: { + '1': { + name: 'meta.brace.angle.ts', + }, + '2': { + name: 'storage.modifier.ts', + }, + '3': { + name: 'meta.brace.angle.ts', + }, + }, + }, + { + name: 'cast.expr.ts', + begin: '(?:(?*?\\&\\|\\^]|[^_$[:alnum:]](?:\\+\\+|\\-\\-)|[^\\+]\\+|[^\\-]\\-))\\s*(<)(?!)', + endCaptures: { + '1': { + name: 'meta.brace.angle.ts', + }, + }, + patterns: [ + { + include: '#type', + }, + ], + }, + { + name: 'cast.expr.ts', + begin: '(?:(?<=^))\\s*(<)(?=[_$[:alpha:]][_$[:alnum:]]*\\s*>)', + beginCaptures: { + '1': { + name: 'meta.brace.angle.ts', + }, + }, + end: '(\\>)', + endCaptures: { + '1': { + name: 'meta.brace.angle.ts', + }, + }, + patterns: [ + { + include: '#type', + }, + ], + }, + ], + }, + 'expression-operators': { + patterns: [ + { + name: 'keyword.control.flow.ts', + match: '(?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?>=|>>>=|\\|=', + }, + { + name: 'keyword.operator.bitwise.shift.ts', + match: '<<|>>>|>>', + }, + { + name: 'keyword.operator.comparison.ts', + match: '===|!==|==|!=', + }, + { + name: 'keyword.operator.relational.ts', + match: '<=|>=|<>|<|>', + }, + { + match: '(?<=[_$[:alnum:]])(\\!)\\s*(?:(/=)|(?:(/)(?![/*])))', + captures: { + '1': { + name: 'keyword.operator.logical.ts', + }, + '2': { + name: 'keyword.operator.assignment.compound.ts', + }, + '3': { + name: 'keyword.operator.arithmetic.ts', + }, + }, + }, + { + name: 'keyword.operator.logical.ts', + match: '\\!|&&|\\|\\||\\?\\?', + }, + { + name: 'keyword.operator.bitwise.ts', + match: '\\&|~|\\^|\\|', + }, + { + name: 'keyword.operator.assignment.ts', + match: '\\=', + }, + { + name: 'keyword.operator.decrement.ts', + match: '--', + }, + { + name: 'keyword.operator.increment.ts', + match: '\\+\\+', + }, + { + name: 'keyword.operator.arithmetic.ts', + match: '%|\\*|/|-|\\+', + }, + { + begin: '(?<=[_$[:alnum:])\\]])\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)+(?:(/=)|(?:(/)(?![/*]))))', + end: '(?:(/=)|(?:(/)(?!\\*([^\\*]|(\\*[^\\/]))*\\*\\/)))', + endCaptures: { + '1': { + name: 'keyword.operator.assignment.compound.ts', + }, + '2': { + name: 'keyword.operator.arithmetic.ts', + }, + }, + patterns: [ + { + include: '#comment', + }, + ], + }, + { + match: '(?<=[_$[:alnum:])\\]])\\s*(?:(/=)|(?:(/)(?![/*])))', + captures: { + '1': { + name: 'keyword.operator.assignment.compound.ts', + }, + '2': { + name: 'keyword.operator.arithmetic.ts', + }, + }, + }, + ], + }, + 'typeof-operator': { + begin: '(?:&|{\\?]|(extends\\s+)|$|;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))', + patterns: [ + { + include: '#type-arguments', + }, + { + include: '#expression', + }, + ], + }, + literal: { + patterns: [ + { + include: '#numeric-literal', + }, + { + include: '#boolean-literal', + }, + { + include: '#null-literal', + }, + { + include: '#undefined-literal', + }, + { + include: '#numericConstant-literal', + }, + { + include: '#array-literal', + }, + { + include: '#this-literal', + }, + { + include: '#super-literal', + }, + ], + }, + 'array-literal': { + name: 'meta.array.literal.ts', + begin: '\\s*(\\[)', + beginCaptures: { + '1': { + name: 'meta.brace.square.ts', + }, + }, + end: '\\]', + endCaptures: { + '0': { + name: 'meta.brace.square.ts', + }, + }, + patterns: [ + { + include: '#expression', + }, + { + include: '#punctuation-comma', + }, + ], + }, + 'numeric-literal': { + patterns: [ + { + name: 'constant.numeric.hex.ts', + match: '\\b(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\\())\n |\n (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$)))', + captures: { + '1': { + name: 'punctuation.accessor.ts', + }, + '2': { + name: 'punctuation.accessor.optional.ts', + }, + '3': { + name: 'support.variable.property.ts', + }, + '4': { + name: 'support.constant.ts', + }, + }, + }, + { + match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n))", + captures: { + '1': { + name: 'punctuation.accessor.ts', + }, + '2': { + name: 'punctuation.accessor.optional.ts', + }, + '3': { + name: 'entity.name.function.ts', + }, + }, + }, + { + match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])', + captures: { + '1': { + name: 'punctuation.accessor.ts', + }, + '2': { + name: 'punctuation.accessor.optional.ts', + }, + '3': { + name: 'variable.other.constant.property.ts', + }, + }, + }, + { + match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*)', + captures: { + '1': { + name: 'punctuation.accessor.ts', + }, + '2': { + name: 'punctuation.accessor.optional.ts', + }, + '3': { + name: 'variable.other.property.ts', + }, + }, + }, + { + name: 'variable.other.constant.ts', + match: '([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])', + }, + { + name: 'variable.other.readwrite.ts', + match: '[_$[:alpha:]][_$[:alnum:]]*', + }, + ], + }, + 'object-identifiers': { + patterns: [ + { + name: 'support.class.ts', + match: '([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\??\\.\\s*prototype\\b(?!\\$))', + }, + { + match: '(?x)(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n (\\#?[[:upper:]][_$[:digit:][:upper:]]*) |\n (\\#?[_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)', + captures: { + '1': { + name: 'punctuation.accessor.ts', + }, + '2': { + name: 'punctuation.accessor.optional.ts', + }, + '3': { + name: 'variable.other.constant.object.property.ts', + }, + '4': { + name: 'variable.other.object.property.ts', + }, + }, + }, + { + match: '(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)', + captures: { + '1': { + name: 'variable.other.constant.object.ts', + }, + '2': { + name: 'variable.other.object.ts', + }, + }, + }, + ], + }, + 'type-annotation': { + patterns: [ + { + name: 'meta.type.annotation.ts', + begin: '(:)(?=\\s*\\S)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.ts', + }, + }, + end: '(?])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))', + patterns: [ + { + include: '#type', + }, + ], + }, + { + name: 'meta.type.annotation.ts', + begin: '(:)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.ts', + }, + }, + end: '(?])|(?=^\\s*$)|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))', + patterns: [ + { + include: '#type', + }, + ], + }, + ], + }, + 'parameter-type-annotation': { + patterns: [ + { + name: 'meta.type.annotation.ts', + begin: '(:)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.ts', + }, + }, + end: '(?=[,)])|(?==[^>])', + patterns: [ + { + include: '#type', + }, + ], + }, + ], + }, + 'return-type': { + patterns: [ + { + name: 'meta.return.type.ts', + begin: '(?<=\\))\\s*(:)(?=\\s*\\S)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.ts', + }, + }, + end: '(?|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', + patterns: [ + { + include: '#arrow-return-type-body', + }, + ], + }, + 'possibly-arrow-return-type': { + begin: '(?<=\\)|^)\\s*(:)(?=\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*=>)', + beginCaptures: { + '1': { + name: 'meta.arrow.ts meta.return.type.arrow.ts keyword.operator.type.annotation.ts', + }, + }, + end: '(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', + contentName: 'meta.arrow.ts meta.return.type.arrow.ts', + patterns: [ + { + include: '#arrow-return-type-body', + }, + ], + }, + 'arrow-return-type-body': { + patterns: [ + { + begin: '(?<=[:])(?=\\s*\\{)', + end: '(?<=\\})', + patterns: [ + { + include: '#type-object', + }, + ], + }, + { + include: '#type-predicate-operator', + }, + { + include: '#type', + }, + ], + }, + 'type-parameters': { + name: 'meta.type.parameters.ts', + begin: '(<)', + beginCaptures: { + '1': { + name: 'punctuation.definition.typeparameters.begin.ts', + }, + }, + end: '(>)', + endCaptures: { + '1': { + name: 'punctuation.definition.typeparameters.end.ts', + }, + }, + patterns: [ + { + include: '#comment', + }, + { + name: 'storage.modifier.ts', + match: '(?)', + }, + ], + }, + 'type-arguments': { + name: 'meta.type.parameters.ts', + begin: '\\<', + beginCaptures: { + '0': { + name: 'punctuation.definition.typeparameters.begin.ts', + }, + }, + end: '\\>', + endCaptures: { + '0': { + name: 'punctuation.definition.typeparameters.end.ts', + }, + }, + patterns: [ + { + include: '#type-arguments-body', + }, + ], + }, + 'type-arguments-body': { + patterns: [ + { + match: '(?)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))))', + captures: { + '1': { + name: 'storage.modifier.ts', + }, + '2': { + name: 'keyword.operator.rest.ts', + }, + '3': { + name: 'entity.name.function.ts variable.language.this.ts', + }, + '4': { + name: 'entity.name.function.ts', + }, + '5': { + name: 'keyword.operator.optional.ts', + }, + }, + }, + { + match: '(?x)(?:(?)', + patterns: [ + { + include: '#comment', + }, + { + include: '#type-parameters', + }, + ], + }, + { + name: 'meta.type.constructor.ts', + begin: '(?)\n ))\n )\n )\n)', + end: '(?<=\\))', + patterns: [ + { + include: '#function-parameters', + }, + ], + }, + ], + }, + 'type-function-return-type': { + patterns: [ + { + name: 'meta.type.function.return.ts', + begin: '(=>)(?=\\s*\\S)', + beginCaptures: { + '1': { + name: 'storage.type.function.arrow.ts', + }, + }, + end: '(?)(?:\\?]|//|$)', + patterns: [ + { + include: '#type-function-return-type-core', + }, + ], + }, + { + name: 'meta.type.function.return.ts', + begin: '=>', + beginCaptures: { + '0': { + name: 'storage.type.function.arrow.ts', + }, + }, + end: '(?)(?]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))', + patterns: [ + { + include: '#type-function-return-type-core', + }, + ], + }, + ], + }, + 'type-function-return-type-core': { + patterns: [ + { + include: '#comment', + }, + { + begin: '(?<==>)(?=\\s*\\{)', + end: '(?<=\\})', + patterns: [ + { + include: '#type-object', + }, + ], + }, + { + include: '#type-predicate-operator', + }, + { + include: '#type', + }, + ], + }, + 'type-operators': { + patterns: [ + { + include: '#typeof-operator', + }, + { + include: '#type-infer', + }, + { + begin: '([&|])(?=\\s*\\{)', + beginCaptures: { + '0': { + name: 'keyword.operator.type.ts', + }, + }, + end: '(?<=\\})', + patterns: [ + { + include: '#type-object', + }, + ], + }, + { + begin: '[&|]', + beginCaptures: { + '0': { + name: 'keyword.operator.type.ts', + }, + }, + end: '(?=\\S)', + }, + { + name: 'keyword.operator.expression.keyof.ts', + match: '(?)', + endCaptures: { + '1': { + name: 'meta.type.parameters.ts punctuation.definition.typeparameters.end.ts', + }, + }, + contentName: 'meta.type.parameters.ts', + patterns: [ + { + include: '#type-arguments-body', + }, + ], + }, + { + begin: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(<)', + beginCaptures: { + '1': { + name: 'entity.name.type.ts', + }, + '2': { + name: 'meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts', + }, + }, + end: '(>)', + endCaptures: { + '1': { + name: 'meta.type.parameters.ts punctuation.definition.typeparameters.end.ts', + }, + }, + contentName: 'meta.type.parameters.ts', + patterns: [ + { + include: '#type-arguments-body', + }, + ], + }, + { + match: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))', + captures: { + '1': { + name: 'entity.name.type.module.ts', + }, + '2': { + name: 'punctuation.accessor.ts', + }, + '3': { + name: 'punctuation.accessor.optional.ts', + }, + }, + }, + { + name: 'entity.name.type.ts', + match: '[_$[:alpha:]][_$[:alnum:]]*', + }, + ], + }, + 'punctuation-comma': { + name: 'punctuation.separator.comma.ts', + match: ',', + }, + 'punctuation-semicolon': { + name: 'punctuation.terminator.statement.ts', + match: ';', + }, + 'punctuation-accessor': { + match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))', + captures: { + '1': { + name: 'punctuation.accessor.ts', + }, + '2': { + name: 'punctuation.accessor.optional.ts', + }, + }, + }, + string: { + patterns: [ + { + include: '#qstring-single', + }, + { + include: '#qstring-double', + }, + { + include: '#template', + }, + ], + }, + 'qstring-double': { + name: 'string.quoted.double.ts', + begin: '"', + beginCaptures: { + '0': { + name: 'punctuation.definition.string.begin.ts', + }, + }, + end: '(")|((?:[^\\\\\\n])$)', + endCaptures: { + '1': { + name: 'punctuation.definition.string.end.ts', + }, + '2': { + name: 'invalid.illegal.newline.ts', + }, + }, + patterns: [ + { + include: '#string-character-escape', + }, + ], + }, + 'qstring-single': { + name: 'string.quoted.single.ts', + begin: "'", + beginCaptures: { + '0': { + name: 'punctuation.definition.string.begin.ts', + }, + }, + end: "(\\')|((?:[^\\\\\\n])$)", + endCaptures: { + '1': { + name: 'punctuation.definition.string.end.ts', + }, + '2': { + name: 'invalid.illegal.newline.ts', + }, + }, + patterns: [ + { + include: '#string-character-escape', + }, + ], + }, + 'string-character-escape': { + name: 'constant.character.escape.ts', + match: '\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\\{[0-9A-Fa-f]+\\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)', + }, + template: { + patterns: [ + { + include: '#template-call', + }, + { + contentName: 'string.template.ts', + begin: '([_$[:alpha:]][_$[:alnum:]]*)?(`)', + beginCaptures: { + '1': { + name: 'entity.name.function.tagged-template.ts', + }, + '2': { + name: 'string.template.ts punctuation.definition.string.template.begin.ts', + }, + }, + end: '`', + endCaptures: { + '0': { + name: 'string.template.ts punctuation.definition.string.template.end.ts', + }, + }, + patterns: [ + { + include: '#template-substitution-element', + }, + { + include: '#string-character-escape', + }, + ], + }, + ], + }, + 'template-call': { + patterns: [ + { + begin: "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)", + end: '(?=`)', + patterns: [ + { + begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))', + end: "(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)", + patterns: [ + { + include: '#support-function-call-identifiers', + }, + { + name: 'entity.name.function.tagged-template.ts', + match: '([_$[:alpha:]][_$[:alnum:]]*)', + }, + ], + }, + { + include: '#type-arguments', + }, + ], + }, + { + begin: "([_$[:alpha:]][_$[:alnum:]]*)?\\s*(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)`)", + beginCaptures: { + '1': { + name: 'entity.name.function.tagged-template.ts', + }, + }, + end: '(?=`)', + patterns: [ + { + include: '#type-arguments', + }, + ], + }, + ], + }, + 'template-substitution-element': { + name: 'meta.template.expression.ts', + begin: '\\$\\{', + beginCaptures: { + '0': { + name: 'punctuation.definition.template-expression.begin.ts', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.template-expression.end.ts', + }, + }, + patterns: [ + { + include: '#expression', + }, + ], + contentName: 'meta.embedded.line.ts', + }, + 'type-string': { + patterns: [ + { + include: '#qstring-single', + }, + { + include: '#qstring-double', + }, + { + include: '#template-type', + }, + ], + }, + 'template-type': { + patterns: [ + { + include: '#template-call', + }, + { + contentName: 'string.template.ts', + begin: '([_$[:alpha:]][_$[:alnum:]]*)?(`)', + beginCaptures: { + '1': { + name: 'entity.name.function.tagged-template.ts', + }, + '2': { + name: 'string.template.ts punctuation.definition.string.template.begin.ts', + }, + }, + end: '`', + endCaptures: { + '0': { + name: 'string.template.ts punctuation.definition.string.template.end.ts', + }, + }, + patterns: [ + { + include: '#template-type-substitution-element', + }, + { + include: '#string-character-escape', + }, + ], + }, + ], + }, + 'template-type-substitution-element': { + name: 'meta.template.expression.ts', + begin: '\\$\\{', + beginCaptures: { + '0': { + name: 'punctuation.definition.template-expression.begin.ts', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.template-expression.end.ts', + }, + }, + patterns: [ + { + include: '#type', + }, + ], + contentName: 'meta.embedded.line.ts', + }, + regex: { + patterns: [ + { + name: 'string.regexp.ts', + begin: '(?|&&|\\|\\||\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[\\()]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\]|\\(([^\\)\\\\]|\\\\.)+\\))+\\/([dgimsuy]+|(?![\\/\\*])|(?=\\/\\*))(?!\\s*[a-zA-Z0-9_$]))', + beginCaptures: { + '1': { + name: 'punctuation.definition.string.begin.ts', + }, + }, + end: '(/)([dgimsuy]*)', + endCaptures: { + '1': { + name: 'punctuation.definition.string.end.ts', + }, + '2': { + name: 'keyword.other.ts', + }, + }, + patterns: [ + { + include: '#regexp', + }, + ], + }, + { + name: 'string.regexp.ts', + begin: '((?', + captures: { + '0': { + name: 'keyword.other.back-reference.regexp', + }, + '1': { + name: 'variable.other.regexp', + }, + }, + }, + { + name: 'keyword.operator.quantifier.regexp', + match: '[?+*]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??', + }, + { + name: 'keyword.operator.or.regexp', + match: '\\|', + }, + { + name: 'meta.group.assertion.regexp', + begin: '(\\()((\\?=)|(\\?!)|(\\?<=)|(\\?))?', + beginCaptures: { + '0': { + name: 'punctuation.definition.group.regexp', + }, + '1': { + name: 'punctuation.definition.group.no-capture.regexp', + }, + '2': { + name: 'variable.other.regexp', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'punctuation.definition.group.regexp', + }, + }, + patterns: [ + { + include: '#regexp', + }, + ], + }, + { + name: 'constant.other.character-class.set.regexp', + begin: '(\\[)(\\^)?', + beginCaptures: { + '1': { + name: 'punctuation.definition.character-class.regexp', + }, + '2': { + name: 'keyword.operator.negation.regexp', + }, + }, + end: '(\\])', + endCaptures: { + '1': { + name: 'punctuation.definition.character-class.regexp', + }, + }, + patterns: [ + { + name: 'constant.other.character-class.range.regexp', + match: '(?:.|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))\\-(?:[^\\]\\\\]|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))', + captures: { + '1': { + name: 'constant.character.numeric.regexp', + }, + '2': { + name: 'constant.character.control.regexp', + }, + '3': { + name: 'constant.character.escape.backslash.regexp', + }, + '4': { + name: 'constant.character.numeric.regexp', + }, + '5': { + name: 'constant.character.control.regexp', + }, + '6': { + name: 'constant.character.escape.backslash.regexp', + }, + }, + }, + { + include: '#regex-character-class', + }, + ], + }, + { + include: '#regex-character-class', + }, + ], + }, + 'regex-character-class': { + patterns: [ + { + name: 'constant.other.character-class.regexp', + match: '\\\\[wWsSdDtrnvf]|\\.', + }, + { + name: 'constant.character.numeric.regexp', + match: '\\\\([0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4})', + }, + { + name: 'constant.character.control.regexp', + match: '\\\\c[A-Z]', + }, + { + name: 'constant.character.escape.backslash.regexp', + match: '\\\\.', + }, + ], + }, + comment: { + patterns: [ + { + name: 'comment.block.documentation.ts', + begin: '/\\*\\*(?!/)', + beginCaptures: { + '0': { + name: 'punctuation.definition.comment.ts', + }, + }, + end: '\\*/', + endCaptures: { + '0': { + name: 'punctuation.definition.comment.ts', + }, + }, + patterns: [ + { + include: '#docblock', + }, + ], + }, + { + name: 'comment.block.ts', + begin: '(/\\*)(?:\\s*((@)internal)(?=\\s|(\\*/)))?', + beginCaptures: { + '1': { + name: 'punctuation.definition.comment.ts', + }, + '2': { + name: 'storage.type.internaldeclaration.ts', + }, + '3': { + name: 'punctuation.decorator.internaldeclaration.ts', + }, + }, + end: '\\*/', + endCaptures: { + '0': { + name: 'punctuation.definition.comment.ts', + }, + }, + }, + { + begin: '(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)', + beginCaptures: { + '1': { + name: 'punctuation.whitespace.comment.leading.ts', + }, + '2': { + name: 'comment.line.double-slash.ts', + }, + '3': { + name: 'punctuation.definition.comment.ts', + }, + '4': { + name: 'storage.type.internaldeclaration.ts', + }, + '5': { + name: 'punctuation.decorator.internaldeclaration.ts', + }, + }, + end: '(?=$)', + contentName: 'comment.line.double-slash.ts', + }, + ], + }, + 'single-line-comment-consuming-line-ending': { + begin: '(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)', + beginCaptures: { + '1': { + name: 'punctuation.whitespace.comment.leading.ts', + }, + '2': { + name: 'comment.line.double-slash.ts', + }, + '3': { + name: 'punctuation.definition.comment.ts', + }, + '4': { + name: 'storage.type.internaldeclaration.ts', + }, + '5': { + name: 'punctuation.decorator.internaldeclaration.ts', + }, + }, + end: '(?=^)', + contentName: 'comment.line.double-slash.ts', + }, + directives: { + name: 'comment.line.triple-slash.directive.ts', + begin: "^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|lib|name|resolution-mode)\\s*=\\s*((\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)))+\\s*/>\\s*$)", + beginCaptures: { + '1': { + name: 'punctuation.definition.comment.ts', + }, + }, + end: '(?=$)', + patterns: [ + { + name: 'meta.tag.ts', + begin: '(<)(reference|amd-dependency|amd-module)', + beginCaptures: { + '1': { + name: 'punctuation.definition.tag.directive.ts', + }, + '2': { + name: 'entity.name.tag.directive.ts', + }, + }, + end: '/>', + endCaptures: { + '0': { + name: 'punctuation.definition.tag.directive.ts', + }, + }, + patterns: [ + { + name: 'entity.other.attribute-name.directive.ts', + match: 'path|types|no-default-lib|lib|name|resolution-mode', + }, + { + name: 'keyword.operator.assignment.ts', + match: '=', + }, + { + include: '#string', + }, + ], + }, + ], + }, + docblock: { + patterns: [ + { + match: '(?x)\n((@)(?:access|api))\n\\s+\n(private|protected|public)\n\\b', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'constant.language.access-type.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)author)\n\\s+\n(\n [^@\\s<>*/]\n (?:[^@<>*/]|\\*[^/])*\n)\n(?:\n \\s*\n (<)\n ([^>\\s]+)\n (>)\n)?', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'entity.name.type.instance.jsdoc', + }, + '4': { + name: 'punctuation.definition.bracket.angle.begin.jsdoc', + }, + '5': { + name: 'constant.other.email.link.underline.jsdoc', + }, + '6': { + name: 'punctuation.definition.bracket.angle.end.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)borrows) \\s+\n((?:[^@\\s*/]|\\*[^/])+) # \n\\s+ (as) \\s+ # as\n((?:[^@\\s*/]|\\*[^/])+) # ', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'entity.name.type.instance.jsdoc', + }, + '4': { + name: 'keyword.operator.control.jsdoc', + }, + '5': { + name: 'entity.name.type.instance.jsdoc', + }, + }, + }, + { + name: 'meta.example.jsdoc', + begin: '((@)example)\\s+', + end: '(?=@|\\*/)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + patterns: [ + { + match: '^\\s\\*\\s+', + }, + { + contentName: 'constant.other.description.jsdoc', + begin: '\\G(<)caption(>)', + beginCaptures: { + '0': { + name: 'entity.name.tag.inline.jsdoc', + }, + '1': { + name: 'punctuation.definition.bracket.angle.begin.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.angle.end.jsdoc', + }, + }, + end: '()|(?=\\*/)', + endCaptures: { + '0': { + name: 'entity.name.tag.inline.jsdoc', + }, + '1': { + name: 'punctuation.definition.bracket.angle.begin.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.angle.end.jsdoc', + }, + }, + }, + { + match: '[^\\s@*](?:[^*]|\\*[^/])*', + captures: { + '0': { + name: 'source.embedded.ts', + }, + }, + }, + ], + }, + { + match: '(?x) ((@)kind) \\s+ (class|constant|event|external|file|function|member|mixin|module|namespace|typedef) \\b', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'constant.language.symbol-type.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)see)\n\\s+\n(?:\n # URL\n (\n (?=https?://)\n (?:[^\\s*]|\\*[^/])+\n )\n |\n # JSDoc namepath\n (\n (?!\n # Avoid matching bare URIs (also acceptable as links)\n https?://\n |\n # Avoid matching {@inline tags}; we match those below\n (?:\\[[^\\[\\]]*\\])? # Possible description [preceding]{@tag}\n {@(?:link|linkcode|linkplain|tutorial)\\b\n )\n # Matched namepath\n (?:[^@\\s*/]|\\*[^/])+\n )\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.link.underline.jsdoc', + }, + '4': { + name: 'entity.name.type.instance.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)template)\n\\s+\n# One or more valid identifiers\n(\n [A-Za-z_$] # First character: non-numeric word character\n [\\w$.\\[\\]]* # Rest of identifier\n (?: # Possible list of additional identifiers\n \\s* , \\s*\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n )*\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + }, + }, + { + begin: '(?x)((@)template)\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + { + name: 'variable.other.jsdoc', + match: '([A-Za-z_$][\\w$.\\[\\]]*)', + }, + ], + }, + { + match: '(?x)\n(\n (@)\n (?:arg|argument|const|constant|member|namespace|param|var)\n)\n\\s+\n(\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + }, + }, + { + begin: '((@)typedef)\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + { + name: 'entity.name.type.instance.jsdoc', + match: '(?:[^@\\s*/]|\\*[^/])+', + }, + ], + }, + { + begin: '((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + { + name: 'variable.other.jsdoc', + match: '([A-Za-z_$][\\w$.\\[\\]]*)', + }, + { + name: 'variable.other.jsdoc', + match: "(?x)\n(\\[)\\s*\n[\\w$]+\n(?:\n (?:\\[\\])? # Foo[ ].bar properties within an array\n \\. # Foo.Bar namespaced parameter\n [\\w$]+\n)*\n(?:\n \\s*\n (=) # [foo=bar] Default parameter value\n \\s*\n (\n # The inner regexes are to stop the match early at */ and to not stop at escaped quotes\n (?>\n \"(?:(?:\\*(?!/))|(?:\\\\(?!\"))|[^*\\\\])*?\" | # [foo=\"bar\"] Double-quoted\n '(?:(?:\\*(?!/))|(?:\\\\(?!'))|[^*\\\\])*?' | # [foo='bar'] Single-quoted\n \\[ (?:(?:\\*(?!/))|[^*])*? \\] | # [foo=[1,2]] Array literal\n (?:(?:\\*(?!/))|\\s(?!\\s*\\])|\\[.*?(?:\\]|(?=\\*/))|[^*\\s\\[\\]])* # Everything else\n )*\n )\n)?\n\\s*(?:(\\])((?:[^*\\s]|\\*[^\\s/])+)?|(?=\\*/))", + captures: { + '1': { + name: 'punctuation.definition.optional-value.begin.bracket.square.jsdoc', + }, + '2': { + name: 'keyword.operator.assignment.jsdoc', + }, + '3': { + name: 'source.embedded.ts', + }, + '4': { + name: 'punctuation.definition.optional-value.end.bracket.square.jsdoc', + }, + '5': { + name: 'invalid.illegal.syntax.jsdoc', + }, + }, + }, + ], + }, + { + begin: '(?x)\n(\n (@)\n (?:define|enum|exception|export|extends|lends|implements|modifies\n |namespace|private|protected|returns?|satisfies|suppress|this|throws|type\n |yields?)\n)\n\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + ], + }, + { + match: '(?x)\n(\n (@)\n (?:alias|augments|callback|constructs|emits|event|fires|exports?\n |extends|external|function|func|host|lends|listens|interface|memberof!?\n |method|module|mixes|mixin|name|requires|see|this|typedef|uses)\n)\n\\s+\n(\n (?:\n [^{}@\\s*] | \\*[^/]\n )+\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'entity.name.type.instance.jsdoc', + }, + }, + }, + { + contentName: 'variable.other.jsdoc', + begin: "((@)(?:default(?:value)?|license|version))\\s+(([''\"]))", + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + '4': { + name: 'punctuation.definition.string.begin.jsdoc', + }, + }, + end: '(\\3)|(?=$|\\*/)', + endCaptures: { + '0': { + name: 'variable.other.jsdoc', + }, + '1': { + name: 'punctuation.definition.string.end.jsdoc', + }, + }, + }, + { + match: '((@)(?:default(?:value)?|license|tutorial|variation|version))\\s+([^\\s*]+)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + }, + }, + { + name: 'storage.type.class.jsdoc', + match: '(?x) (@) (?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles |callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright |default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception |exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func |function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc |inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method |mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects |override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected |public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary |suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation |version|virtual|writeOnce|yields?) \\b', + captures: { + '1': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + }, + { + include: '#inline-tags', + }, + { + match: '((@)(?:[_$[:alpha:]][_$[:alnum:]]*))(?=\\s+)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + }, + ], + }, + brackets: { + patterns: [ + { + begin: '{', + end: '}|(?=\\*/)', + patterns: [ + { + include: '#brackets', + }, + ], + }, + { + begin: '\\[', + end: '\\]|(?=\\*/)', + patterns: [ + { + include: '#brackets', + }, + ], + }, + ], + }, + 'inline-tags': { + patterns: [ + { + name: 'constant.other.description.jsdoc', + match: '(\\[)[^\\]]+(\\])(?={@(?:link|linkcode|linkplain|tutorial))', + captures: { + '1': { + name: 'punctuation.definition.bracket.square.begin.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.square.end.jsdoc', + }, + }, + }, + { + name: 'entity.name.type.instance.jsdoc', + begin: '({)((@)(?:link(?:code|plain)?|tutorial))\\s*', + beginCaptures: { + '1': { + name: 'punctuation.definition.bracket.curly.begin.jsdoc', + }, + '2': { + name: 'storage.type.class.jsdoc', + }, + '3': { + name: 'punctuation.definition.inline.tag.jsdoc', + }, + }, + end: '}|(?=\\*/)', + endCaptures: { + '0': { + name: 'punctuation.definition.bracket.curly.end.jsdoc', + }, + }, + patterns: [ + { + match: '\\G((?=https?://)(?:[^|}\\s*]|\\*[/])+)(\\|)?', + captures: { + '1': { + name: 'variable.other.link.underline.jsdoc', + }, + '2': { + name: 'punctuation.separator.pipe.jsdoc', + }, + }, + }, + { + match: '\\G((?:[^{}@\\s|*]|\\*[^/])+)(\\|)?', + captures: { + '1': { + name: 'variable.other.description.jsdoc', + }, + '2': { + name: 'punctuation.separator.pipe.jsdoc', + }, + }, + }, + ], + }, + ], + }, + jsdoctype: { + patterns: [ + { + contentName: 'entity.name.type.instance.jsdoc', + begin: '\\G({)', + beginCaptures: { + '0': { + name: 'entity.name.type.instance.jsdoc', + }, + '1': { + name: 'punctuation.definition.bracket.curly.begin.jsdoc', + }, + }, + end: '((}))\\s*|(?=\\*/)', + endCaptures: { + '1': { + name: 'entity.name.type.instance.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.curly.end.jsdoc', + }, + }, + patterns: [ + { + include: '#brackets', + }, + ], + }, + ], + }, + }, + }, + grammarLocation: './syntaxes/TypeScript.tmLanguage.json', + injectTo: undefined, + embeddedLanguages: undefined, + tokenTypes: { + 'meta.template.expression': 'other', + 'meta.template.expression string': 'string', + 'meta.template.expression comment': 'comment', + 'entity.name.type.instance.jsdoc': 'other', + 'entity.name.function.tagged-template': 'other', + 'meta.import string.quoted': 'other', + 'variable.other.jsdoc': 'other', + }, + }, + { + language: 'typescriptreact', + scope: 'source.tsx', + format: 'json', + grammar: { + information_for_contributors: [ + 'This file has been converted from https://github.com/microsoft/TypeScript-TmLanguage/blob/master/TypeScriptReact.tmLanguage', + 'If you want to provide a fix or improvement, please create a pull request against the original repository.', + 'Once accepted there, we are happy to receive an update request.', + ], + version: 'https://github.com/microsoft/TypeScript-TmLanguage/commit/0d73d1117e0a9b1d6635ebbe9aa37d615171b02d', + name: 'TypeScriptReact', + scopeName: 'source.tsx', + patterns: [ + { + include: '#directives', + }, + { + include: '#statements', + }, + { + include: '#shebang', + }, + ], + repository: { + shebang: { + name: 'comment.line.shebang.tsx', + match: '\\A(#!).*(?=$)', + captures: { + '1': { + name: 'punctuation.definition.comment.tsx', + }, + }, + }, + statements: { + patterns: [ + { + include: '#declaration', + }, + { + include: '#control-statement', + }, + { + include: '#after-operator-block-as-object-literal', + }, + { + include: '#decl-block', + }, + { + include: '#label', + }, + { + include: '#expression', + }, + { + include: '#punctuation-semicolon', + }, + { + include: '#string', + }, + { + include: '#comment', + }, + ], + }, + declaration: { + patterns: [ + { + include: '#decorator', + }, + { + include: '#var-expr', + }, + { + include: '#function-declaration', + }, + { + include: '#class-declaration', + }, + { + include: '#interface-declaration', + }, + { + include: '#enum-declaration', + }, + { + include: '#namespace-declaration', + }, + { + include: '#type-alias-declaration', + }, + { + include: '#import-equals-declaration', + }, + { + include: '#import-declaration', + }, + { + include: '#export-declaration', + }, + { + name: 'storage.modifier.tsx', + match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + beginCaptures: { + '1': { + name: 'meta.definition.variable.tsx entity.name.function.tsx', + }, + '2': { + name: 'keyword.operator.definiteassignment.tsx', + }, + }, + end: '(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + beginCaptures: { + '1': { + name: 'meta.definition.variable.tsx variable.other.constant.tsx entity.name.function.tsx', + }, + }, + end: '(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '1': { + name: 'storage.modifier.tsx', + }, + '2': { + name: 'keyword.operator.rest.tsx', + }, + '3': { + name: 'entity.name.function.tsx variable.language.this.tsx', + }, + '4': { + name: 'entity.name.function.tsx', + }, + '5': { + name: 'keyword.operator.optional.tsx', + }, + }, + }, + { + match: '(?x)(?:(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '1': { + name: 'meta.definition.property.tsx entity.name.function.tsx', + }, + '2': { + name: 'keyword.operator.optional.tsx', + }, + '3': { + name: 'keyword.operator.definiteassignment.tsx', + }, + }, + }, + { + name: 'meta.definition.property.tsx variable.object.property.tsx', + match: '\\#?[_$[:alpha:]][_$[:alnum:]]*', + }, + { + name: 'keyword.operator.optional.tsx', + match: '\\?', + }, + { + name: 'keyword.operator.definiteassignment.tsx', + match: '\\!', + }, + ], + }, + 'variable-initializer': { + patterns: [ + { + begin: '(?\\s*$)', + beginCaptures: { + '1': { + name: 'keyword.operator.assignment.tsx', + }, + }, + end: '(?=$|^|[,);}\\]]|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])', + beginCaptures: { + '1': { + name: 'storage.modifier.tsx', + }, + '2': { + name: 'storage.modifier.tsx', + }, + '3': { + name: 'storage.modifier.tsx', + }, + '4': { + name: 'storage.modifier.async.tsx', + }, + '5': { + name: 'keyword.operator.new.tsx', + }, + '6': { + name: 'keyword.generator.asterisk.tsx', + }, + }, + end: '(?=\\}|;|,|$)|(?<=\\})', + patterns: [ + { + include: '#method-declaration-name', + }, + { + include: '#function-body', + }, + ], + }, + { + name: 'meta.method.declaration.tsx', + begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + beginCaptures: { + '1': { + name: 'storage.modifier.tsx', + }, + '2': { + name: 'storage.modifier.tsx', + }, + '3': { + name: 'storage.modifier.tsx', + }, + '4': { + name: 'storage.modifier.async.tsx', + }, + '5': { + name: 'storage.type.property.tsx', + }, + '6': { + name: 'keyword.generator.asterisk.tsx', + }, + }, + end: '(?=\\}|;|,|$)|(?<=\\})', + patterns: [ + { + include: '#method-declaration-name', + }, + { + include: '#function-body', + }, + ], + }, + ], + }, + 'object-literal-method-declaration': { + name: 'meta.method.declaration.tsx', + begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + '2': { + name: 'storage.type.property.tsx', + }, + '3': { + name: 'keyword.generator.asterisk.tsx', + }, + }, + end: '(?=\\}|;|,)|(?<=\\})', + patterns: [ + { + include: '#method-declaration-name', + }, + { + include: '#function-body', + }, + { + begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + '2': { + name: 'storage.type.property.tsx', + }, + '3': { + name: 'keyword.generator.asterisk.tsx', + }, + }, + end: '(?=\\(|\\<)', + patterns: [ + { + include: '#method-declaration-name', + }, + ], + }, + ], + }, + 'method-declaration-name': { + begin: "(?x)(?=((\\b(?)', + captures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + '2': { + name: 'variable.parameter.tsx', + }, + }, + }, + { + name: 'meta.arrow.tsx', + begin: "(?x) (?:\n (? is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n )\n)", + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + }, + end: '(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', + patterns: [ + { + include: '#comment', + }, + { + include: '#type-parameters', + }, + { + include: '#function-parameters', + }, + { + include: '#arrow-return-type', + }, + { + include: '#possibly-arrow-return-type', + }, + ], + }, + { + name: 'meta.arrow.tsx', + begin: '=>', + beginCaptures: { + '0': { + name: 'storage.type.function.arrow.tsx', + }, + }, + end: '((?<=\\}|\\S)(?)|((?!\\{)(?=\\S)))(?!\\/[\\/\\*])', + patterns: [ + { + include: '#single-line-comment-consuming-line-ending', + }, + { + include: '#decl-block', + }, + { + include: '#expression', + }, + ], + }, + ], + }, + 'indexer-declaration': { + name: 'meta.indexer.declaration.tsx', + begin: '(?:(?]|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^yield|[^\\._$[:alnum:]]yield|^throw|[^\\._$[:alnum:]]throw|^in|[^\\._$[:alnum:]]in|^of|[^\\._$[:alnum:]]of|^typeof|[^\\._$[:alnum:]]typeof|&&|\\|\\||\\*)\\s*(\\{)', + beginCaptures: { + '1': { + name: 'punctuation.definition.block.tsx', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.block.tsx', + }, + }, + patterns: [ + { + include: '#object-member', + }, + ], + }, + 'object-literal': { + name: 'meta.objectliteral.tsx', + begin: '\\{', + beginCaptures: { + '0': { + name: 'punctuation.definition.block.tsx', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.block.tsx', + }, + }, + patterns: [ + { + include: '#object-member', + }, + ], + }, + 'object-member': { + patterns: [ + { + include: '#comment', + }, + { + include: '#object-literal-method-declaration', + }, + { + name: 'meta.object.member.tsx meta.object-literal.key.tsx', + begin: '(?=\\[)', + end: '(?=:)|((?<=[\\]])(?=\\s*[\\(\\<]))', + patterns: [ + { + include: '#comment', + }, + { + include: '#array-literal', + }, + ], + }, + { + name: 'meta.object.member.tsx meta.object-literal.key.tsx', + begin: "(?=[\\'\\\"\\`])", + end: "(?=:)|((?<=[\\'\\\"\\`])(?=((\\s*[\\(\\<,}])|(\\s+(as|satisifies)\\s+))))", + patterns: [ + { + include: '#comment', + }, + { + include: '#string', + }, + ], + }, + { + name: 'meta.object.member.tsx meta.object-literal.key.tsx', + begin: '(?x)(?=(\\b(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '0': { + name: 'meta.object-literal.key.tsx', + }, + '1': { + name: 'entity.name.function.tsx', + }, + }, + }, + { + name: 'meta.object.member.tsx', + match: '(?:[_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:)', + captures: { + '0': { + name: 'meta.object-literal.key.tsx', + }, + }, + }, + { + name: 'meta.object.member.tsx', + begin: '\\.\\.\\.', + beginCaptures: { + '0': { + name: 'keyword.operator.spread.tsx', + }, + }, + end: '(?=,|\\})', + patterns: [ + { + include: '#expression', + }, + ], + }, + { + name: 'meta.object.member.tsx', + match: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=,|\\}|$|\\/\\/|\\/\\*)', + captures: { + '1': { + name: 'variable.other.readwrite.tsx', + }, + }, + }, + { + name: 'meta.object.member.tsx', + match: '(?]|\\|\\||\\&\\&|\\!\\=\\=|$|^|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + }, + end: '(?<=\\))', + patterns: [ + { + include: '#type-parameters', + }, + { + begin: '\\(', + beginCaptures: { + '0': { + name: 'meta.brace.round.tsx', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.tsx', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + ], + }, + { + begin: '(?<=:)\\s*(async)?\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + '2': { + name: 'meta.brace.round.tsx', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.tsx', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + { + begin: '(?<=:)\\s*(async)?\\s*(?=\\<\\s*$)', + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + }, + end: '(?<=\\>)', + patterns: [ + { + include: '#type-parameters', + }, + ], + }, + { + begin: '(?<=\\>)\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'meta.brace.round.tsx', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.tsx', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + { + include: '#possibly-arrow-return-type', + }, + { + include: '#expression', + }, + ], + }, + { + include: '#punctuation-comma', + }, + { + include: '#decl-block', + }, + ], + }, + 'ternary-expression': { + begin: '(?!\\?\\.\\s*[^[:digit:]])(\\?)(?!\\?)', + beginCaptures: { + '1': { + name: 'keyword.operator.ternary.tsx', + }, + }, + end: '\\s*(:)', + endCaptures: { + '1': { + name: 'keyword.operator.ternary.tsx', + }, + }, + patterns: [ + { + include: '#expression', + }, + ], + }, + 'function-call': { + patterns: [ + { + begin: "(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", + end: "(?<=\\))(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", + patterns: [ + { + name: 'meta.function-call.tsx', + begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))', + end: "(?=\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", + patterns: [ + { + include: '#function-call-target', + }, + ], + }, + { + include: '#comment', + }, + { + include: '#function-call-optionals', + }, + { + include: '#type-arguments', + }, + { + include: '#paren-expression', + }, + ], + }, + { + begin: '(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))(<\\s*[\\{\\[\\(]\\s*$))', + end: '(?<=\\>)(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))(<\\s*[\\{\\[\\(]\\s*$))', + patterns: [ + { + name: 'meta.function-call.tsx', + begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))', + end: '(?=(<\\s*[\\{\\[\\(]\\s*$))', + patterns: [ + { + include: '#function-call-target', + }, + ], + }, + { + include: '#comment', + }, + { + include: '#function-call-optionals', + }, + { + include: '#type-arguments', + }, + ], + }, + ], + }, + 'function-call-target': { + patterns: [ + { + include: '#support-function-call-identifiers', + }, + { + name: 'entity.name.function.tsx', + match: '(\\#?[_$[:alpha:]][_$[:alnum:]]*)', + }, + ], + }, + 'function-call-optionals': { + patterns: [ + { + name: 'meta.function-call.tsx punctuation.accessor.optional.tsx', + match: '\\?\\.', + }, + { + name: 'meta.function-call.tsx keyword.operator.definiteassignment.tsx', + match: '\\!', + }, + ], + }, + 'support-function-call-identifiers': { + patterns: [ + { + include: '#literal', + }, + { + include: '#support-objects', + }, + { + include: '#object-identifiers', + }, + { + include: '#punctuation-accessor', + }, + { + name: 'keyword.operator.expression.import.tsx', + match: "(?:(?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|(===|!==|==|!=)|(([\\&\\~\\^\\|]\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s+instanceof(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + }, + end: '(?<=\\))', + patterns: [ + { + include: '#paren-expression-possibly-arrow-with-typeparameters', + }, + ], + }, + { + begin: '(?<=[(=,]|=>|^return|[^\\._$[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\()|(<)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)))\\s*$)', + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + }, + end: '(?<=\\))', + patterns: [ + { + include: '#paren-expression-possibly-arrow-with-typeparameters', + }, + ], + }, + { + include: '#possibly-arrow-return-type', + }, + ], + }, + 'paren-expression-possibly-arrow-with-typeparameters': { + patterns: [ + { + include: '#type-parameters', + }, + { + begin: '\\(', + beginCaptures: { + '0': { + name: 'meta.brace.round.tsx', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.tsx', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + ], + }, + 'expression-inside-possibly-arrow-parens': { + patterns: [ + { + include: '#expressionWithoutIdentifiers', + }, + { + include: '#comment', + }, + { + include: '#string', + }, + { + include: '#decorator', + }, + { + include: '#destructuring-parameter', + }, + { + match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '1': { + name: 'storage.modifier.tsx', + }, + '2': { + name: 'keyword.operator.rest.tsx', + }, + '3': { + name: 'entity.name.function.tsx variable.language.this.tsx', + }, + '4': { + name: 'entity.name.function.tsx', + }, + '5': { + name: 'keyword.operator.optional.tsx', + }, + }, + }, + { + match: '(?x)(?:(?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?>=|>>>=|\\|=', + }, + { + name: 'keyword.operator.bitwise.shift.tsx', + match: '<<|>>>|>>', + }, + { + name: 'keyword.operator.comparison.tsx', + match: '===|!==|==|!=', + }, + { + name: 'keyword.operator.relational.tsx', + match: '<=|>=|<>|<|>', + }, + { + match: '(?<=[_$[:alnum:]])(\\!)\\s*(?:(/=)|(?:(/)(?![/*])))', + captures: { + '1': { + name: 'keyword.operator.logical.tsx', + }, + '2': { + name: 'keyword.operator.assignment.compound.tsx', + }, + '3': { + name: 'keyword.operator.arithmetic.tsx', + }, + }, + }, + { + name: 'keyword.operator.logical.tsx', + match: '\\!|&&|\\|\\||\\?\\?', + }, + { + name: 'keyword.operator.bitwise.tsx', + match: '\\&|~|\\^|\\|', + }, + { + name: 'keyword.operator.assignment.tsx', + match: '\\=', + }, + { + name: 'keyword.operator.decrement.tsx', + match: '--', + }, + { + name: 'keyword.operator.increment.tsx', + match: '\\+\\+', + }, + { + name: 'keyword.operator.arithmetic.tsx', + match: '%|\\*|/|-|\\+', + }, + { + begin: '(?<=[_$[:alnum:])\\]])\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)+(?:(/=)|(?:(/)(?![/*]))))', + end: '(?:(/=)|(?:(/)(?!\\*([^\\*]|(\\*[^\\/]))*\\*\\/)))', + endCaptures: { + '1': { + name: 'keyword.operator.assignment.compound.tsx', + }, + '2': { + name: 'keyword.operator.arithmetic.tsx', + }, + }, + patterns: [ + { + include: '#comment', + }, + ], + }, + { + match: '(?<=[_$[:alnum:])\\]])\\s*(?:(/=)|(?:(/)(?![/*])))', + captures: { + '1': { + name: 'keyword.operator.assignment.compound.tsx', + }, + '2': { + name: 'keyword.operator.arithmetic.tsx', + }, + }, + }, + ], + }, + 'typeof-operator': { + begin: '(?:&|{\\?]|(extends\\s+)|$|;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))', + patterns: [ + { + include: '#type-arguments', + }, + { + include: '#expression', + }, + ], + }, + literal: { + patterns: [ + { + include: '#numeric-literal', + }, + { + include: '#boolean-literal', + }, + { + include: '#null-literal', + }, + { + include: '#undefined-literal', + }, + { + include: '#numericConstant-literal', + }, + { + include: '#array-literal', + }, + { + include: '#this-literal', + }, + { + include: '#super-literal', + }, + ], + }, + 'array-literal': { + name: 'meta.array.literal.tsx', + begin: '\\s*(\\[)', + beginCaptures: { + '1': { + name: 'meta.brace.square.tsx', + }, + }, + end: '\\]', + endCaptures: { + '0': { + name: 'meta.brace.square.tsx', + }, + }, + patterns: [ + { + include: '#expression', + }, + { + include: '#punctuation-comma', + }, + ], + }, + 'numeric-literal': { + patterns: [ + { + name: 'constant.numeric.hex.tsx', + match: '\\b(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\\())\n |\n (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$)))', + captures: { + '1': { + name: 'punctuation.accessor.tsx', + }, + '2': { + name: 'punctuation.accessor.optional.tsx', + }, + '3': { + name: 'support.variable.property.tsx', + }, + '4': { + name: 'support.constant.tsx', + }, + }, + }, + { + match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n))", + captures: { + '1': { + name: 'punctuation.accessor.tsx', + }, + '2': { + name: 'punctuation.accessor.optional.tsx', + }, + '3': { + name: 'entity.name.function.tsx', + }, + }, + }, + { + match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])', + captures: { + '1': { + name: 'punctuation.accessor.tsx', + }, + '2': { + name: 'punctuation.accessor.optional.tsx', + }, + '3': { + name: 'variable.other.constant.property.tsx', + }, + }, + }, + { + match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*)', + captures: { + '1': { + name: 'punctuation.accessor.tsx', + }, + '2': { + name: 'punctuation.accessor.optional.tsx', + }, + '3': { + name: 'variable.other.property.tsx', + }, + }, + }, + { + name: 'variable.other.constant.tsx', + match: '([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])', + }, + { + name: 'variable.other.readwrite.tsx', + match: '[_$[:alpha:]][_$[:alnum:]]*', + }, + ], + }, + 'object-identifiers': { + patterns: [ + { + name: 'support.class.tsx', + match: '([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\??\\.\\s*prototype\\b(?!\\$))', + }, + { + match: '(?x)(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n (\\#?[[:upper:]][_$[:digit:][:upper:]]*) |\n (\\#?[_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)', + captures: { + '1': { + name: 'punctuation.accessor.tsx', + }, + '2': { + name: 'punctuation.accessor.optional.tsx', + }, + '3': { + name: 'variable.other.constant.object.property.tsx', + }, + '4': { + name: 'variable.other.object.property.tsx', + }, + }, + }, + { + match: '(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)', + captures: { + '1': { + name: 'variable.other.constant.object.tsx', + }, + '2': { + name: 'variable.other.object.tsx', + }, + }, + }, + ], + }, + 'type-annotation': { + patterns: [ + { + name: 'meta.type.annotation.tsx', + begin: '(:)(?=\\s*\\S)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.tsx', + }, + }, + end: '(?])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))', + patterns: [ + { + include: '#type', + }, + ], + }, + { + name: 'meta.type.annotation.tsx', + begin: '(:)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.tsx', + }, + }, + end: '(?])|(?=^\\s*$)|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))', + patterns: [ + { + include: '#type', + }, + ], + }, + ], + }, + 'parameter-type-annotation': { + patterns: [ + { + name: 'meta.type.annotation.tsx', + begin: '(:)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.tsx', + }, + }, + end: '(?=[,)])|(?==[^>])', + patterns: [ + { + include: '#type', + }, + ], + }, + ], + }, + 'return-type': { + patterns: [ + { + name: 'meta.return.type.tsx', + begin: '(?<=\\))\\s*(:)(?=\\s*\\S)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.tsx', + }, + }, + end: '(?|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', + patterns: [ + { + include: '#arrow-return-type-body', + }, + ], + }, + 'possibly-arrow-return-type': { + begin: '(?<=\\)|^)\\s*(:)(?=\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*=>)', + beginCaptures: { + '1': { + name: 'meta.arrow.tsx meta.return.type.arrow.tsx keyword.operator.type.annotation.tsx', + }, + }, + end: '(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', + contentName: 'meta.arrow.tsx meta.return.type.arrow.tsx', + patterns: [ + { + include: '#arrow-return-type-body', + }, + ], + }, + 'arrow-return-type-body': { + patterns: [ + { + begin: '(?<=[:])(?=\\s*\\{)', + end: '(?<=\\})', + patterns: [ + { + include: '#type-object', + }, + ], + }, + { + include: '#type-predicate-operator', + }, + { + include: '#type', + }, + ], + }, + 'type-parameters': { + name: 'meta.type.parameters.tsx', + begin: '(<)', + beginCaptures: { + '1': { + name: 'punctuation.definition.typeparameters.begin.tsx', + }, + }, + end: '(>)', + endCaptures: { + '1': { + name: 'punctuation.definition.typeparameters.end.tsx', + }, + }, + patterns: [ + { + include: '#comment', + }, + { + name: 'storage.modifier.tsx', + match: '(?)', + }, + ], + }, + 'type-arguments': { + name: 'meta.type.parameters.tsx', + begin: '\\<', + beginCaptures: { + '0': { + name: 'punctuation.definition.typeparameters.begin.tsx', + }, + }, + end: '\\>', + endCaptures: { + '0': { + name: 'punctuation.definition.typeparameters.end.tsx', + }, + }, + patterns: [ + { + include: '#type-arguments-body', + }, + ], + }, + 'type-arguments-body': { + patterns: [ + { + match: '(?)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))))', + captures: { + '1': { + name: 'storage.modifier.tsx', + }, + '2': { + name: 'keyword.operator.rest.tsx', + }, + '3': { + name: 'entity.name.function.tsx variable.language.this.tsx', + }, + '4': { + name: 'entity.name.function.tsx', + }, + '5': { + name: 'keyword.operator.optional.tsx', + }, + }, + }, + { + match: '(?x)(?:(?)', + patterns: [ + { + include: '#comment', + }, + { + include: '#type-parameters', + }, + ], + }, + { + name: 'meta.type.constructor.tsx', + begin: '(?)\n ))\n )\n )\n)', + end: '(?<=\\))', + patterns: [ + { + include: '#function-parameters', + }, + ], + }, + ], + }, + 'type-function-return-type': { + patterns: [ + { + name: 'meta.type.function.return.tsx', + begin: '(=>)(?=\\s*\\S)', + beginCaptures: { + '1': { + name: 'storage.type.function.arrow.tsx', + }, + }, + end: '(?)(?:\\?]|//|$)', + patterns: [ + { + include: '#type-function-return-type-core', + }, + ], + }, + { + name: 'meta.type.function.return.tsx', + begin: '=>', + beginCaptures: { + '0': { + name: 'storage.type.function.arrow.tsx', + }, + }, + end: '(?)(?]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))', + patterns: [ + { + include: '#type-function-return-type-core', + }, + ], + }, + ], + }, + 'type-function-return-type-core': { + patterns: [ + { + include: '#comment', + }, + { + begin: '(?<==>)(?=\\s*\\{)', + end: '(?<=\\})', + patterns: [ + { + include: '#type-object', + }, + ], + }, + { + include: '#type-predicate-operator', + }, + { + include: '#type', + }, + ], + }, + 'type-operators': { + patterns: [ + { + include: '#typeof-operator', + }, + { + include: '#type-infer', + }, + { + begin: '([&|])(?=\\s*\\{)', + beginCaptures: { + '0': { + name: 'keyword.operator.type.tsx', + }, + }, + end: '(?<=\\})', + patterns: [ + { + include: '#type-object', + }, + ], + }, + { + begin: '[&|]', + beginCaptures: { + '0': { + name: 'keyword.operator.type.tsx', + }, + }, + end: '(?=\\S)', + }, + { + name: 'keyword.operator.expression.keyof.tsx', + match: '(?)', + endCaptures: { + '1': { + name: 'meta.type.parameters.tsx punctuation.definition.typeparameters.end.tsx', + }, + }, + contentName: 'meta.type.parameters.tsx', + patterns: [ + { + include: '#type-arguments-body', + }, + ], + }, + { + begin: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(<)', + beginCaptures: { + '1': { + name: 'entity.name.type.tsx', + }, + '2': { + name: 'meta.type.parameters.tsx punctuation.definition.typeparameters.begin.tsx', + }, + }, + end: '(>)', + endCaptures: { + '1': { + name: 'meta.type.parameters.tsx punctuation.definition.typeparameters.end.tsx', + }, + }, + contentName: 'meta.type.parameters.tsx', + patterns: [ + { + include: '#type-arguments-body', + }, + ], + }, + { + match: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))', + captures: { + '1': { + name: 'entity.name.type.module.tsx', + }, + '2': { + name: 'punctuation.accessor.tsx', + }, + '3': { + name: 'punctuation.accessor.optional.tsx', + }, + }, + }, + { + name: 'entity.name.type.tsx', + match: '[_$[:alpha:]][_$[:alnum:]]*', + }, + ], + }, + 'punctuation-comma': { + name: 'punctuation.separator.comma.tsx', + match: ',', + }, + 'punctuation-semicolon': { + name: 'punctuation.terminator.statement.tsx', + match: ';', + }, + 'punctuation-accessor': { + match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))', + captures: { + '1': { + name: 'punctuation.accessor.tsx', + }, + '2': { + name: 'punctuation.accessor.optional.tsx', + }, + }, + }, + string: { + patterns: [ + { + include: '#qstring-single', + }, + { + include: '#qstring-double', + }, + { + include: '#template', + }, + ], + }, + 'qstring-double': { + name: 'string.quoted.double.tsx', + begin: '"', + beginCaptures: { + '0': { + name: 'punctuation.definition.string.begin.tsx', + }, + }, + end: '(")|((?:[^\\\\\\n])$)', + endCaptures: { + '1': { + name: 'punctuation.definition.string.end.tsx', + }, + '2': { + name: 'invalid.illegal.newline.tsx', + }, + }, + patterns: [ + { + include: '#string-character-escape', + }, + ], + }, + 'qstring-single': { + name: 'string.quoted.single.tsx', + begin: "'", + beginCaptures: { + '0': { + name: 'punctuation.definition.string.begin.tsx', + }, + }, + end: "(\\')|((?:[^\\\\\\n])$)", + endCaptures: { + '1': { + name: 'punctuation.definition.string.end.tsx', + }, + '2': { + name: 'invalid.illegal.newline.tsx', + }, + }, + patterns: [ + { + include: '#string-character-escape', + }, + ], + }, + 'string-character-escape': { + name: 'constant.character.escape.tsx', + match: '\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\\{[0-9A-Fa-f]+\\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)', + }, + template: { + patterns: [ + { + include: '#template-call', + }, + { + contentName: 'string.template.tsx', + begin: '([_$[:alpha:]][_$[:alnum:]]*)?(`)', + beginCaptures: { + '1': { + name: 'entity.name.function.tagged-template.tsx', + }, + '2': { + name: 'string.template.tsx punctuation.definition.string.template.begin.tsx', + }, + }, + end: '`', + endCaptures: { + '0': { + name: 'string.template.tsx punctuation.definition.string.template.end.tsx', + }, + }, + patterns: [ + { + include: '#template-substitution-element', + }, + { + include: '#string-character-escape', + }, + ], + }, + ], + }, + 'template-call': { + patterns: [ + { + begin: "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)", + end: '(?=`)', + patterns: [ + { + begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))', + end: "(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)", + patterns: [ + { + include: '#support-function-call-identifiers', + }, + { + name: 'entity.name.function.tagged-template.tsx', + match: '([_$[:alpha:]][_$[:alnum:]]*)', + }, + ], + }, + { + include: '#type-arguments', + }, + ], + }, + { + begin: "([_$[:alpha:]][_$[:alnum:]]*)?\\s*(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)`)", + beginCaptures: { + '1': { + name: 'entity.name.function.tagged-template.tsx', + }, + }, + end: '(?=`)', + patterns: [ + { + include: '#type-arguments', + }, + ], + }, + ], + }, + 'template-substitution-element': { + name: 'meta.template.expression.tsx', + begin: '\\$\\{', + beginCaptures: { + '0': { + name: 'punctuation.definition.template-expression.begin.tsx', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.template-expression.end.tsx', + }, + }, + patterns: [ + { + include: '#expression', + }, + ], + contentName: 'meta.embedded.line.tsx', + }, + 'type-string': { + patterns: [ + { + include: '#qstring-single', + }, + { + include: '#qstring-double', + }, + { + include: '#template-type', + }, + ], + }, + 'template-type': { + patterns: [ + { + include: '#template-call', + }, + { + contentName: 'string.template.tsx', + begin: '([_$[:alpha:]][_$[:alnum:]]*)?(`)', + beginCaptures: { + '1': { + name: 'entity.name.function.tagged-template.tsx', + }, + '2': { + name: 'string.template.tsx punctuation.definition.string.template.begin.tsx', + }, + }, + end: '`', + endCaptures: { + '0': { + name: 'string.template.tsx punctuation.definition.string.template.end.tsx', + }, + }, + patterns: [ + { + include: '#template-type-substitution-element', + }, + { + include: '#string-character-escape', + }, + ], + }, + ], + }, + 'template-type-substitution-element': { + name: 'meta.template.expression.tsx', + begin: '\\$\\{', + beginCaptures: { + '0': { + name: 'punctuation.definition.template-expression.begin.tsx', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.template-expression.end.tsx', + }, + }, + patterns: [ + { + include: '#type', + }, + ], + contentName: 'meta.embedded.line.tsx', + }, + regex: { + patterns: [ + { + name: 'string.regexp.tsx', + begin: '(?|&&|\\|\\||\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[\\()]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\]|\\(([^\\)\\\\]|\\\\.)+\\))+\\/([dgimsuy]+|(?![\\/\\*])|(?=\\/\\*))(?!\\s*[a-zA-Z0-9_$]))', + beginCaptures: { + '1': { + name: 'punctuation.definition.string.begin.tsx', + }, + }, + end: '(/)([dgimsuy]*)', + endCaptures: { + '1': { + name: 'punctuation.definition.string.end.tsx', + }, + '2': { + name: 'keyword.other.tsx', + }, + }, + patterns: [ + { + include: '#regexp', + }, + ], + }, + { + name: 'string.regexp.tsx', + begin: '((?', + captures: { + '0': { + name: 'keyword.other.back-reference.regexp', + }, + '1': { + name: 'variable.other.regexp', + }, + }, + }, + { + name: 'keyword.operator.quantifier.regexp', + match: '[?+*]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??', + }, + { + name: 'keyword.operator.or.regexp', + match: '\\|', + }, + { + name: 'meta.group.assertion.regexp', + begin: '(\\()((\\?=)|(\\?!)|(\\?<=)|(\\?))?', + beginCaptures: { + '0': { + name: 'punctuation.definition.group.regexp', + }, + '1': { + name: 'punctuation.definition.group.no-capture.regexp', + }, + '2': { + name: 'variable.other.regexp', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'punctuation.definition.group.regexp', + }, + }, + patterns: [ + { + include: '#regexp', + }, + ], + }, + { + name: 'constant.other.character-class.set.regexp', + begin: '(\\[)(\\^)?', + beginCaptures: { + '1': { + name: 'punctuation.definition.character-class.regexp', + }, + '2': { + name: 'keyword.operator.negation.regexp', + }, + }, + end: '(\\])', + endCaptures: { + '1': { + name: 'punctuation.definition.character-class.regexp', + }, + }, + patterns: [ + { + name: 'constant.other.character-class.range.regexp', + match: '(?:.|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))\\-(?:[^\\]\\\\]|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))', + captures: { + '1': { + name: 'constant.character.numeric.regexp', + }, + '2': { + name: 'constant.character.control.regexp', + }, + '3': { + name: 'constant.character.escape.backslash.regexp', + }, + '4': { + name: 'constant.character.numeric.regexp', + }, + '5': { + name: 'constant.character.control.regexp', + }, + '6': { + name: 'constant.character.escape.backslash.regexp', + }, + }, + }, + { + include: '#regex-character-class', + }, + ], + }, + { + include: '#regex-character-class', + }, + ], + }, + 'regex-character-class': { + patterns: [ + { + name: 'constant.other.character-class.regexp', + match: '\\\\[wWsSdDtrnvf]|\\.', + }, + { + name: 'constant.character.numeric.regexp', + match: '\\\\([0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4})', + }, + { + name: 'constant.character.control.regexp', + match: '\\\\c[A-Z]', + }, + { + name: 'constant.character.escape.backslash.regexp', + match: '\\\\.', + }, + ], + }, + comment: { + patterns: [ + { + name: 'comment.block.documentation.tsx', + begin: '/\\*\\*(?!/)', + beginCaptures: { + '0': { + name: 'punctuation.definition.comment.tsx', + }, + }, + end: '\\*/', + endCaptures: { + '0': { + name: 'punctuation.definition.comment.tsx', + }, + }, + patterns: [ + { + include: '#docblock', + }, + ], + }, + { + name: 'comment.block.tsx', + begin: '(/\\*)(?:\\s*((@)internal)(?=\\s|(\\*/)))?', + beginCaptures: { + '1': { + name: 'punctuation.definition.comment.tsx', + }, + '2': { + name: 'storage.type.internaldeclaration.tsx', + }, + '3': { + name: 'punctuation.decorator.internaldeclaration.tsx', + }, + }, + end: '\\*/', + endCaptures: { + '0': { + name: 'punctuation.definition.comment.tsx', + }, + }, + }, + { + begin: '(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)', + beginCaptures: { + '1': { + name: 'punctuation.whitespace.comment.leading.tsx', + }, + '2': { + name: 'comment.line.double-slash.tsx', + }, + '3': { + name: 'punctuation.definition.comment.tsx', + }, + '4': { + name: 'storage.type.internaldeclaration.tsx', + }, + '5': { + name: 'punctuation.decorator.internaldeclaration.tsx', + }, + }, + end: '(?=$)', + contentName: 'comment.line.double-slash.tsx', + }, + ], + }, + 'single-line-comment-consuming-line-ending': { + begin: '(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)', + beginCaptures: { + '1': { + name: 'punctuation.whitespace.comment.leading.tsx', + }, + '2': { + name: 'comment.line.double-slash.tsx', + }, + '3': { + name: 'punctuation.definition.comment.tsx', + }, + '4': { + name: 'storage.type.internaldeclaration.tsx', + }, + '5': { + name: 'punctuation.decorator.internaldeclaration.tsx', + }, + }, + end: '(?=^)', + contentName: 'comment.line.double-slash.tsx', + }, + directives: { + name: 'comment.line.triple-slash.directive.tsx', + begin: "^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|lib|name|resolution-mode)\\s*=\\s*((\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)))+\\s*/>\\s*$)", + beginCaptures: { + '1': { + name: 'punctuation.definition.comment.tsx', + }, + }, + end: '(?=$)', + patterns: [ + { + name: 'meta.tag.tsx', + begin: '(<)(reference|amd-dependency|amd-module)', + beginCaptures: { + '1': { + name: 'punctuation.definition.tag.directive.tsx', + }, + '2': { + name: 'entity.name.tag.directive.tsx', + }, + }, + end: '/>', + endCaptures: { + '0': { + name: 'punctuation.definition.tag.directive.tsx', + }, + }, + patterns: [ + { + name: 'entity.other.attribute-name.directive.tsx', + match: 'path|types|no-default-lib|lib|name|resolution-mode', + }, + { + name: 'keyword.operator.assignment.tsx', + match: '=', + }, + { + include: '#string', + }, + ], + }, + ], + }, + docblock: { + patterns: [ + { + match: '(?x)\n((@)(?:access|api))\n\\s+\n(private|protected|public)\n\\b', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'constant.language.access-type.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)author)\n\\s+\n(\n [^@\\s<>*/]\n (?:[^@<>*/]|\\*[^/])*\n)\n(?:\n \\s*\n (<)\n ([^>\\s]+)\n (>)\n)?', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'entity.name.type.instance.jsdoc', + }, + '4': { + name: 'punctuation.definition.bracket.angle.begin.jsdoc', + }, + '5': { + name: 'constant.other.email.link.underline.jsdoc', + }, + '6': { + name: 'punctuation.definition.bracket.angle.end.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)borrows) \\s+\n((?:[^@\\s*/]|\\*[^/])+) # \n\\s+ (as) \\s+ # as\n((?:[^@\\s*/]|\\*[^/])+) # ', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'entity.name.type.instance.jsdoc', + }, + '4': { + name: 'keyword.operator.control.jsdoc', + }, + '5': { + name: 'entity.name.type.instance.jsdoc', + }, + }, + }, + { + name: 'meta.example.jsdoc', + begin: '((@)example)\\s+', + end: '(?=@|\\*/)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + patterns: [ + { + match: '^\\s\\*\\s+', + }, + { + contentName: 'constant.other.description.jsdoc', + begin: '\\G(<)caption(>)', + beginCaptures: { + '0': { + name: 'entity.name.tag.inline.jsdoc', + }, + '1': { + name: 'punctuation.definition.bracket.angle.begin.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.angle.end.jsdoc', + }, + }, + end: '()|(?=\\*/)', + endCaptures: { + '0': { + name: 'entity.name.tag.inline.jsdoc', + }, + '1': { + name: 'punctuation.definition.bracket.angle.begin.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.angle.end.jsdoc', + }, + }, + }, + { + match: '[^\\s@*](?:[^*]|\\*[^/])*', + captures: { + '0': { + name: 'source.embedded.tsx', + }, + }, + }, + ], + }, + { + match: '(?x) ((@)kind) \\s+ (class|constant|event|external|file|function|member|mixin|module|namespace|typedef) \\b', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'constant.language.symbol-type.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)see)\n\\s+\n(?:\n # URL\n (\n (?=https?://)\n (?:[^\\s*]|\\*[^/])+\n )\n |\n # JSDoc namepath\n (\n (?!\n # Avoid matching bare URIs (also acceptable as links)\n https?://\n |\n # Avoid matching {@inline tags}; we match those below\n (?:\\[[^\\[\\]]*\\])? # Possible description [preceding]{@tag}\n {@(?:link|linkcode|linkplain|tutorial)\\b\n )\n # Matched namepath\n (?:[^@\\s*/]|\\*[^/])+\n )\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.link.underline.jsdoc', + }, + '4': { + name: 'entity.name.type.instance.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)template)\n\\s+\n# One or more valid identifiers\n(\n [A-Za-z_$] # First character: non-numeric word character\n [\\w$.\\[\\]]* # Rest of identifier\n (?: # Possible list of additional identifiers\n \\s* , \\s*\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n )*\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + }, + }, + { + begin: '(?x)((@)template)\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + { + name: 'variable.other.jsdoc', + match: '([A-Za-z_$][\\w$.\\[\\]]*)', + }, + ], + }, + { + match: '(?x)\n(\n (@)\n (?:arg|argument|const|constant|member|namespace|param|var)\n)\n\\s+\n(\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + }, + }, + { + begin: '((@)typedef)\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + { + name: 'entity.name.type.instance.jsdoc', + match: '(?:[^@\\s*/]|\\*[^/])+', + }, + ], + }, + { + begin: '((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + { + name: 'variable.other.jsdoc', + match: '([A-Za-z_$][\\w$.\\[\\]]*)', + }, + { + name: 'variable.other.jsdoc', + match: "(?x)\n(\\[)\\s*\n[\\w$]+\n(?:\n (?:\\[\\])? # Foo[ ].bar properties within an array\n \\. # Foo.Bar namespaced parameter\n [\\w$]+\n)*\n(?:\n \\s*\n (=) # [foo=bar] Default parameter value\n \\s*\n (\n # The inner regexes are to stop the match early at */ and to not stop at escaped quotes\n (?>\n \"(?:(?:\\*(?!/))|(?:\\\\(?!\"))|[^*\\\\])*?\" | # [foo=\"bar\"] Double-quoted\n '(?:(?:\\*(?!/))|(?:\\\\(?!'))|[^*\\\\])*?' | # [foo='bar'] Single-quoted\n \\[ (?:(?:\\*(?!/))|[^*])*? \\] | # [foo=[1,2]] Array literal\n (?:(?:\\*(?!/))|\\s(?!\\s*\\])|\\[.*?(?:\\]|(?=\\*/))|[^*\\s\\[\\]])* # Everything else\n )*\n )\n)?\n\\s*(?:(\\])((?:[^*\\s]|\\*[^\\s/])+)?|(?=\\*/))", + captures: { + '1': { + name: 'punctuation.definition.optional-value.begin.bracket.square.jsdoc', + }, + '2': { + name: 'keyword.operator.assignment.jsdoc', + }, + '3': { + name: 'source.embedded.tsx', + }, + '4': { + name: 'punctuation.definition.optional-value.end.bracket.square.jsdoc', + }, + '5': { + name: 'invalid.illegal.syntax.jsdoc', + }, + }, + }, + ], + }, + { + begin: '(?x)\n(\n (@)\n (?:define|enum|exception|export|extends|lends|implements|modifies\n |namespace|private|protected|returns?|satisfies|suppress|this|throws|type\n |yields?)\n)\n\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + ], + }, + { + match: '(?x)\n(\n (@)\n (?:alias|augments|callback|constructs|emits|event|fires|exports?\n |extends|external|function|func|host|lends|listens|interface|memberof!?\n |method|module|mixes|mixin|name|requires|see|this|typedef|uses)\n)\n\\s+\n(\n (?:\n [^{}@\\s*] | \\*[^/]\n )+\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'entity.name.type.instance.jsdoc', + }, + }, + }, + { + contentName: 'variable.other.jsdoc', + begin: "((@)(?:default(?:value)?|license|version))\\s+(([''\"]))", + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + '4': { + name: 'punctuation.definition.string.begin.jsdoc', + }, + }, + end: '(\\3)|(?=$|\\*/)', + endCaptures: { + '0': { + name: 'variable.other.jsdoc', + }, + '1': { + name: 'punctuation.definition.string.end.jsdoc', + }, + }, + }, + { + match: '((@)(?:default(?:value)?|license|tutorial|variation|version))\\s+([^\\s*]+)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + }, + }, + { + name: 'storage.type.class.jsdoc', + match: '(?x) (@) (?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles |callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright |default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception |exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func |function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc |inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method |mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects |override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected |public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary |suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation |version|virtual|writeOnce|yields?) \\b', + captures: { + '1': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + }, + { + include: '#inline-tags', + }, + { + match: '((@)(?:[_$[:alpha:]][_$[:alnum:]]*))(?=\\s+)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + }, + ], + }, + brackets: { + patterns: [ + { + begin: '{', + end: '}|(?=\\*/)', + patterns: [ + { + include: '#brackets', + }, + ], + }, + { + begin: '\\[', + end: '\\]|(?=\\*/)', + patterns: [ + { + include: '#brackets', + }, + ], + }, + ], + }, + 'inline-tags': { + patterns: [ + { + name: 'constant.other.description.jsdoc', + match: '(\\[)[^\\]]+(\\])(?={@(?:link|linkcode|linkplain|tutorial))', + captures: { + '1': { + name: 'punctuation.definition.bracket.square.begin.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.square.end.jsdoc', + }, + }, + }, + { + name: 'entity.name.type.instance.jsdoc', + begin: '({)((@)(?:link(?:code|plain)?|tutorial))\\s*', + beginCaptures: { + '1': { + name: 'punctuation.definition.bracket.curly.begin.jsdoc', + }, + '2': { + name: 'storage.type.class.jsdoc', + }, + '3': { + name: 'punctuation.definition.inline.tag.jsdoc', + }, + }, + end: '}|(?=\\*/)', + endCaptures: { + '0': { + name: 'punctuation.definition.bracket.curly.end.jsdoc', + }, + }, + patterns: [ + { + match: '\\G((?=https?://)(?:[^|}\\s*]|\\*[/])+)(\\|)?', + captures: { + '1': { + name: 'variable.other.link.underline.jsdoc', + }, + '2': { + name: 'punctuation.separator.pipe.jsdoc', + }, + }, + }, + { + match: '\\G((?:[^{}@\\s|*]|\\*[^/])+)(\\|)?', + captures: { + '1': { + name: 'variable.other.description.jsdoc', + }, + '2': { + name: 'punctuation.separator.pipe.jsdoc', + }, + }, + }, + ], + }, + ], + }, + jsdoctype: { + patterns: [ + { + contentName: 'entity.name.type.instance.jsdoc', + begin: '\\G({)', + beginCaptures: { + '0': { + name: 'entity.name.type.instance.jsdoc', + }, + '1': { + name: 'punctuation.definition.bracket.curly.begin.jsdoc', + }, + }, + end: '((}))\\s*|(?=\\*/)', + endCaptures: { + '1': { + name: 'entity.name.type.instance.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.curly.end.jsdoc', + }, + }, + patterns: [ + { + include: '#brackets', + }, + ], + }, + ], + }, + jsx: { + patterns: [ + { + include: '#jsx-tag-without-attributes-in-expression', + }, + { + include: '#jsx-tag-in-expression', + }, + ], + }, + 'jsx-tag-without-attributes-in-expression': { + begin: '(?:*]|&&|\\|\\||\\?|\\*\\/|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^default|[^\\._$[:alnum:]]default|^yield|[^\\._$[:alnum:]]yield|^)\\s*(?=(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))', + end: '(?!(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))', + patterns: [ + { + include: '#jsx-tag-without-attributes', + }, + ], + }, + 'jsx-tag-without-attributes': { + name: 'meta.tag.without-attributes.tsx', + begin: '(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?)', + end: '()', + beginCaptures: { + '1': { + name: 'punctuation.definition.tag.begin.tsx', + }, + '2': { + name: 'entity.name.tag.namespace.tsx', + }, + '3': { + name: 'punctuation.separator.namespace.tsx', + }, + '4': { + name: 'entity.name.tag.tsx', + }, + '5': { + name: 'support.class.component.tsx', + }, + '6': { + name: 'punctuation.definition.tag.end.tsx', + }, + }, + endCaptures: { + '1': { + name: 'punctuation.definition.tag.begin.tsx', + }, + '2': { + name: 'entity.name.tag.namespace.tsx', + }, + '3': { + name: 'punctuation.separator.namespace.tsx', + }, + '4': { + name: 'entity.name.tag.tsx', + }, + '5': { + name: 'support.class.component.tsx', + }, + '6': { + name: 'punctuation.definition.tag.end.tsx', + }, + }, + contentName: 'meta.jsx.children.tsx', + patterns: [ + { + include: '#jsx-children', + }, + ], + }, + 'jsx-tag-in-expression': { + begin: '(?x)\n (?:*]|&&|\\|\\||\\?|\\*\\/|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^default|[^\\._$[:alnum:]]default|^yield|[^\\._$[:alnum:]]yield|^)\\s*\n (?!<\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s+[^=>])|,)) # look ahead is not type parameter of arrow\n (?=(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))', + end: '(?!(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))', + patterns: [ + { + include: '#jsx-tag', + }, + ], + }, + 'jsx-tag': { + name: 'meta.tag.tsx', + begin: '(?=(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))', + end: '(/>)|(?:())', + endCaptures: { + '1': { + name: 'punctuation.definition.tag.end.tsx', + }, + '2': { + name: 'punctuation.definition.tag.begin.tsx', + }, + '3': { + name: 'entity.name.tag.namespace.tsx', + }, + '4': { + name: 'punctuation.separator.namespace.tsx', + }, + '5': { + name: 'entity.name.tag.tsx', + }, + '6': { + name: 'support.class.component.tsx', + }, + '7': { + name: 'punctuation.definition.tag.end.tsx', + }, + }, + patterns: [ + { + begin: '(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?)', + beginCaptures: { + '1': { + name: 'punctuation.definition.tag.begin.tsx', + }, + '2': { + name: 'entity.name.tag.namespace.tsx', + }, + '3': { + name: 'punctuation.separator.namespace.tsx', + }, + '4': { + name: 'entity.name.tag.tsx', + }, + '5': { + name: 'support.class.component.tsx', + }, + }, + end: '(?=[/]?>)', + patterns: [ + { + include: '#comment', + }, + { + include: '#type-arguments', + }, + { + include: '#jsx-tag-attributes', + }, + ], + }, + { + begin: '(>)', + beginCaptures: { + '1': { + name: 'punctuation.definition.tag.end.tsx', + }, + }, + end: '(?=)', + patterns: [ + { + include: '#comment', + }, + { + include: '#jsx-tag-attribute-name', + }, + { + include: '#jsx-tag-attribute-assignment', + }, + { + include: '#jsx-string-double-quoted', + }, + { + include: '#jsx-string-single-quoted', + }, + { + include: '#jsx-evaluated-code', + }, + { + include: '#jsx-tag-attributes-illegal', + }, + ], + }, + 'jsx-tag-attribute-name': { + match: '(?x)\n \\s*\n (?:([_$[:alpha:]][-_$[:alnum:].]*)(:))?\n ([_$[:alpha:]][-_$[:alnum:]]*)\n (?=\\s|=|/?>|/\\*|//)', + captures: { + '1': { + name: 'entity.other.attribute-name.namespace.tsx', + }, + '2': { + name: 'punctuation.separator.namespace.tsx', + }, + '3': { + name: 'entity.other.attribute-name.tsx', + }, + }, + }, + 'jsx-tag-attribute-assignment': { + name: 'keyword.operator.assignment.tsx', + match: "=(?=\\s*(?:'|\"|{|/\\*|//|\\n))", + }, + 'jsx-string-double-quoted': { + name: 'string.quoted.double.tsx', + begin: '"', + end: '"', + beginCaptures: { + '0': { + name: 'punctuation.definition.string.begin.tsx', + }, + }, + endCaptures: { + '0': { + name: 'punctuation.definition.string.end.tsx', + }, + }, + patterns: [ + { + include: '#jsx-entities', + }, + ], + }, + 'jsx-string-single-quoted': { + name: 'string.quoted.single.tsx', + begin: "'", + end: "'", + beginCaptures: { + '0': { + name: 'punctuation.definition.string.begin.tsx', + }, + }, + endCaptures: { + '0': { + name: 'punctuation.definition.string.end.tsx', + }, + }, + patterns: [ + { + include: '#jsx-entities', + }, + ], + }, + 'jsx-tag-attributes-illegal': { + name: 'invalid.illegal.attribute.tsx', + match: '\\S+', + }, + }, + }, + grammarLocation: './syntaxes/TypeScriptReact.tmLanguage.json', + injectTo: undefined, + embeddedLanguages: { + 'meta.tag.tsx': 'jsx-tags', + 'meta.tag.without-attributes.tsx': 'jsx-tags', + 'meta.tag.attributes.tsx': 'typescriptreact', + 'meta.embedded.expression.tsx': 'typescriptreact', + }, + tokenTypes: { + 'meta.template.expression': 'other', + 'meta.template.expression string': 'string', + 'meta.template.expression comment': 'comment', + 'entity.name.type.instance.jsdoc': 'other', + 'entity.name.function.tagged-template': 'other', + 'meta.import string.quoted': 'other', + 'variable.other.jsdoc': 'other', + }, + }, + { + language: undefined, + scope: 'documentation.injection.ts', + format: 'json', + grammar: { + injectionSelector: 'L:comment.block.documentation', + patterns: [ + { + include: '#jsdocbody', + }, + ], + repository: { + jsdocbody: { + begin: '(?<=/\\*\\*)([^*]|\\*(?!/))*$', + while: '(^|\\G)\\s*\\*(?!/)(?=([^*]|[*](?!/))*$)', + patterns: [ + { + include: 'source.ts#docblock', + }, + ], + }, + }, + scopeName: 'documentation.injection.ts', + }, + grammarLocation: './syntaxes/jsdoc.ts.injection.tmLanguage.json', + injectTo: [ + 'source.ts', + 'source.tsx', + ], + embeddedLanguages: undefined, + tokenTypes: undefined, + }, + { + language: undefined, + scope: 'documentation.injection.js.jsx', + format: 'json', + grammar: { + injectionSelector: 'L:comment.block.documentation', + patterns: [ + { + include: '#jsdocbody', + }, + ], + repository: { + jsdocbody: { + begin: '(?<=/\\*\\*)([^*]|\\*(?!/))*$', + while: '(^|\\G)\\s*\\*(?!/)(?=([^*]|[*](?!/))*$)', + patterns: [ + { + include: 'source.ts#docblock', + }, + ], + }, + }, + scopeName: 'documentation.injection.js.jsx', + }, + grammarLocation: './syntaxes/jsdoc.js.injection.tmLanguage.json', + injectTo: [ + 'source.js', + 'source.js.jsx', + ], + embeddedLanguages: undefined, + tokenTypes: undefined, + }, + ], + problemMatchers: undefined, + problemPatterns: undefined, + resourceLabelFormatters: undefined, + authentication: undefined, + notebooks: undefined, + snippets: [ + { + language: 'typescript', + source: 'TypeScript Language Basics (built-in)', + uri: 'file:///home/tobias/Git/OpenSource/theia/theia/plugins/ts-base/extension/snippets/typescript.code-snippets', + }, + { + language: 'typescriptreact', + source: 'TypeScript Language Basics (built-in)', + uri: 'file:///home/tobias/Git/OpenSource/theia/theia/plugins/ts-base/extension/snippets/typescript.code-snippets', + }, + ], + themes: undefined, + iconThemes: undefined, + colors: undefined, + localizations: undefined, + terminalProfiles: undefined, + }, + }, +]; diff --git a/examples/browser-only/package.json b/examples/browser-only/package.json index dc2bbce1b8f8c..688881d2c576a 100644 --- a/examples/browser-only/package.json +++ b/examples/browser-only/package.json @@ -14,6 +14,10 @@ } } }, + "theiaPluginsDir": "plugins", + "theiaPlugins": { + "vscode.typescript": "https://open-vsx.org/api/vscode/typescript/1.88.1/file/vscode.typescript-1.88.1.vsix" + }, "dependencies": { "@theia/ai-chat": "1.54.0", "@theia/ai-chat-ui": "1.54.0", @@ -72,6 +76,7 @@ "clean": "theia clean", "build": "yarn -s compile && yarn -s bundle", "bundle": "theia build --mode development", + "download:plugins": "theia download:plugins", "compile": "tsc -b", "start": "theia start", "start:debug": "yarn -s start --log-level=debug", diff --git a/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts b/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts index 5ea7d705c5975..cd9e104330313 100644 --- a/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts +++ b/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts @@ -14,23 +14,36 @@ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 // **************************************************************************** -import { injectable } from '@theia/core/shared/inversify'; +import { injectable, inject } from '@theia/core/shared/inversify'; import { DeployedPlugin, ExtPluginApi, GetDeployedPluginsParams, HostedPluginClient, HostedPluginServer } from '../../common'; import { Event, RpcConnectionEventEmitter } from '@theia/core'; +export const PluginLocalOptions = Symbol('PluginLocalOptions'); +export interface PluginLocalOptions { + pluginDirectory: string; + pluginMetadata: DeployedPlugin[]; +} + @injectable() export class FrontendHostedPluginServer implements HostedPluginServer, RpcConnectionEventEmitter { readonly onDidOpenConnection: Event = Event.None; readonly onDidCloseConnection: Event = Event.None; + + @inject(PluginLocalOptions) + protected readonly options: PluginLocalOptions; + async getDeployedPluginIds(): Promise<`${string}.${string}@${string}`[]> { - return []; + console.log('getDeployedPluginIds'); + // Use the plugin metadata to build the correct plugin id + return this.options.pluginMetadata.map(p => p.metadata.model.id + '@' + p.metadata.model.version as `${string}.${string}@${string}`); } async getUninstalledPluginIds(): Promise { return []; } async getDeployedPlugins(params: GetDeployedPluginsParams): Promise { - return []; + console.log('getDeployedPlugins'); + return this.options.pluginMetadata; } async getExtPluginAPI(): Promise { From 459dbce4d9d8164f6c2e109a9e31e5c2c15027d7 Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Wed, 27 Nov 2024 00:23:45 +0100 Subject: [PATCH 12/36] Add browser-only terminal frontend implementation --- packages/terminal/package.json | 3 + .../terminal-frontend-only-contribution.ts | 65 +++++++++++++++++++ .../terminal-frontend-only-module.ts | 27 ++++++++ 3 files changed, 95 insertions(+) create mode 100644 packages/terminal/src/browser-only/terminal-frontend-only-contribution.ts create mode 100644 packages/terminal/src/browser-only/terminal-frontend-only-module.ts diff --git a/packages/terminal/package.json b/packages/terminal/package.json index 7dd3431211d6e..59d11480a6b3e 100644 --- a/packages/terminal/package.json +++ b/packages/terminal/package.json @@ -23,6 +23,9 @@ "frontend": "lib/browser/terminal-frontend-module", "secondaryWindow": "lib/browser/terminal-frontend-module", "backend": "lib/node/terminal-backend-module" + }, + { + "frontendOnly": "lib/browser-only/terminal-frontend-only-module" } ], "keywords": [ diff --git a/packages/terminal/src/browser-only/terminal-frontend-only-contribution.ts b/packages/terminal/src/browser-only/terminal-frontend-only-contribution.ts new file mode 100644 index 0000000000000..552b3933f6279 --- /dev/null +++ b/packages/terminal/src/browser-only/terminal-frontend-only-contribution.ts @@ -0,0 +1,65 @@ +// ***************************************************************************** +// Copyright (C) 2017 TypeFox and others. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// ***************************************************************************** + +import { injectable } from '@theia/core/shared/inversify'; +import { TerminalService } from '../browser/base/terminal-service'; +import { Event, Emitter } from '@theia/core'; +import { WidgetOpenerOptions } from '@theia/core/src/browser'; +import { TerminalWidgetOptions, TerminalWidget } from '../browser/base/terminal-widget'; + +@injectable() +export class TerminalFrontendOnlyContribution implements TerminalService { + protected readonly onDidCreateTerminalEmitter = new Emitter(); + protected readonly onDidChangeCurrentTerminalEmitter = new Emitter(); + + get onDidCreateTerminal(): Event { + return this.onDidCreateTerminalEmitter.event; + } + + get onDidChangeCurrentTerminal(): Event { + return this.onDidChangeCurrentTerminalEmitter.event; + } + + get currentTerminal(): TerminalWidget | undefined { + return undefined; + } + + get lastUsedTerminal(): TerminalWidget | undefined { + return undefined; + } + + async newTerminal(options: TerminalWidgetOptions): Promise { + throw new Error('Method not implemented.'); + } + + open(terminal: TerminalWidget, options?: WidgetOpenerOptions): void { } + + get all(): TerminalWidget[] { + return []; + } + + getById(id: string): TerminalWidget | undefined { + return undefined + } + + getByTerminalId(terminalId: number): TerminalWidget | undefined { + return undefined + } + + async getDefaultShell(): Promise { + return 'none'; + } +} diff --git a/packages/terminal/src/browser-only/terminal-frontend-only-module.ts b/packages/terminal/src/browser-only/terminal-frontend-only-module.ts new file mode 100644 index 0000000000000..0f817358971d9 --- /dev/null +++ b/packages/terminal/src/browser-only/terminal-frontend-only-module.ts @@ -0,0 +1,27 @@ +// ***************************************************************************** +// Copyright (C) 2017 TypeFox and others. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// ***************************************************************************** + +import '../../src/browser/style/terminal.css'; +import 'xterm/css/xterm.css'; + +import { ContainerModule } from '@theia/core/shared/inversify'; +import { TerminalFrontendOnlyContribution } from './terminal-frontend-only-contribution'; +import { TerminalService } from '../browser/base/terminal-service'; + +export default new ContainerModule((bind, unbind, isBound, rebind) => { + bind(TerminalFrontendOnlyContribution).toSelf().inSingletonScope(); + rebind(TerminalService).toService(TerminalFrontendOnlyContribution); +}); From 3a693bbee062d3e92266ac9bb77344a9f2aeefc4 Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Wed, 27 Nov 2024 00:24:12 +0100 Subject: [PATCH 13/36] Remove unused pluginDirectory property from PluginLocalOptions --- .../browser-only/plugin-sample/example-plugin-initialization.ts | 1 - .../src/hosted/browser-only/frontend-hosted-plugin-server.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts b/examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts index 5c3f3b233216a..35a8a2bff88f7 100644 --- a/examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts +++ b/examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts @@ -5,7 +5,6 @@ import { mockData } from './mock-plugin-metadata'; export const bindPluginInitialization = (bind: interfaces.Bind, rebind: interfaces.Rebind): void => { const pluginLocalOptions = { - pluginDirectory: '', pluginMetadata: mockData, }; bind(PluginLocalOptions).toConstantValue(pluginLocalOptions); diff --git a/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts b/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts index cd9e104330313..9e8f70c4ee8e7 100644 --- a/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts +++ b/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts @@ -20,7 +20,6 @@ import { Event, RpcConnectionEventEmitter } from '@theia/core'; export const PluginLocalOptions = Symbol('PluginLocalOptions'); export interface PluginLocalOptions { - pluginDirectory: string; pluginMetadata: DeployedPlugin[]; } From d0e4de7cdb9b639acf58d01cb6d2661e6d4c8898 Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Wed, 27 Nov 2024 00:24:53 +0100 Subject: [PATCH 14/36] Add example mock-plugin-metadata file --- .../plugin-sample/mock-plugin-metadata.ts | 13803 +--------------- 1 file changed, 29 insertions(+), 13774 deletions(-) diff --git a/examples/api-samples/src/browser-only/plugin-sample/mock-plugin-metadata.ts b/examples/api-samples/src/browser-only/plugin-sample/mock-plugin-metadata.ts index b23c7d98e5f80..b2dd15585eca5 100644 --- a/examples/api-samples/src/browser-only/plugin-sample/mock-plugin-metadata.ts +++ b/examples/api-samples/src/browser-only/plugin-sample/mock-plugin-metadata.ts @@ -18,13782 +18,37 @@ export const mockData: any[] = [ { metadata: { host: 'main', - model: { - packagePath: '/Users/robertjandow/Documents/Development/theia/examples/browser-only/plugins/vscode.typescript/extension', - packageUri: 'file:///Users/robertjandow/Documents/Development/theia/examples/browser-only/plugins/vscode.typescript/extension', - id: 'vscode.typescript-language-features', - name: 'typescript-language-features', - publisher: 'vscode', - version: '1.88.1', - displayName: 'TypeScript and JavaScript Language Features (built-in)', - description: 'Provides rich language support for JavaScript and TypeScript.', - engine: { - type: 'vscode', - version: '^1.30.0', - }, - entryPoint: { - frontend: './dist/browser/extension.js', - }, - iconUrl: 'plugins/vscode.typescript/media%2Ficon.png', - l10n: undefined, - readmeUrl: 'plugins/vscode.typescript/.%2FREADME.md', - licenseUrl: 'plugins/vscode.typescript/.%2FLICENSE', - }, - lifecycle: { - startMethod: 'activate', - stopMethod: 'deactivate', - frontendModuleName: 'vscode.typescript', - frontendInitPath: 'plugin-vscode-init-fe.js', - backendInitPath: '/Users/robertjandow/Documents/Development/theia/examples/browser/lib/backend/plugin-vscode-init', - }, - outOfSync: false, - isUnderDevelopment: false, - }, - type: 0, - contributes: { - activationEvents: [ - 'onLanguage:javascript', - 'onLanguage:javascriptreact', - 'onLanguage:typescript', - 'onLanguage:typescriptreact', - 'onLanguage:jsx-tags', - 'onCommand:typescript.tsserverRequest', - 'onCommand:_typescript.configurePlugin', - 'onCommand:_typescript.learnMoreAboutRefactorings', - 'onCommand:typescript.fileReferences', - 'onTaskType:typescript', - 'onLanguage:jsonc', - 'onWalkthrough:nodejsWelcome', - 'onCommand:typescript.reloadProjects', - 'onCommand:javascript.reloadProjects', - 'onCommand:typescript.selectTypeScriptVersion', - 'onCommand:typescript.goToProjectConfig', - 'onCommand:javascript.goToProjectConfig', - 'onCommand:typescript.openTsServerLog', - 'onCommand:typescript.restartTsServer', - 'onCommand:typescript.findAllFileReferences', - 'onCommand:typescript.goToSourceDefinition', - 'onCommand:typescript.sortImports', - 'onCommand:javascript.sortImports', - 'onCommand:typescript.removeUnusedImports', - 'onCommand:javascript.removeUnusedImports', - ], - configuration: [ - { - type: 'object', - title: 'TypeScript', - order: 20, - properties: { - 'typescript.tsdk': { - type: 'string', - markdownDescription: 'Specifies the folder path to the tsserver and `lib*.d.ts` files under a TypeScript install to use for IntelliSense, for example: `./node_modules/typescript/lib`.\n\n- When specified as a user setting, the TypeScript version from `typescript.tsdk` automatically replaces the built-in TypeScript version.\n- When specified as a workspace setting, `typescript.tsdk` allows you to switch to use that workspace version of TypeScript for IntelliSense with the `TypeScript: Select TypeScript version` command.\n\nSee the [TypeScript documentation](https://code.visualstudio.com/docs/typescript/typescript-compiling#_using-newer-typescript-versions) for more detail about managing TypeScript versions.', - scope: 'window', - }, - 'typescript.disableAutomaticTypeAcquisition': { - type: 'boolean', - default: false, - markdownDescription: 'Disables [automatic type acquisition](https://code.visualstudio.com/docs/nodejs/working-with-javascript#_typings-and-automatic-type-acquisition). Automatic type acquisition fetches `@types` packages from npm to improve IntelliSense for external libraries.', - scope: 'window', - tags: [ - 'usesOnlineServices', - ], - }, - 'typescript.enablePromptUseWorkspaceTsdk': { - type: 'boolean', - default: false, - description: 'Enables prompting of users to use the TypeScript version configured in the workspace for Intellisense.', - scope: 'window', - }, - 'typescript.npm': { - type: 'string', - markdownDescription: 'Specifies the path to the npm executable used for [Automatic Type Acquisition](https://code.visualstudio.com/docs/nodejs/working-with-javascript#_typings-and-automatic-type-acquisition).', - scope: 'machine', - }, - 'typescript.check.npmIsInstalled': { - type: 'boolean', - default: true, - markdownDescription: 'Check if npm is installed for [Automatic Type Acquisition](https://code.visualstudio.com/docs/nodejs/working-with-javascript#_typings-and-automatic-type-acquisition).', - scope: 'window', - }, - 'javascript.referencesCodeLens.enabled': { - type: 'boolean', - default: false, - description: 'Enable/disable references CodeLens in JavaScript files.', - scope: 'window', - }, - 'javascript.referencesCodeLens.showOnAllFunctions': { - type: 'boolean', - default: false, - description: 'Enable/disable references CodeLens on all functions in JavaScript files.', - scope: 'window', - }, - 'typescript.referencesCodeLens.enabled': { - type: 'boolean', - default: false, - description: 'Enable/disable references CodeLens in TypeScript files.', - scope: 'window', - }, - 'typescript.referencesCodeLens.showOnAllFunctions': { - type: 'boolean', - default: false, - description: 'Enable/disable references CodeLens on all functions in TypeScript files.', - scope: 'window', - }, - 'typescript.implementationsCodeLens.enabled': { - type: 'boolean', - default: false, - description: 'Enable/disable implementations CodeLens. This CodeLens shows the implementers of an interface.', - scope: 'window', - }, - 'typescript.tsserver.enableTracing': { - type: 'boolean', - default: false, - description: 'Enables tracing TS server performance to a directory. These trace files can be used to diagnose TS Server performance issues. The log may contain file paths, source code, and other potentially sensitive information from your project.', - scope: 'window', - }, - 'typescript.tsserver.log': { - type: 'string', - enum: [ - 'off', - 'terse', - 'normal', - 'verbose', - ], - default: 'off', - description: 'Enables logging of the TS server to a file. This log can be used to diagnose TS Server issues. The log may contain file paths, source code, and other potentially sensitive information from your project.', - scope: 'window', - }, - 'typescript.tsserver.pluginPaths': { - type: 'array', - items: { - type: 'string', - description: 'Either an absolute or relative path. Relative path will be resolved against workspace folder(s).', - }, - default: [ - ], - description: 'Additional paths to discover TypeScript Language Service plugins.', - scope: 'machine', - }, - 'typescript.tsserver.trace': { - type: 'string', - enum: [ - 'off', - 'messages', - 'verbose', - ], - default: 'off', - description: 'Enables tracing of messages sent to the TS server. This trace can be used to diagnose TS Server issues. The trace may contain file paths, source code, and other potentially sensitive information from your project.', - scope: 'window', - }, - 'javascript.suggest.completeFunctionCalls': { - type: 'boolean', - default: false, - description: 'Complete functions with their parameter signature.', - scope: 'resource', - }, - 'typescript.suggest.completeFunctionCalls': { - type: 'boolean', - default: false, - description: 'Complete functions with their parameter signature.', - scope: 'resource', - }, - 'javascript.suggest.includeAutomaticOptionalChainCompletions': { - type: 'boolean', - default: true, - description: 'Enable/disable showing completions on potentially undefined values that insert an optional chain call. Requires strict null checks to be enabled.', - scope: 'resource', - }, - 'typescript.suggest.includeAutomaticOptionalChainCompletions': { - type: 'boolean', - default: true, - description: 'Enable/disable showing completions on potentially undefined values that insert an optional chain call. Requires strict null checks to be enabled.', - scope: 'resource', - }, - 'typescript.inlayHints.parameterNames.enabled': { - type: 'string', - enum: [ - 'none', - 'literals', - 'all', - ], - enumDescriptions: [ - 'Disable parameter name hints.', - 'Enable parameter name hints only for literal arguments.', - 'Enable parameter name hints for literal and non-literal arguments.', - ], - default: 'none', - markdownDescription: "Enable/disable inlay hints for parameter names:\n```typescript\n\nparseInt(/* str: */ '123', /* radix: */ 8)\n \n```", - scope: 'resource', - }, - 'typescript.inlayHints.parameterNames.suppressWhenArgumentMatchesName': { - type: 'boolean', - default: true, - markdownDescription: 'Suppress parameter name hints on arguments whose text is identical to the parameter name.', - scope: 'resource', - }, - 'typescript.inlayHints.parameterTypes.enabled': { - type: 'boolean', - default: false, - markdownDescription: "Enable/disable inlay hints for implicit parameter types:\n```typescript\n\nel.addEventListener('click', e /* :MouseEvent */ => ...)\n \n```", - scope: 'resource', - }, - 'typescript.inlayHints.variableTypes.enabled': { - type: 'boolean', - default: false, - markdownDescription: 'Enable/disable inlay hints for implicit variable types:\n```typescript\n\nconst foo /* :number */ = Date.now();\n \n```', - scope: 'resource', - }, - 'typescript.inlayHints.variableTypes.suppressWhenTypeMatchesName': { - type: 'boolean', - default: true, - markdownDescription: 'Suppress type hints on variables whose name is identical to the type name. Requires using TypeScript 4.8+ in the workspace.', - scope: 'resource', - }, - 'typescript.inlayHints.propertyDeclarationTypes.enabled': { - type: 'boolean', - default: false, - markdownDescription: 'Enable/disable inlay hints for implicit types on property declarations:\n```typescript\n\nclass Foo {\n\tprop /* :number */ = Date.now();\n}\n \n```', - scope: 'resource', - }, - 'typescript.inlayHints.functionLikeReturnTypes.enabled': { - type: 'boolean', - default: false, - markdownDescription: 'Enable/disable inlay hints for implicit return types on function signatures:\n```typescript\n\nfunction foo() /* :number */ {\n\treturn Date.now();\n} \n \n```', - scope: 'resource', - }, - 'typescript.inlayHints.enumMemberValues.enabled': { - type: 'boolean', - default: false, - markdownDescription: 'Enable/disable inlay hints for member values in enum declarations:\n```typescript\n\nenum MyValue {\n\tA /* = 0 */;\n\tB /* = 1 */;\n}\n \n```', - scope: 'resource', - }, - 'javascript.inlayHints.parameterNames.enabled': { - type: 'string', - enum: [ - 'none', - 'literals', - 'all', - ], - enumDescriptions: [ - 'Disable parameter name hints.', - 'Enable parameter name hints only for literal arguments.', - 'Enable parameter name hints for literal and non-literal arguments.', - ], - default: 'none', - markdownDescription: "Enable/disable inlay hints for parameter names:\n```typescript\n\nparseInt(/* str: */ '123', /* radix: */ 8)\n \n```", - scope: 'resource', - }, - 'javascript.inlayHints.parameterNames.suppressWhenArgumentMatchesName': { - type: 'boolean', - default: true, - markdownDescription: 'Suppress parameter name hints on arguments whose text is identical to the parameter name.', - scope: 'resource', - }, - 'javascript.inlayHints.parameterTypes.enabled': { - type: 'boolean', - default: false, - markdownDescription: "Enable/disable inlay hints for implicit parameter types:\n```typescript\n\nel.addEventListener('click', e /* :MouseEvent */ => ...)\n \n```", - scope: 'resource', - }, - 'javascript.inlayHints.variableTypes.enabled': { - type: 'boolean', - default: false, - markdownDescription: 'Enable/disable inlay hints for implicit variable types:\n```typescript\n\nconst foo /* :number */ = Date.now();\n \n```', - scope: 'resource', - }, - 'javascript.inlayHints.variableTypes.suppressWhenTypeMatchesName': { - type: 'boolean', - default: true, - markdownDescription: 'Suppress type hints on variables whose name is identical to the type name. Requires using TypeScript 4.8+ in the workspace.', - scope: 'resource', - }, - 'javascript.inlayHints.propertyDeclarationTypes.enabled': { - type: 'boolean', - default: false, - markdownDescription: 'Enable/disable inlay hints for implicit types on property declarations:\n```typescript\n\nclass Foo {\n\tprop /* :number */ = Date.now();\n}\n \n```', - scope: 'resource', - }, - 'javascript.inlayHints.functionLikeReturnTypes.enabled': { - type: 'boolean', - default: false, - markdownDescription: 'Enable/disable inlay hints for implicit return types on function signatures:\n```typescript\n\nfunction foo() /* :number */ {\n\treturn Date.now();\n} \n \n```', - scope: 'resource', - }, - 'javascript.inlayHints.enumMemberValues.enabled': { - type: 'boolean', - default: false, - markdownDescription: 'Enable/disable inlay hints for member values in enum declarations:\n```typescript\n\nenum MyValue {\n\tA /* = 0 */;\n\tB /* = 1 */;\n}\n \n```', - scope: 'resource', - }, - 'javascript.suggest.includeCompletionsForImportStatements': { - type: 'boolean', - default: true, - description: 'Enable/disable auto-import-style completions on partially-typed import statements.', - scope: 'resource', - }, - 'typescript.suggest.includeCompletionsForImportStatements': { - type: 'boolean', - default: true, - description: 'Enable/disable auto-import-style completions on partially-typed import statements.', - scope: 'resource', - }, - 'typescript.reportStyleChecksAsWarnings': { - type: 'boolean', - default: true, - description: 'Report style checks as warnings.', - scope: 'window', - }, - 'typescript.validate.enable': { - type: 'boolean', - default: true, - description: 'Enable/disable TypeScript validation.', - scope: 'window', - }, - 'typescript.format.enable': { - type: 'boolean', - default: true, - description: 'Enable/disable default TypeScript formatter.', - scope: 'window', - }, - 'typescript.format.insertSpaceAfterCommaDelimiter': { - type: 'boolean', - default: true, - description: 'Defines space handling after a comma delimiter.', - scope: 'resource', - }, - 'typescript.format.insertSpaceAfterConstructor': { - type: 'boolean', - default: false, - description: 'Defines space handling after the constructor keyword.', - scope: 'resource', - }, - 'typescript.format.insertSpaceAfterSemicolonInForStatements': { - type: 'boolean', - default: true, - description: 'Defines space handling after a semicolon in a for statement.', - scope: 'resource', - }, - 'typescript.format.insertSpaceBeforeAndAfterBinaryOperators': { - type: 'boolean', - default: true, - description: 'Defines space handling after a binary operator.', - scope: 'resource', - }, - 'typescript.format.insertSpaceAfterKeywordsInControlFlowStatements': { - type: 'boolean', - default: true, - description: 'Defines space handling after keywords in a control flow statement.', - scope: 'resource', - }, - 'typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions': { - type: 'boolean', - default: true, - description: 'Defines space handling after function keyword for anonymous functions.', - scope: 'resource', - }, - 'typescript.format.insertSpaceBeforeFunctionParenthesis': { - type: 'boolean', - default: false, - description: 'Defines space handling before function argument parentheses.', - scope: 'resource', - }, - 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis': { - type: 'boolean', - default: false, - description: 'Defines space handling after opening and before closing non-empty parenthesis.', - scope: 'resource', - }, - 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets': { - type: 'boolean', - default: false, - description: 'Defines space handling after opening and before closing non-empty brackets.', - scope: 'resource', - }, - 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces': { - type: 'boolean', - default: true, - description: 'Defines space handling after opening and before closing non-empty braces.', - scope: 'resource', - }, - 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces': { - type: 'boolean', - default: true, - description: 'Defines space handling after opening and before closing empty braces.', - scope: 'resource', - }, - 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces': { - type: 'boolean', - default: false, - description: 'Defines space handling after opening and before closing template string braces.', - scope: 'resource', - }, - 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces': { - type: 'boolean', - default: false, - description: 'Defines space handling after opening and before closing JSX expression braces.', - scope: 'resource', - }, - 'typescript.format.insertSpaceAfterTypeAssertion': { - type: 'boolean', - default: false, - description: 'Defines space handling after type assertions in TypeScript.', - scope: 'resource', - }, - 'typescript.format.placeOpenBraceOnNewLineForFunctions': { - type: 'boolean', - default: false, - description: 'Defines whether an open brace is put onto a new line for functions or not.', - scope: 'resource', - }, - 'typescript.format.placeOpenBraceOnNewLineForControlBlocks': { - type: 'boolean', - default: false, - description: 'Defines whether an open brace is put onto a new line for control blocks or not.', - scope: 'resource', - }, - 'typescript.format.semicolons': { - type: 'string', - default: 'ignore', - description: 'Defines handling of optional semicolons.', - scope: 'resource', - enum: [ - 'ignore', - 'insert', - 'remove', - ], - enumDescriptions: [ - "Don't insert or remove any semicolons.", - 'Insert semicolons at statement ends.', - 'Remove unnecessary semicolons.', - ], - }, - 'javascript.validate.enable': { - type: 'boolean', - default: true, - description: 'Enable/disable JavaScript validation.', - scope: 'window', - }, - 'javascript.format.enable': { - type: 'boolean', - default: true, - description: 'Enable/disable default JavaScript formatter.', - scope: 'window', - }, - 'javascript.format.insertSpaceAfterCommaDelimiter': { - type: 'boolean', - default: true, - description: 'Defines space handling after a comma delimiter.', - scope: 'resource', - }, - 'javascript.format.insertSpaceAfterConstructor': { - type: 'boolean', - default: false, - description: 'Defines space handling after the constructor keyword.', - scope: 'resource', - }, - 'javascript.format.insertSpaceAfterSemicolonInForStatements': { - type: 'boolean', - default: true, - description: 'Defines space handling after a semicolon in a for statement.', - scope: 'resource', - }, - 'javascript.format.insertSpaceBeforeAndAfterBinaryOperators': { - type: 'boolean', - default: true, - description: 'Defines space handling after a binary operator.', - scope: 'resource', - }, - 'javascript.format.insertSpaceAfterKeywordsInControlFlowStatements': { - type: 'boolean', - default: true, - description: 'Defines space handling after keywords in a control flow statement.', - scope: 'resource', - }, - 'javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions': { - type: 'boolean', - default: true, - description: 'Defines space handling after function keyword for anonymous functions.', - scope: 'resource', - }, - 'javascript.format.insertSpaceBeforeFunctionParenthesis': { - type: 'boolean', - default: false, - description: 'Defines space handling before function argument parentheses.', - scope: 'resource', - }, - 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis': { - type: 'boolean', - default: false, - description: 'Defines space handling after opening and before closing non-empty parenthesis.', - scope: 'resource', - }, - 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets': { - type: 'boolean', - default: false, - description: 'Defines space handling after opening and before closing non-empty brackets.', - scope: 'resource', - }, - 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces': { - type: 'boolean', - default: true, - description: 'Defines space handling after opening and before closing non-empty braces.', - scope: 'resource', - }, - 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces': { - type: 'boolean', - default: true, - description: 'Defines space handling after opening and before closing empty braces.', - scope: 'resource', - }, - 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces': { - type: 'boolean', - default: false, - description: 'Defines space handling after opening and before closing template string braces.', - scope: 'resource', - }, - 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces': { - type: 'boolean', - default: false, - description: 'Defines space handling after opening and before closing JSX expression braces.', - scope: 'resource', - }, - 'javascript.format.placeOpenBraceOnNewLineForFunctions': { - type: 'boolean', - default: false, - description: 'Defines whether an open brace is put onto a new line for functions or not.', - scope: 'resource', - }, - 'javascript.format.placeOpenBraceOnNewLineForControlBlocks': { - type: 'boolean', - default: false, - description: 'Defines whether an open brace is put onto a new line for control blocks or not.', - scope: 'resource', - }, - 'javascript.format.semicolons': { - type: 'string', - default: 'ignore', - description: 'Defines handling of optional semicolons.', - scope: 'resource', - enum: [ - 'ignore', - 'insert', - 'remove', - ], - enumDescriptions: [ - "Don't insert or remove any semicolons.", - 'Insert semicolons at statement ends.', - 'Remove unnecessary semicolons.', - ], - }, - 'js/ts.implicitProjectConfig.module': { - type: 'string', - markdownDescription: 'Sets the module system for the program. See more: https://www.typescriptlang.org/tsconfig#module.', - default: 'ESNext', - enum: [ - 'CommonJS', - 'AMD', - 'System', - 'UMD', - 'ES6', - 'ES2015', - 'ES2020', - 'ESNext', - 'None', - 'ES2022', - 'Node12', - 'NodeNext', - ], - scope: 'window', - }, - 'js/ts.implicitProjectConfig.target': { - type: 'string', - default: 'ES2020', - markdownDescription: 'Set target JavaScript language version for emitted JavaScript and include library declarations. See more: https://www.typescriptlang.org/tsconfig#target.', - enum: [ - 'ES3', - 'ES5', - 'ES6', - 'ES2015', - 'ES2016', - 'ES2017', - 'ES2018', - 'ES2019', - 'ES2020', - 'ES2021', - 'ES2022', - 'ESNext', - ], - scope: 'window', - }, - 'javascript.implicitProjectConfig.checkJs': { - type: 'boolean', - default: false, - markdownDescription: 'Enable/disable semantic checking of JavaScript files. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', - markdownDeprecationMessage: 'This setting has been deprecated in favor of `js/ts.implicitProjectConfig.checkJs`.', - scope: 'window', - }, - 'js/ts.implicitProjectConfig.checkJs': { - type: 'boolean', - default: false, - markdownDescription: 'Enable/disable semantic checking of JavaScript files. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', - scope: 'window', - }, - 'javascript.implicitProjectConfig.experimentalDecorators': { - type: 'boolean', - default: false, - markdownDescription: 'Enable/disable `experimentalDecorators` in JavaScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', - markdownDeprecationMessage: 'This setting has been deprecated in favor of `js/ts.implicitProjectConfig.experimentalDecorators`.', - scope: 'window', - }, - 'js/ts.implicitProjectConfig.experimentalDecorators': { - type: 'boolean', - default: false, - markdownDescription: 'Enable/disable `experimentalDecorators` in JavaScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', - scope: 'window', - }, - 'js/ts.implicitProjectConfig.strictNullChecks': { - type: 'boolean', - default: true, - markdownDescription: 'Enable/disable [strict null checks](https://www.typescriptlang.org/tsconfig#strictNullChecks) in JavaScript and TypeScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', - scope: 'window', - }, - 'js/ts.implicitProjectConfig.strictFunctionTypes': { - type: 'boolean', - default: true, - markdownDescription: 'Enable/disable [strict function types](https://www.typescriptlang.org/tsconfig#strictFunctionTypes) in JavaScript and TypeScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', - scope: 'window', - }, - 'javascript.suggest.names': { - type: 'boolean', - default: true, - markdownDescription: 'Enable/disable including unique names from the file in JavaScript suggestions. Note that name suggestions are always disabled in JavaScript code that is semantically checked using `@ts-check` or `checkJs`.', - scope: 'resource', - }, - 'typescript.tsc.autoDetect': { - type: 'string', - default: 'on', - enum: [ - 'on', - 'off', - 'build', - 'watch', - ], - markdownEnumDescriptions: [ - 'Create both build and watch tasks.', - 'Disable this feature.', - 'Only create single run compile tasks.', - 'Only create compile and watch tasks.', - ], - description: 'Controls auto detection of tsc tasks.', - scope: 'window', - }, - 'javascript.suggest.paths': { - type: 'boolean', - default: true, - description: 'Enable/disable suggestions for paths in import statements and require calls.', - scope: 'resource', - }, - 'typescript.suggest.paths': { - type: 'boolean', - default: true, - description: 'Enable/disable suggestions for paths in import statements and require calls.', - scope: 'resource', - }, - 'javascript.suggest.autoImports': { - type: 'boolean', - default: true, - description: 'Enable/disable auto import suggestions.', - scope: 'resource', - }, - 'typescript.suggest.autoImports': { - type: 'boolean', - default: true, - description: 'Enable/disable auto import suggestions.', - scope: 'resource', - }, - 'javascript.suggest.completeJSDocs': { - type: 'boolean', - default: true, - description: 'Enable/disable suggestion to complete JSDoc comments.', - scope: 'language-overridable', - }, - 'typescript.suggest.completeJSDocs': { - type: 'boolean', - default: true, - description: 'Enable/disable suggestion to complete JSDoc comments.', - scope: 'language-overridable', - }, - 'javascript.suggest.jsdoc.generateReturns': { - type: 'boolean', - default: true, - markdownDescription: 'Enable/disable generating `@returns` annotations for JSDoc templates.', - scope: 'language-overridable', - }, - 'typescript.suggest.jsdoc.generateReturns': { - type: 'boolean', - default: true, - markdownDescription: 'Enable/disable generating `@returns` annotations for JSDoc templates.', - scope: 'language-overridable', - }, - 'typescript.locale': { - type: 'string', - default: 'auto', - enum: [ - 'auto', - 'de', - 'es', - 'en', - 'fr', - 'it', - 'ja', - 'ko', - 'ru', - 'zh-CN', - 'zh-TW', - ], - markdownDescription: "Sets the locale used to report JavaScript and TypeScript errors. Defaults to use VS Code's locale.", - scope: 'window', - }, - 'javascript.suggestionActions.enabled': { - type: 'boolean', - default: true, - description: 'Enable/disable suggestion diagnostics for JavaScript files in the editor.', - scope: 'resource', - }, - 'typescript.suggestionActions.enabled': { - type: 'boolean', - default: true, - description: 'Enable/disable suggestion diagnostics for TypeScript files in the editor.', - scope: 'resource', - }, - 'javascript.preferences.quoteStyle': { - type: 'string', - enum: [ - 'auto', - 'single', - 'double', - ], - default: 'auto', - markdownDescription: 'Preferred quote style to use for Quick Fixes.', - markdownEnumDescriptions: [ - 'Infer quote type from existing code', - "Always use single quotes: `'`", - 'Always use double quotes: `"`', - ], - scope: 'language-overridable', - }, - 'typescript.preferences.quoteStyle': { - type: 'string', - enum: [ - 'auto', - 'single', - 'double', - ], - default: 'auto', - markdownDescription: 'Preferred quote style to use for Quick Fixes.', - markdownEnumDescriptions: [ - 'Infer quote type from existing code', - "Always use single quotes: `'`", - 'Always use double quotes: `"`', - ], - scope: 'language-overridable', - }, - 'javascript.preferences.importModuleSpecifier': { - type: 'string', - enum: [ - 'shortest', - 'relative', - 'non-relative', - 'project-relative', - ], - markdownEnumDescriptions: [ - 'Prefers a non-relative import only if one is available that has fewer path segments than a relative import.', - 'Prefers a relative path to the imported file location.', - 'Prefers a non-relative import based on the `baseUrl` or `paths` configured in your `jsconfig.json` / `tsconfig.json`.', - 'Prefers a non-relative import only if the relative import path would leave the package or project directory.', - ], - default: 'shortest', - description: 'Preferred path style for auto imports.', - scope: 'language-overridable', - }, - 'typescript.preferences.importModuleSpecifier': { - type: 'string', - enum: [ - 'shortest', - 'relative', - 'non-relative', - 'project-relative', - ], - markdownEnumDescriptions: [ - 'Prefers a non-relative import only if one is available that has fewer path segments than a relative import.', - 'Prefers a relative path to the imported file location.', - 'Prefers a non-relative import based on the `baseUrl` or `paths` configured in your `jsconfig.json` / `tsconfig.json`.', - 'Prefers a non-relative import only if the relative import path would leave the package or project directory.', - ], - default: 'shortest', - description: 'Preferred path style for auto imports.', - scope: 'language-overridable', - }, - 'javascript.preferences.importModuleSpecifierEnding': { - type: 'string', - enum: [ - 'auto', - 'minimal', - 'index', - 'js', - ], - markdownEnumDescriptions: [ - 'Use project settings to select a default.', - 'Shorten `./component/index.js` to `./component`.', - 'Shorten `./component/index.js` to `./component/index`.', - 'Do not shorten path endings; include the `.js` extension.', - ], - default: 'auto', - description: 'Preferred path ending for auto imports.', - scope: 'language-overridable', - }, - 'typescript.preferences.importModuleSpecifierEnding': { - type: 'string', - enum: [ - 'auto', - 'minimal', - 'index', - 'js', - ], - markdownEnumDescriptions: [ - 'Use project settings to select a default.', - 'Shorten `./component/index.js` to `./component`.', - 'Shorten `./component/index.js` to `./component/index`.', - 'Do not shorten path endings; include the `.js` extension.', - ], - default: 'auto', - description: 'Preferred path ending for auto imports.', - scope: 'language-overridable', - }, - 'javascript.preferences.jsxAttributeCompletionStyle': { - type: 'string', - enum: [ - 'auto', - 'braces', - 'none', - ], - markdownEnumDescriptions: [ - 'Insert `={}` or `=""` after attribute names based on the prop type. See `javascript.preferences.quoteStyle` to control the type of quotes used for string attributes.', - 'Insert `={}` after attribute names.', - 'Only insert attribute names.', - ], - default: 'auto', - description: 'Preferred style for JSX attribute completions.', - scope: 'language-overridable', - }, - 'typescript.preferences.jsxAttributeCompletionStyle': { - type: 'string', - enum: [ - 'auto', - 'braces', - 'none', - ], - markdownEnumDescriptions: [ - 'Insert `={}` or `=""` after attribute names based on the prop type. See `typescript.preferences.quoteStyle` to control the type of quotes used for string attributes.', - 'Insert `={}` after attribute names.', - 'Only insert attribute names.', - ], - default: 'auto', - description: 'Preferred style for JSX attribute completions.', - scope: 'language-overridable', - }, - 'typescript.preferences.includePackageJsonAutoImports': { - type: 'string', - enum: [ - 'auto', - 'on', - 'off', - ], - enumDescriptions: [ - 'Search dependencies based on estimated performance impact.', - 'Always search dependencies.', - 'Never search dependencies.', - ], - default: 'auto', - markdownDescription: 'Enable/disable searching `package.json` dependencies for available auto imports.', - scope: 'window', - }, - 'typescript.preferences.autoImportFileExcludePatterns': { - type: 'array', - items: { - type: 'string', - }, - markdownDescription: 'Specify glob patterns of files to exclude from auto imports. Requires using TypeScript 4.8 or newer in the workspace.', - scope: 'resource', - }, - 'javascript.preferences.autoImportFileExcludePatterns': { - type: 'array', - items: { - type: 'string', - }, - markdownDescription: 'Specify glob patterns of files to exclude from auto imports. Requires using TypeScript 4.8 or newer in the workspace.', - scope: 'resource', - }, - 'javascript.preferences.renameShorthandProperties': { - type: 'boolean', - default: true, - description: 'Enable/disable introducing aliases for object shorthand properties during renames.', - deprecationMessage: "The setting 'typescript.preferences.renameShorthandProperties' has been deprecated in favor of 'typescript.preferences.useAliasesForRenames'", - scope: 'language-overridable', - }, - 'typescript.preferences.renameShorthandProperties': { - type: 'boolean', - default: true, - description: 'Enable/disable introducing aliases for object shorthand properties during renames.', - deprecationMessage: "The setting 'typescript.preferences.renameShorthandProperties' has been deprecated in favor of 'typescript.preferences.useAliasesForRenames'", - scope: 'language-overridable', - }, - 'javascript.preferences.useAliasesForRenames': { - type: 'boolean', - default: true, - description: 'Enable/disable introducing aliases for object shorthand properties during renames.', - scope: 'language-overridable', - }, - 'typescript.preferences.useAliasesForRenames': { - type: 'boolean', - default: true, - description: 'Enable/disable introducing aliases for object shorthand properties during renames.', - scope: 'language-overridable', - }, - 'typescript.updateImportsOnFileMove.enabled': { - type: 'string', - enum: [ - 'prompt', - 'always', - 'never', - ], - markdownEnumDescriptions: [ - 'Prompt on each rename.', - 'Always update paths automatically.', - "Never rename paths and don't prompt.", - ], - default: 'prompt', - description: 'Enable/disable automatic updating of import paths when you rename or move a file in VS Code.', - scope: 'resource', - }, - 'javascript.updateImportsOnFileMove.enabled': { - type: 'string', - enum: [ - 'prompt', - 'always', - 'never', - ], - markdownEnumDescriptions: [ - 'Prompt on each rename.', - 'Always update paths automatically.', - "Never rename paths and don't prompt.", - ], - default: 'prompt', - description: 'Enable/disable automatic updating of import paths when you rename or move a file in VS Code.', - scope: 'resource', - }, - 'typescript.autoClosingTags': { - type: 'boolean', - default: true, - description: 'Enable/disable automatic closing of JSX tags.', - scope: 'language-overridable', - }, - 'javascript.autoClosingTags': { - type: 'boolean', - default: true, - description: 'Enable/disable automatic closing of JSX tags.', - scope: 'language-overridable', - }, - 'javascript.suggest.enabled': { - type: 'boolean', - default: true, - description: 'Enabled/disable autocomplete suggestions.', - scope: 'language-overridable', - }, - 'typescript.suggest.enabled': { - type: 'boolean', - default: true, - description: 'Enabled/disable autocomplete suggestions.', - scope: 'language-overridable', - }, - 'typescript.surveys.enabled': { - type: 'boolean', - default: true, - description: "Enabled/disable occasional surveys that help us improve VS Code's JavaScript and TypeScript support.", - scope: 'window', - }, - 'typescript.tsserver.useSeparateSyntaxServer': { - type: 'boolean', - default: true, - description: 'Enable/disable spawning a separate TypeScript server that can more quickly respond to syntax related operations, such as calculating folding or computing document symbols.', - markdownDeprecationMessage: 'This setting has been deprecated in favor of `typescript.tsserver.useSyntaxServer`.', - scope: 'window', - }, - 'typescript.tsserver.useSyntaxServer': { - type: 'string', - scope: 'window', - description: 'Controls if TypeScript launches a dedicated server to more quickly handle syntax related operations, such as computing code folding.', - default: 'auto', - enum: [ - 'always', - 'never', - 'auto', - ], - enumDescriptions: [ - 'Use a lighter weight syntax server to handle all IntelliSense operations. This syntax server can only provide IntelliSense for opened files.', - "Don't use a dedicated syntax server. Use a single server to handle all IntelliSense operations.", - 'Spawn both a full server and a lighter weight server dedicated to syntax operations. The syntax server is used to speed up syntax operations and provide IntelliSense while projects are loading.', - ], - }, - 'typescript.tsserver.maxTsServerMemory': { - type: 'number', - default: 3072, - description: 'The maximum amount of memory (in MB) to allocate to the TypeScript server process.', - scope: 'window', - }, - 'typescript.tsserver.experimental.enableProjectDiagnostics': { - type: 'boolean', - default: false, - description: '(Experimental) Enables project wide error reporting.', - scope: 'window', - tags: [ - 'experimental', - ], - }, - 'typescript.tsserver.watchOptions': { - type: 'object', - description: 'Configure which watching strategies should be used to keep track of files and directories.', - scope: 'window', - properties: { - watchFile: { - type: 'string', - description: 'Strategy for how individual files are watched.', - enum: [ - 'fixedChunkSizePolling', - 'fixedPollingInterval', - 'priorityPollingInterval', - 'dynamicPriorityPolling', - 'useFsEvents', - 'useFsEventsOnParentDirectory', - ], - enumDescriptions: [ - 'Polls files in chunks at regular interval.', - 'Check every file for changes several times a second at a fixed interval.', - 'Check every file for changes several times a second, but use heuristics to check certain types of files less frequently than others.', - 'Use a dynamic queue where less-frequently modified files will be checked less often.', - "Attempt to use the operating system/file system's native events for file changes.", - "Attempt to use the operating system/file system's native events to listen for changes on a file's containing directories. This can use fewer file watchers, but might be less accurate.", - ], - default: 'useFsEvents', - }, - watchDirectory: { - type: 'string', - description: 'Strategy for how entire directory trees are watched under systems that lack recursive file-watching functionality.', - enum: [ - 'fixedChunkSizePolling', - 'fixedPollingInterval', - 'dynamicPriorityPolling', - 'useFsEvents', - ], - enumDescriptions: [ - 'Polls directories in chunks at regular interval.', - 'Check every directory for changes several times a second at a fixed interval.', - 'Use a dynamic queue where less-frequently modified directories will be checked less often.', - "Attempt to use the operating system/file system's native events for directory changes.", - ], - default: 'useFsEvents', - }, - fallbackPolling: { - type: 'string', - description: "When using file system events, this option specifies the polling strategy that gets used when the system runs out of native file watchers and/or doesn't support native file watchers.", - enum: [ - 'fixedPollingInterval', - 'priorityPollingInterval', - 'dynamicPriorityPolling', - ], - enumDescriptions: [ - 'configuration.tsserver.watchOptions.fallbackPolling.fixedPollingInterval', - 'configuration.tsserver.watchOptions.fallbackPolling.priorityPollingInterval', - 'configuration.tsserver.watchOptions.fallbackPolling.dynamicPriorityPolling', - ], - }, - synchronousWatchDirectory: { - type: 'boolean', - description: 'Disable deferred watching on directories. Deferred watching is useful when lots of file changes might occur at once (e.g. a change in node_modules from running npm install), but you might want to disable it with this flag for some less-common setups.', - }, - }, - }, - 'typescript.workspaceSymbols.scope': { - type: 'string', - enum: [ - 'allOpenProjects', - 'currentProject', - ], - enumDescriptions: [ - 'Search all open JavaScript or TypeScript projects for symbols.', - 'Only search for symbols in the current JavaScript or TypeScript project.', - ], - default: 'allOpenProjects', - markdownDescription: 'Controls which files are searched by [Go to Symbol in Workspace](https://code.visualstudio.com/docs/editor/editingevolved#_open-symbol-by-name).', - scope: 'window', - }, - 'javascript.suggest.classMemberSnippets.enabled': { - type: 'boolean', - default: true, - description: 'Enable/disable snippet completions for class members.', - scope: 'resource', - }, - 'typescript.suggest.classMemberSnippets.enabled': { - type: 'boolean', - default: true, - description: 'Enable/disable snippet completions for class members.', - scope: 'resource', - }, - 'typescript.suggest.objectLiteralMethodSnippets.enabled': { - type: 'boolean', - default: true, - description: 'Enable/disable snippet completions for methods in object literals. Requires using TypeScript 4.7+ in the workspace.', - scope: 'resource', - }, - 'typescript.experimental.tsserver.web.enableProjectWideIntellisense': { - type: 'boolean', - default: false, - description: 'Enable/disable project-wide IntelliSense on web. Requires that VS Code is running in a trusted context.', - scope: 'window', - tags: [ - 'experimental', - ], - }, - }, - }, - ], - configurationDefaults: undefined, - commands: [ - { - command: 'typescript.reloadProjects', - title: 'Reload Project', - originalTitle: undefined, - category: 'TypeScript', - iconUrl: undefined, - themeIcon: undefined, - enablement: undefined, - }, - { - command: 'javascript.reloadProjects', - title: 'Reload Project', - originalTitle: undefined, - category: 'JavaScript', - iconUrl: undefined, - themeIcon: undefined, - enablement: undefined, - }, - { - command: 'typescript.selectTypeScriptVersion', - title: 'Select TypeScript Version...', - originalTitle: undefined, - category: 'TypeScript', - iconUrl: undefined, - themeIcon: undefined, - enablement: undefined, - }, - { - command: 'typescript.goToProjectConfig', - title: 'Go to Project Configuration', - originalTitle: undefined, - category: 'TypeScript', - iconUrl: undefined, - themeIcon: undefined, - enablement: undefined, - }, - { - command: 'javascript.goToProjectConfig', - title: 'Go to Project Configuration', - originalTitle: undefined, - category: 'JavaScript', - iconUrl: undefined, - themeIcon: undefined, - enablement: undefined, - }, - { - command: 'typescript.openTsServerLog', - title: 'Open TS Server log', - originalTitle: undefined, - category: 'TypeScript', - iconUrl: undefined, - themeIcon: undefined, - enablement: undefined, - }, - { - command: 'typescript.restartTsServer', - title: 'Restart TS Server', - originalTitle: undefined, - category: 'TypeScript', - iconUrl: undefined, - themeIcon: undefined, - enablement: undefined, - }, - { - command: 'typescript.findAllFileReferences', - title: 'Find File References', - originalTitle: undefined, - category: 'TypeScript', - iconUrl: undefined, - themeIcon: undefined, - enablement: undefined, - }, - { - command: 'typescript.goToSourceDefinition', - title: 'Go to Source Definition', - originalTitle: undefined, - category: 'TypeScript', - iconUrl: undefined, - themeIcon: undefined, - enablement: undefined, - }, - { - command: 'typescript.sortImports', - title: 'Sort Imports', - originalTitle: undefined, - category: 'TypeScript', - iconUrl: undefined, - themeIcon: undefined, - enablement: undefined, - }, - { - command: 'javascript.sortImports', - title: 'Sort Imports', - originalTitle: undefined, - category: 'JavaScript', - iconUrl: undefined, - themeIcon: undefined, - enablement: undefined, - }, - { - command: 'typescript.removeUnusedImports', - title: 'Remove Unused Imports', - originalTitle: undefined, - category: 'TypeScript', - iconUrl: undefined, - themeIcon: undefined, - enablement: undefined, - }, - { - command: 'javascript.removeUnusedImports', - title: 'Remove Unused Imports', - originalTitle: undefined, - category: 'JavaScript', - iconUrl: undefined, - themeIcon: undefined, - enablement: undefined, - }, - ], - menus: { - commandPalette: [ - { - command: 'typescript.reloadProjects', - submenu: undefined, - alt: undefined, - group: undefined, - when: 'editorLangId == typescript && typescript.isManagedFile', - }, - { - command: 'typescript.reloadProjects', - submenu: undefined, - alt: undefined, - group: undefined, - when: 'editorLangId == typescriptreact && typescript.isManagedFile', - }, - { - command: 'javascript.reloadProjects', - submenu: undefined, - alt: undefined, - group: undefined, - when: 'editorLangId == javascript && typescript.isManagedFile', - }, - { - command: 'javascript.reloadProjects', - submenu: undefined, - alt: undefined, - group: undefined, - when: 'editorLangId == javascriptreact && typescript.isManagedFile', - }, - { - command: 'typescript.goToProjectConfig', - submenu: undefined, - alt: undefined, - group: undefined, - when: 'editorLangId == typescript && typescript.isManagedFile', - }, - { - command: 'typescript.goToProjectConfig', - submenu: undefined, - alt: undefined, - group: undefined, - when: 'editorLangId == typescriptreact', - }, - { - command: 'javascript.goToProjectConfig', - submenu: undefined, - alt: undefined, - group: undefined, - when: 'editorLangId == javascript && typescript.isManagedFile', - }, - { - command: 'javascript.goToProjectConfig', - submenu: undefined, - alt: undefined, - group: undefined, - when: 'editorLangId == javascriptreact && typescript.isManagedFile', - }, - { - command: 'typescript.selectTypeScriptVersion', - submenu: undefined, - alt: undefined, - group: undefined, - when: 'typescript.isManagedFile', - }, - { - command: 'typescript.openTsServerLog', - submenu: undefined, - alt: undefined, - group: undefined, - when: 'typescript.isManagedFile', - }, - { - command: 'typescript.restartTsServer', - submenu: undefined, - alt: undefined, - group: undefined, - when: 'typescript.isManagedFile', - }, - { - command: 'typescript.findAllFileReferences', - submenu: undefined, - alt: undefined, - group: undefined, - when: 'tsSupportsFileReferences && typescript.isManagedFile', - }, - { - command: 'typescript.goToSourceDefinition', - submenu: undefined, - alt: undefined, - group: undefined, - when: 'tsSupportsSourceDefinition && typescript.isManagedFile', - }, - { - command: 'typescript.sortImports', - submenu: undefined, - alt: undefined, - group: undefined, - when: 'supportedCodeAction =~ /(\\s|^)source\\.sortImports\\b/ && editorLangId =~ /^typescript(react)?$/', - }, - { - command: 'javascript.sortImports', - submenu: undefined, - alt: undefined, - group: undefined, - when: 'supportedCodeAction =~ /(\\s|^)source\\.sortImports\\b/ && editorLangId =~ /^javascript(react)?$/', - }, - { - command: 'typescript.removeUnusedImports', - submenu: undefined, - alt: undefined, - group: undefined, - when: 'supportedCodeAction =~ /(\\s|^)source\\.removeUnusedImports\\b/ && editorLangId =~ /^typescript(react)?$/', - }, - { - command: 'javascript.removeUnusedImports', - submenu: undefined, - alt: undefined, - group: undefined, - when: 'supportedCodeAction =~ /(\\s|^)source\\.removeUnusedImports\\b/ && editorLangId =~ /^javascript(react)?$/', - }, - ], - 'editor/context': [ - { - command: 'typescript.goToSourceDefinition', - submenu: undefined, - alt: undefined, - group: 'navigation@9', - when: 'tsSupportsSourceDefinition && resourceLangId == typescript', - }, - { - command: 'typescript.goToSourceDefinition', - submenu: undefined, - alt: undefined, - group: 'navigation@9', - when: 'tsSupportsSourceDefinition && resourceLangId == typescriptreact', - }, - { - command: 'typescript.goToSourceDefinition', - submenu: undefined, - alt: undefined, - group: 'navigation@9', - when: 'tsSupportsSourceDefinition && resourceLangId == javascript', - }, - { - command: 'typescript.goToSourceDefinition', - submenu: undefined, - alt: undefined, - group: 'navigation@9', - when: 'tsSupportsSourceDefinition && resourceLangId == javascriptreact', - }, - ], - 'explorer/context': [ - { - command: 'typescript.findAllFileReferences', - submenu: undefined, - alt: undefined, - group: '4_search', - when: 'tsSupportsFileReferences && resourceLangId == typescript', - }, - { - command: 'typescript.findAllFileReferences', - submenu: undefined, - alt: undefined, - group: '4_search', - when: 'tsSupportsFileReferences && resourceLangId == typescriptreact', - }, - { - command: 'typescript.findAllFileReferences', - submenu: undefined, - alt: undefined, - group: '4_search', - when: 'tsSupportsFileReferences && resourceLangId == javascript', - }, - { - command: 'typescript.findAllFileReferences', - submenu: undefined, - alt: undefined, - group: '4_search', - when: 'tsSupportsFileReferences && resourceLangId == javascriptreact', - }, - ], - 'editor/title/context': [ - { - command: 'typescript.findAllFileReferences', - submenu: undefined, - alt: undefined, - group: undefined, - when: 'tsSupportsFileReferences && resourceLangId == javascript', - }, - { - command: 'typescript.findAllFileReferences', - submenu: undefined, - alt: undefined, - group: undefined, - when: 'tsSupportsFileReferences && resourceLangId == javascriptreact', - }, - { - command: 'typescript.findAllFileReferences', - submenu: undefined, - alt: undefined, - group: undefined, - when: 'tsSupportsFileReferences && resourceLangId == typescript', - }, - { - command: 'typescript.findAllFileReferences', - submenu: undefined, - alt: undefined, - group: undefined, - when: 'tsSupportsFileReferences && resourceLangId == typescriptreact', - }, - ], - }, - taskDefinitions: [ - { - taskType: 'typescript', - source: 'typescript-language-features', - properties: { - required: [ - 'tsconfig', - ], - all: [ - 'tsconfig', - 'option', - ], - schema: { - type: 'object', - required: [ - 'tsconfig', - ], - properties: { - tsconfig: { - type: 'string', - description: 'The tsconfig file that defines the TS build.', - }, - option: { - type: 'string', - }, - type: { - type: 'string', - const: 'typescript', - }, - }, - when: 'shellExecutionSupported', - }, - }, - }, - ], - problemMatchers: [ - { - name: 'tsc', - label: 'TypeScript problems', - owner: 'typescript', - source: 'ts', - applyTo: 'closedDocuments', - fileLocation: [ - 'relative', - '${cwd}', - ], - pattern: '$tsc', - }, - { - name: 'tsc-watch', - label: 'TypeScript problems (watch mode)', - owner: 'typescript', - source: 'ts', - applyTo: 'closedDocuments', - fileLocation: [ - 'relative', - '${cwd}', - ], - pattern: '$tsc', - background: { - activeOnStart: true, - beginsPattern: { - regexp: '^\\s*(?:message TS6032:|\\[?\\D*.{1,2}[:.].{1,2}[:.].{1,2}\\D*(├\\D*\\d{1,2}\\D+┤)?(?:\\]| -)) (Starting compilation in watch mode|File change detected\\. Starting incremental compilation)\\.\\.\\.', - }, - endsPattern: { - regexp: '^\\s*(?:message TS6042:|\\[?\\D*.{1,2}[:.].{1,2}[:.].{1,2}\\D*(├\\D*\\d{1,2}\\D+┤)?(?:\\]| -)) (?:Compilation complete\\.|Found \\d+ errors?\\.) Watching for file changes\\.', - }, - }, - }, - ], - problemPatterns: [ - { - name: 'tsc', - regexp: '^([^\\s].*)[\\(:](\\d+)[,:](\\d+)(?:\\):\\s+|\\s+-\\s+)(error|warning|info)\\s+TS(\\d+)\\s*:\\s*(.*)$', - file: 1, - line: 2, - column: 3, - severity: 4, - code: 5, - message: 6, - }, - ], - resourceLabelFormatters: undefined, - authentication: undefined, - notebooks: undefined, - snippets: undefined, - themes: undefined, - iconThemes: undefined, - colors: undefined, - localizations: undefined, - terminalProfiles: undefined, - }, - }, - { - metadata: { - host: 'main', - model: { - packagePath: '/home/tobias/Git/OpenSource/theia/theia/plugins/ts-base/extension', - packageUri: 'file:///home/tobias/Git/OpenSource/theia/theia/plugins/ts-base/extension', - id: 'vscode.typescript', - name: 'typescript', - publisher: 'vscode', - version: '1.88.1', - displayName: 'TypeScript Language Basics (built-in)', - description: 'Provides snippets, syntax highlighting, bracket matching and folding in TypeScript files.', - engine: { - type: 'vscode', - version: '*', - }, - entryPoint: { - backend: undefined, - }, - iconUrl: undefined, - l10n: undefined, - readmeUrl: 'hostedPlugin/vscode_typescript/.%2FREADME.md', - licenseUrl: 'hostedPlugin/vscode_typescript/.%2FLICENSE', + 'model': { + 'packagePath': '/theia/plugins/demo-plugin', // Deprecated + 'packageUri': 'file:///theia/plugins/demo-plugin', // TODO Path to the plugin + 'id': 'theia.demo-plugin', + 'name': 'demo-plugin', + 'publisher': 'theia', + 'version': '0.0.1', + 'displayName': 'theia.demo-plugin', + 'description': '', + 'engine': { + 'type': 'theiaPlugin', + 'version': 'next' + }, + 'entryPoint': { + 'frontend': 'dist/demo-plugin-frontend.js' + } }, - lifecycle: { - startMethod: 'activate', - stopMethod: 'deactivate', - frontendModuleName: 'vscode_typescript', - frontendInitPath: 'plugin-vscode-init-fe.js', - backendInitPath: '/home/tobias/Git/OpenSource/theia/theia/examples/browser/lib/backend/plugin-vscode-init', + 'lifecycle': { + 'startMethod': 'start', + 'stopMethod': 'stop', + 'frontendModuleName': 'theia_demo_plugin', + 'backendInitPath': '/theia/examples/browser/lib/backend/backend-init-theia' // TODO Path to the backend initialization file }, - outOfSync: false, - isUnderDevelopment: false, - }, - type: 0, - contributes: { - activationEvents: [ - 'onLanguage:typescript', - 'onLanguage:typescriptreact', - 'onLanguage:jsonc', - 'onLanguage:json', - ], - configurationDefaults: undefined, - languages: [ - { - id: 'typescript', - aliases: [ - 'TypeScript', - 'ts', - 'typescript', - ], - extensions: [ - '.ts', - '.cts', - '.mts', - ], - filenamePatterns: undefined, - filenames: undefined, - firstLine: undefined, - mimetypes: undefined, - configuration: { - brackets: [ - [ - '${', - '}', - ], - [ - '{', - '}', - ], - [ - '[', - ']', - ], - [ - '(', - ')', - ], - ], - comments: { - lineComment: '//', - blockComment: [ - '/*', - '*/', - ], - }, - folding: { - markers: { - start: '^\\s*//\\s*#?region\\b', - end: '^\\s*//\\s*#?endregion\\b', - }, - }, - wordPattern: { - pattern: "(-?\\d*\\.\\d\\w*)|([^\\`\\@\\~\\!\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>/\\?\\s]+)", - }, - autoClosingPairs: [ - { - open: '{', - close: '}', - notIn: undefined, - }, - { - open: '[', - close: ']', - notIn: undefined, - }, - { - open: '(', - close: ')', - notIn: undefined, - }, - { - open: "'", - close: "'", - notIn: [ - 'string', - 'comment', - ], - }, - { - open: '"', - close: '"', - notIn: [ - 'string', - ], - }, - { - open: '`', - close: '`', - notIn: [ - 'string', - 'comment', - ], - }, - { - open: '/**', - close: ' */', - notIn: [ - 'string', - ], - }, - ], - indentationRules: { - decreaseIndentPattern: { - pattern: '^((?!.*?/\\*).*\\*/)?\\s*[\\}\\]].*$', - }, - increaseIndentPattern: { - pattern: "^((?!//).)*(\\{([^}\"'`/]*|(\\t|[ ])*//.*)|\\([^)\"'`/]*|\\[[^\\]\"'`/]*)$", - }, - unIndentedLinePattern: { - pattern: '^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$', - }, - }, - surroundingPairs: [ - { - open: '{', - close: '}', - }, - { - open: '[', - close: ']', - }, - { - open: '(', - close: ')', - }, - { - open: "'", - close: "'", - }, - { - open: '"', - close: '"', - }, - { - open: '`', - close: '`', - }, - { - open: '<', - close: '>', - }, - ], - onEnterRules: [ - { - beforeText: { - pattern: '^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$', - }, - afterText: { - pattern: '^\\s*\\*/$', - }, - action: { - indent: 'indentOutdent', - appendText: ' * ', - }, - }, - { - beforeText: { - pattern: '^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$', - }, - action: { - indent: 'none', - appendText: ' * ', - }, - }, - { - beforeText: { - pattern: '^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$', - }, - previousLineText: { - pattern: '(?=^(\\s*(/\\*\\*|\\*)).*)(?=(?!(\\s*\\*/)))', - }, - action: { - indent: 'none', - appendText: '* ', - }, - }, - { - beforeText: { - pattern: '^(\\t|[ ])*[ ]\\*/\\s*$', - }, - action: { - indent: 'none', - removeText: 1, - }, - }, - { - beforeText: { - pattern: '^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$', - }, - action: { - indent: 'none', - removeText: 1, - }, - }, - { - beforeText: { - pattern: '^\\s*(\\bcase\\s.+:|\\bdefault:)$', - }, - afterText: { - pattern: '^(?!\\s*(\\bcase\\b|\\bdefault\\b))', - }, - action: { - indent: 'indent', - }, - }, - ], - }, - }, - { - id: 'typescriptreact', - aliases: [ - 'TypeScript JSX', - 'TypeScript React', - 'tsx', - ], - extensions: [ - '.tsx', - ], - filenamePatterns: undefined, - filenames: undefined, - firstLine: undefined, - mimetypes: undefined, - configuration: { - brackets: [ - [ - '${', - '}', - ], - [ - '{', - '}', - ], - [ - '[', - ']', - ], - [ - '(', - ')', - ], - ], - comments: { - lineComment: '//', - blockComment: [ - '/*', - '*/', - ], - }, - folding: { - markers: { - start: '^\\s*//\\s*#?region\\b', - end: '^\\s*//\\s*#?endregion\\b', - }, - }, - wordPattern: { - pattern: "(-?\\d*\\.\\d\\w*)|([^\\`\\@\\~\\!\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>/\\?\\s]+)", - }, - autoClosingPairs: [ - { - open: '{', - close: '}', - notIn: undefined, - }, - { - open: '[', - close: ']', - notIn: undefined, - }, - { - open: '(', - close: ')', - notIn: undefined, - }, - { - open: "'", - close: "'", - notIn: [ - 'string', - 'comment', - ], - }, - { - open: '"', - close: '"', - notIn: [ - 'string', - ], - }, - { - open: '`', - close: '`', - notIn: [ - 'string', - 'comment', - ], - }, - { - open: '/**', - close: ' */', - notIn: [ - 'string', - ], - }, - ], - indentationRules: { - decreaseIndentPattern: { - pattern: '^((?!.*?/\\*).*\\*/)?\\s*[\\}\\]].*$', - }, - increaseIndentPattern: { - pattern: "^((?!//).)*(\\{([^}\"'`/]*|(\\t|[ ])*//.*)|\\([^)\"'`/]*|\\[[^\\]\"'`/]*)$", - }, - unIndentedLinePattern: { - pattern: '^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$', - }, - }, - surroundingPairs: [ - { - open: '{', - close: '}', - }, - { - open: '[', - close: ']', - }, - { - open: '(', - close: ')', - }, - { - open: "'", - close: "'", - }, - { - open: '"', - close: '"', - }, - { - open: '`', - close: '`', - }, - { - open: '<', - close: '>', - }, - ], - onEnterRules: [ - { - beforeText: { - pattern: '^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$', - }, - afterText: { - pattern: '^\\s*\\*/$', - }, - action: { - indent: 'indentOutdent', - appendText: ' * ', - }, - }, - { - beforeText: { - pattern: '^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$', - }, - action: { - indent: 'none', - appendText: ' * ', - }, - }, - { - beforeText: { - pattern: '^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$', - }, - previousLineText: { - pattern: '(?=^(\\s*(/\\*\\*|\\*)).*)(?=(?!(\\s*\\*/)))', - }, - action: { - indent: 'none', - appendText: '* ', - }, - }, - { - beforeText: { - pattern: '^(\\t|[ ])*[ ]\\*/\\s*$', - }, - action: { - indent: 'none', - removeText: 1, - }, - }, - { - beforeText: { - pattern: '^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$', - }, - action: { - indent: 'none', - removeText: 1, - }, - }, - { - beforeText: { - pattern: '^\\s*(\\bcase\\s.+:|\\bdefault:)$', - }, - afterText: { - pattern: '^(?!\\s*(\\bcase\\b|\\bdefault\\b))', - }, - action: { - indent: 'indent', - }, - }, - ], - }, - }, - { - id: 'jsonc', - aliases: undefined, - extensions: undefined, - filenamePatterns: [ - 'tsconfig.*.json', - 'jsconfig.*.json', - 'tsconfig-*.json', - 'jsconfig-*.json', - ], - filenames: [ - 'tsconfig.json', - 'jsconfig.json', - ], - firstLine: undefined, - mimetypes: undefined, - }, - { - id: 'json', - aliases: undefined, - extensions: undefined, - filenamePatterns: undefined, - filenames: [ - 'tsconfig.tsbuildinfo', - ], - firstLine: undefined, - mimetypes: undefined, - }, - ], - grammars: [ - { - language: 'typescript', - scope: 'source.ts', - format: 'json', - grammar: { - information_for_contributors: [ - 'This file has been converted from https://github.com/microsoft/TypeScript-TmLanguage/blob/master/TypeScript.tmLanguage', - 'If you want to provide a fix or improvement, please create a pull request against the original repository.', - 'Once accepted there, we are happy to receive an update request.', - ], - version: 'https://github.com/microsoft/TypeScript-TmLanguage/commit/0d73d1117e0a9b1d6635ebbe9aa37d615171b02d', - name: 'TypeScript', - scopeName: 'source.ts', - patterns: [ - { - include: '#directives', - }, - { - include: '#statements', - }, - { - include: '#shebang', - }, - ], - repository: { - shebang: { - name: 'comment.line.shebang.ts', - match: '\\A(#!).*(?=$)', - captures: { - '1': { - name: 'punctuation.definition.comment.ts', - }, - }, - }, - statements: { - patterns: [ - { - include: '#declaration', - }, - { - include: '#control-statement', - }, - { - include: '#after-operator-block-as-object-literal', - }, - { - include: '#decl-block', - }, - { - include: '#label', - }, - { - include: '#expression', - }, - { - include: '#punctuation-semicolon', - }, - { - include: '#string', - }, - { - include: '#comment', - }, - ], - }, - declaration: { - patterns: [ - { - include: '#decorator', - }, - { - include: '#var-expr', - }, - { - include: '#function-declaration', - }, - { - include: '#class-declaration', - }, - { - include: '#interface-declaration', - }, - { - include: '#enum-declaration', - }, - { - include: '#namespace-declaration', - }, - { - include: '#type-alias-declaration', - }, - { - include: '#import-equals-declaration', - }, - { - include: '#import-declaration', - }, - { - include: '#export-declaration', - }, - { - name: 'storage.modifier.ts', - match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", - beginCaptures: { - '1': { - name: 'meta.definition.variable.ts entity.name.function.ts', - }, - '2': { - name: 'keyword.operator.definiteassignment.ts', - }, - }, - end: '(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", - beginCaptures: { - '1': { - name: 'meta.definition.variable.ts variable.other.constant.ts entity.name.function.ts', - }, - }, - end: '(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", - captures: { - '1': { - name: 'storage.modifier.ts', - }, - '2': { - name: 'keyword.operator.rest.ts', - }, - '3': { - name: 'entity.name.function.ts variable.language.this.ts', - }, - '4': { - name: 'entity.name.function.ts', - }, - '5': { - name: 'keyword.operator.optional.ts', - }, - }, - }, - { - match: '(?x)(?:(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", - captures: { - '1': { - name: 'meta.definition.property.ts entity.name.function.ts', - }, - '2': { - name: 'keyword.operator.optional.ts', - }, - '3': { - name: 'keyword.operator.definiteassignment.ts', - }, - }, - }, - { - name: 'meta.definition.property.ts variable.object.property.ts', - match: '\\#?[_$[:alpha:]][_$[:alnum:]]*', - }, - { - name: 'keyword.operator.optional.ts', - match: '\\?', - }, - { - name: 'keyword.operator.definiteassignment.ts', - match: '\\!', - }, - ], - }, - 'variable-initializer': { - patterns: [ - { - begin: '(?\\s*$)', - beginCaptures: { - '1': { - name: 'keyword.operator.assignment.ts', - }, - }, - end: '(?=$|^|[,);}\\]]|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])', - beginCaptures: { - '1': { - name: 'storage.modifier.ts', - }, - '2': { - name: 'storage.modifier.ts', - }, - '3': { - name: 'storage.modifier.ts', - }, - '4': { - name: 'storage.modifier.async.ts', - }, - '5': { - name: 'keyword.operator.new.ts', - }, - '6': { - name: 'keyword.generator.asterisk.ts', - }, - }, - end: '(?=\\}|;|,|$)|(?<=\\})', - patterns: [ - { - include: '#method-declaration-name', - }, - { - include: '#function-body', - }, - ], - }, - { - name: 'meta.method.declaration.ts', - begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", - beginCaptures: { - '1': { - name: 'storage.modifier.ts', - }, - '2': { - name: 'storage.modifier.ts', - }, - '3': { - name: 'storage.modifier.ts', - }, - '4': { - name: 'storage.modifier.async.ts', - }, - '5': { - name: 'storage.type.property.ts', - }, - '6': { - name: 'keyword.generator.asterisk.ts', - }, - }, - end: '(?=\\}|;|,|$)|(?<=\\})', - patterns: [ - { - include: '#method-declaration-name', - }, - { - include: '#function-body', - }, - ], - }, - ], - }, - 'object-literal-method-declaration': { - name: 'meta.method.declaration.ts', - begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", - beginCaptures: { - '1': { - name: 'storage.modifier.async.ts', - }, - '2': { - name: 'storage.type.property.ts', - }, - '3': { - name: 'keyword.generator.asterisk.ts', - }, - }, - end: '(?=\\}|;|,)|(?<=\\})', - patterns: [ - { - include: '#method-declaration-name', - }, - { - include: '#function-body', - }, - { - begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", - beginCaptures: { - '1': { - name: 'storage.modifier.async.ts', - }, - '2': { - name: 'storage.type.property.ts', - }, - '3': { - name: 'keyword.generator.asterisk.ts', - }, - }, - end: '(?=\\(|\\<)', - patterns: [ - { - include: '#method-declaration-name', - }, - ], - }, - ], - }, - 'method-declaration-name': { - begin: "(?x)(?=((\\b(?)', - captures: { - '1': { - name: 'storage.modifier.async.ts', - }, - '2': { - name: 'variable.parameter.ts', - }, - }, - }, - { - name: 'meta.arrow.ts', - begin: "(?x) (?:\n (? is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n )\n)", - beginCaptures: { - '1': { - name: 'storage.modifier.async.ts', - }, - }, - end: '(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', - patterns: [ - { - include: '#comment', - }, - { - include: '#type-parameters', - }, - { - include: '#function-parameters', - }, - { - include: '#arrow-return-type', - }, - { - include: '#possibly-arrow-return-type', - }, - ], - }, - { - name: 'meta.arrow.ts', - begin: '=>', - beginCaptures: { - '0': { - name: 'storage.type.function.arrow.ts', - }, - }, - end: '((?<=\\}|\\S)(?)|((?!\\{)(?=\\S)))(?!\\/[\\/\\*])', - patterns: [ - { - include: '#single-line-comment-consuming-line-ending', - }, - { - include: '#decl-block', - }, - { - include: '#expression', - }, - ], - }, - ], - }, - 'indexer-declaration': { - name: 'meta.indexer.declaration.ts', - begin: '(?:(?]|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^yield|[^\\._$[:alnum:]]yield|^throw|[^\\._$[:alnum:]]throw|^in|[^\\._$[:alnum:]]in|^of|[^\\._$[:alnum:]]of|^typeof|[^\\._$[:alnum:]]typeof|&&|\\|\\||\\*)\\s*(\\{)', - beginCaptures: { - '1': { - name: 'punctuation.definition.block.ts', - }, - }, - end: '\\}', - endCaptures: { - '0': { - name: 'punctuation.definition.block.ts', - }, - }, - patterns: [ - { - include: '#object-member', - }, - ], - }, - 'object-literal': { - name: 'meta.objectliteral.ts', - begin: '\\{', - beginCaptures: { - '0': { - name: 'punctuation.definition.block.ts', - }, - }, - end: '\\}', - endCaptures: { - '0': { - name: 'punctuation.definition.block.ts', - }, - }, - patterns: [ - { - include: '#object-member', - }, - ], - }, - 'object-member': { - patterns: [ - { - include: '#comment', - }, - { - include: '#object-literal-method-declaration', - }, - { - name: 'meta.object.member.ts meta.object-literal.key.ts', - begin: '(?=\\[)', - end: '(?=:)|((?<=[\\]])(?=\\s*[\\(\\<]))', - patterns: [ - { - include: '#comment', - }, - { - include: '#array-literal', - }, - ], - }, - { - name: 'meta.object.member.ts meta.object-literal.key.ts', - begin: "(?=[\\'\\\"\\`])", - end: "(?=:)|((?<=[\\'\\\"\\`])(?=((\\s*[\\(\\<,}])|(\\s+(as|satisifies)\\s+))))", - patterns: [ - { - include: '#comment', - }, - { - include: '#string', - }, - ], - }, - { - name: 'meta.object.member.ts meta.object-literal.key.ts', - begin: '(?x)(?=(\\b(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", - captures: { - '0': { - name: 'meta.object-literal.key.ts', - }, - '1': { - name: 'entity.name.function.ts', - }, - }, - }, - { - name: 'meta.object.member.ts', - match: '(?:[_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:)', - captures: { - '0': { - name: 'meta.object-literal.key.ts', - }, - }, - }, - { - name: 'meta.object.member.ts', - begin: '\\.\\.\\.', - beginCaptures: { - '0': { - name: 'keyword.operator.spread.ts', - }, - }, - end: '(?=,|\\})', - patterns: [ - { - include: '#expression', - }, - ], - }, - { - name: 'meta.object.member.ts', - match: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=,|\\}|$|\\/\\/|\\/\\*)', - captures: { - '1': { - name: 'variable.other.readwrite.ts', - }, - }, - }, - { - name: 'meta.object.member.ts', - match: '(?]|\\|\\||\\&\\&|\\!\\=\\=|$|^|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', - beginCaptures: { - '1': { - name: 'storage.modifier.async.ts', - }, - }, - end: '(?<=\\))', - patterns: [ - { - include: '#type-parameters', - }, - { - begin: '\\(', - beginCaptures: { - '0': { - name: 'meta.brace.round.ts', - }, - }, - end: '\\)', - endCaptures: { - '0': { - name: 'meta.brace.round.ts', - }, - }, - patterns: [ - { - include: '#expression-inside-possibly-arrow-parens', - }, - ], - }, - ], - }, - { - begin: '(?<=:)\\s*(async)?\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', - beginCaptures: { - '1': { - name: 'storage.modifier.async.ts', - }, - '2': { - name: 'meta.brace.round.ts', - }, - }, - end: '\\)', - endCaptures: { - '0': { - name: 'meta.brace.round.ts', - }, - }, - patterns: [ - { - include: '#expression-inside-possibly-arrow-parens', - }, - ], - }, - { - begin: '(?<=:)\\s*(async)?\\s*(?=\\<\\s*$)', - beginCaptures: { - '1': { - name: 'storage.modifier.async.ts', - }, - }, - end: '(?<=\\>)', - patterns: [ - { - include: '#type-parameters', - }, - ], - }, - { - begin: '(?<=\\>)\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', - beginCaptures: { - '1': { - name: 'meta.brace.round.ts', - }, - }, - end: '\\)', - endCaptures: { - '0': { - name: 'meta.brace.round.ts', - }, - }, - patterns: [ - { - include: '#expression-inside-possibly-arrow-parens', - }, - ], - }, - { - include: '#possibly-arrow-return-type', - }, - { - include: '#expression', - }, - ], - }, - { - include: '#punctuation-comma', - }, - { - include: '#decl-block', - }, - ], - }, - 'ternary-expression': { - begin: '(?!\\?\\.\\s*[^[:digit:]])(\\?)(?!\\?)', - beginCaptures: { - '1': { - name: 'keyword.operator.ternary.ts', - }, - }, - end: '\\s*(:)', - endCaptures: { - '1': { - name: 'keyword.operator.ternary.ts', - }, - }, - patterns: [ - { - include: '#expression', - }, - ], - }, - 'function-call': { - patterns: [ - { - begin: "(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", - end: "(?<=\\))(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", - patterns: [ - { - name: 'meta.function-call.ts', - begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))', - end: "(?=\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", - patterns: [ - { - include: '#function-call-target', - }, - ], - }, - { - include: '#comment', - }, - { - include: '#function-call-optionals', - }, - { - include: '#type-arguments', - }, - { - include: '#paren-expression', - }, - ], - }, - { - begin: '(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))(<\\s*[\\{\\[\\(]\\s*$))', - end: '(?<=\\>)(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))(<\\s*[\\{\\[\\(]\\s*$))', - patterns: [ - { - name: 'meta.function-call.ts', - begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))', - end: '(?=(<\\s*[\\{\\[\\(]\\s*$))', - patterns: [ - { - include: '#function-call-target', - }, - ], - }, - { - include: '#comment', - }, - { - include: '#function-call-optionals', - }, - { - include: '#type-arguments', - }, - ], - }, - ], - }, - 'function-call-target': { - patterns: [ - { - include: '#support-function-call-identifiers', - }, - { - name: 'entity.name.function.ts', - match: '(\\#?[_$[:alpha:]][_$[:alnum:]]*)', - }, - ], - }, - 'function-call-optionals': { - patterns: [ - { - name: 'meta.function-call.ts punctuation.accessor.optional.ts', - match: '\\?\\.', - }, - { - name: 'meta.function-call.ts keyword.operator.definiteassignment.ts', - match: '\\!', - }, - ], - }, - 'support-function-call-identifiers': { - patterns: [ - { - include: '#literal', - }, - { - include: '#support-objects', - }, - { - include: '#object-identifiers', - }, - { - include: '#punctuation-accessor', - }, - { - name: 'keyword.operator.expression.import.ts', - match: "(?:(?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|(===|!==|==|!=)|(([\\&\\~\\^\\|]\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s+instanceof(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', - beginCaptures: { - '1': { - name: 'storage.modifier.async.ts', - }, - }, - end: '(?<=\\))', - patterns: [ - { - include: '#paren-expression-possibly-arrow-with-typeparameters', - }, - ], - }, - { - begin: '(?<=[(=,]|=>|^return|[^\\._$[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\()|(<)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)))\\s*$)', - beginCaptures: { - '1': { - name: 'storage.modifier.async.ts', - }, - }, - end: '(?<=\\))', - patterns: [ - { - include: '#paren-expression-possibly-arrow-with-typeparameters', - }, - ], - }, - { - include: '#possibly-arrow-return-type', - }, - ], - }, - 'paren-expression-possibly-arrow-with-typeparameters': { - patterns: [ - { - include: '#type-parameters', - }, - { - begin: '\\(', - beginCaptures: { - '0': { - name: 'meta.brace.round.ts', - }, - }, - end: '\\)', - endCaptures: { - '0': { - name: 'meta.brace.round.ts', - }, - }, - patterns: [ - { - include: '#expression-inside-possibly-arrow-parens', - }, - ], - }, - ], - }, - 'expression-inside-possibly-arrow-parens': { - patterns: [ - { - include: '#expressionWithoutIdentifiers', - }, - { - include: '#comment', - }, - { - include: '#string', - }, - { - include: '#decorator', - }, - { - include: '#destructuring-parameter', - }, - { - match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", - captures: { - '1': { - name: 'storage.modifier.ts', - }, - '2': { - name: 'keyword.operator.rest.ts', - }, - '3': { - name: 'entity.name.function.ts variable.language.this.ts', - }, - '4': { - name: 'entity.name.function.ts', - }, - '5': { - name: 'keyword.operator.optional.ts', - }, - }, - }, - { - match: '(?x)(?:(?)', - captures: { - '1': { - name: 'meta.brace.angle.ts', - }, - '2': { - name: 'storage.modifier.ts', - }, - '3': { - name: 'meta.brace.angle.ts', - }, - }, - }, - { - name: 'cast.expr.ts', - begin: '(?:(?*?\\&\\|\\^]|[^_$[:alnum:]](?:\\+\\+|\\-\\-)|[^\\+]\\+|[^\\-]\\-))\\s*(<)(?!)', - endCaptures: { - '1': { - name: 'meta.brace.angle.ts', - }, - }, - patterns: [ - { - include: '#type', - }, - ], - }, - { - name: 'cast.expr.ts', - begin: '(?:(?<=^))\\s*(<)(?=[_$[:alpha:]][_$[:alnum:]]*\\s*>)', - beginCaptures: { - '1': { - name: 'meta.brace.angle.ts', - }, - }, - end: '(\\>)', - endCaptures: { - '1': { - name: 'meta.brace.angle.ts', - }, - }, - patterns: [ - { - include: '#type', - }, - ], - }, - ], - }, - 'expression-operators': { - patterns: [ - { - name: 'keyword.control.flow.ts', - match: '(?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?>=|>>>=|\\|=', - }, - { - name: 'keyword.operator.bitwise.shift.ts', - match: '<<|>>>|>>', - }, - { - name: 'keyword.operator.comparison.ts', - match: '===|!==|==|!=', - }, - { - name: 'keyword.operator.relational.ts', - match: '<=|>=|<>|<|>', - }, - { - match: '(?<=[_$[:alnum:]])(\\!)\\s*(?:(/=)|(?:(/)(?![/*])))', - captures: { - '1': { - name: 'keyword.operator.logical.ts', - }, - '2': { - name: 'keyword.operator.assignment.compound.ts', - }, - '3': { - name: 'keyword.operator.arithmetic.ts', - }, - }, - }, - { - name: 'keyword.operator.logical.ts', - match: '\\!|&&|\\|\\||\\?\\?', - }, - { - name: 'keyword.operator.bitwise.ts', - match: '\\&|~|\\^|\\|', - }, - { - name: 'keyword.operator.assignment.ts', - match: '\\=', - }, - { - name: 'keyword.operator.decrement.ts', - match: '--', - }, - { - name: 'keyword.operator.increment.ts', - match: '\\+\\+', - }, - { - name: 'keyword.operator.arithmetic.ts', - match: '%|\\*|/|-|\\+', - }, - { - begin: '(?<=[_$[:alnum:])\\]])\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)+(?:(/=)|(?:(/)(?![/*]))))', - end: '(?:(/=)|(?:(/)(?!\\*([^\\*]|(\\*[^\\/]))*\\*\\/)))', - endCaptures: { - '1': { - name: 'keyword.operator.assignment.compound.ts', - }, - '2': { - name: 'keyword.operator.arithmetic.ts', - }, - }, - patterns: [ - { - include: '#comment', - }, - ], - }, - { - match: '(?<=[_$[:alnum:])\\]])\\s*(?:(/=)|(?:(/)(?![/*])))', - captures: { - '1': { - name: 'keyword.operator.assignment.compound.ts', - }, - '2': { - name: 'keyword.operator.arithmetic.ts', - }, - }, - }, - ], - }, - 'typeof-operator': { - begin: '(?:&|{\\?]|(extends\\s+)|$|;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))', - patterns: [ - { - include: '#type-arguments', - }, - { - include: '#expression', - }, - ], - }, - literal: { - patterns: [ - { - include: '#numeric-literal', - }, - { - include: '#boolean-literal', - }, - { - include: '#null-literal', - }, - { - include: '#undefined-literal', - }, - { - include: '#numericConstant-literal', - }, - { - include: '#array-literal', - }, - { - include: '#this-literal', - }, - { - include: '#super-literal', - }, - ], - }, - 'array-literal': { - name: 'meta.array.literal.ts', - begin: '\\s*(\\[)', - beginCaptures: { - '1': { - name: 'meta.brace.square.ts', - }, - }, - end: '\\]', - endCaptures: { - '0': { - name: 'meta.brace.square.ts', - }, - }, - patterns: [ - { - include: '#expression', - }, - { - include: '#punctuation-comma', - }, - ], - }, - 'numeric-literal': { - patterns: [ - { - name: 'constant.numeric.hex.ts', - match: '\\b(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\\())\n |\n (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$)))', - captures: { - '1': { - name: 'punctuation.accessor.ts', - }, - '2': { - name: 'punctuation.accessor.optional.ts', - }, - '3': { - name: 'support.variable.property.ts', - }, - '4': { - name: 'support.constant.ts', - }, - }, - }, - { - match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n))", - captures: { - '1': { - name: 'punctuation.accessor.ts', - }, - '2': { - name: 'punctuation.accessor.optional.ts', - }, - '3': { - name: 'entity.name.function.ts', - }, - }, - }, - { - match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])', - captures: { - '1': { - name: 'punctuation.accessor.ts', - }, - '2': { - name: 'punctuation.accessor.optional.ts', - }, - '3': { - name: 'variable.other.constant.property.ts', - }, - }, - }, - { - match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*)', - captures: { - '1': { - name: 'punctuation.accessor.ts', - }, - '2': { - name: 'punctuation.accessor.optional.ts', - }, - '3': { - name: 'variable.other.property.ts', - }, - }, - }, - { - name: 'variable.other.constant.ts', - match: '([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])', - }, - { - name: 'variable.other.readwrite.ts', - match: '[_$[:alpha:]][_$[:alnum:]]*', - }, - ], - }, - 'object-identifiers': { - patterns: [ - { - name: 'support.class.ts', - match: '([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\??\\.\\s*prototype\\b(?!\\$))', - }, - { - match: '(?x)(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n (\\#?[[:upper:]][_$[:digit:][:upper:]]*) |\n (\\#?[_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)', - captures: { - '1': { - name: 'punctuation.accessor.ts', - }, - '2': { - name: 'punctuation.accessor.optional.ts', - }, - '3': { - name: 'variable.other.constant.object.property.ts', - }, - '4': { - name: 'variable.other.object.property.ts', - }, - }, - }, - { - match: '(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)', - captures: { - '1': { - name: 'variable.other.constant.object.ts', - }, - '2': { - name: 'variable.other.object.ts', - }, - }, - }, - ], - }, - 'type-annotation': { - patterns: [ - { - name: 'meta.type.annotation.ts', - begin: '(:)(?=\\s*\\S)', - beginCaptures: { - '1': { - name: 'keyword.operator.type.annotation.ts', - }, - }, - end: '(?])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))', - patterns: [ - { - include: '#type', - }, - ], - }, - { - name: 'meta.type.annotation.ts', - begin: '(:)', - beginCaptures: { - '1': { - name: 'keyword.operator.type.annotation.ts', - }, - }, - end: '(?])|(?=^\\s*$)|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))', - patterns: [ - { - include: '#type', - }, - ], - }, - ], - }, - 'parameter-type-annotation': { - patterns: [ - { - name: 'meta.type.annotation.ts', - begin: '(:)', - beginCaptures: { - '1': { - name: 'keyword.operator.type.annotation.ts', - }, - }, - end: '(?=[,)])|(?==[^>])', - patterns: [ - { - include: '#type', - }, - ], - }, - ], - }, - 'return-type': { - patterns: [ - { - name: 'meta.return.type.ts', - begin: '(?<=\\))\\s*(:)(?=\\s*\\S)', - beginCaptures: { - '1': { - name: 'keyword.operator.type.annotation.ts', - }, - }, - end: '(?|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', - patterns: [ - { - include: '#arrow-return-type-body', - }, - ], - }, - 'possibly-arrow-return-type': { - begin: '(?<=\\)|^)\\s*(:)(?=\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*=>)', - beginCaptures: { - '1': { - name: 'meta.arrow.ts meta.return.type.arrow.ts keyword.operator.type.annotation.ts', - }, - }, - end: '(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', - contentName: 'meta.arrow.ts meta.return.type.arrow.ts', - patterns: [ - { - include: '#arrow-return-type-body', - }, - ], - }, - 'arrow-return-type-body': { - patterns: [ - { - begin: '(?<=[:])(?=\\s*\\{)', - end: '(?<=\\})', - patterns: [ - { - include: '#type-object', - }, - ], - }, - { - include: '#type-predicate-operator', - }, - { - include: '#type', - }, - ], - }, - 'type-parameters': { - name: 'meta.type.parameters.ts', - begin: '(<)', - beginCaptures: { - '1': { - name: 'punctuation.definition.typeparameters.begin.ts', - }, - }, - end: '(>)', - endCaptures: { - '1': { - name: 'punctuation.definition.typeparameters.end.ts', - }, - }, - patterns: [ - { - include: '#comment', - }, - { - name: 'storage.modifier.ts', - match: '(?)', - }, - ], - }, - 'type-arguments': { - name: 'meta.type.parameters.ts', - begin: '\\<', - beginCaptures: { - '0': { - name: 'punctuation.definition.typeparameters.begin.ts', - }, - }, - end: '\\>', - endCaptures: { - '0': { - name: 'punctuation.definition.typeparameters.end.ts', - }, - }, - patterns: [ - { - include: '#type-arguments-body', - }, - ], - }, - 'type-arguments-body': { - patterns: [ - { - match: '(?)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))))', - captures: { - '1': { - name: 'storage.modifier.ts', - }, - '2': { - name: 'keyword.operator.rest.ts', - }, - '3': { - name: 'entity.name.function.ts variable.language.this.ts', - }, - '4': { - name: 'entity.name.function.ts', - }, - '5': { - name: 'keyword.operator.optional.ts', - }, - }, - }, - { - match: '(?x)(?:(?)', - patterns: [ - { - include: '#comment', - }, - { - include: '#type-parameters', - }, - ], - }, - { - name: 'meta.type.constructor.ts', - begin: '(?)\n ))\n )\n )\n)', - end: '(?<=\\))', - patterns: [ - { - include: '#function-parameters', - }, - ], - }, - ], - }, - 'type-function-return-type': { - patterns: [ - { - name: 'meta.type.function.return.ts', - begin: '(=>)(?=\\s*\\S)', - beginCaptures: { - '1': { - name: 'storage.type.function.arrow.ts', - }, - }, - end: '(?)(?:\\?]|//|$)', - patterns: [ - { - include: '#type-function-return-type-core', - }, - ], - }, - { - name: 'meta.type.function.return.ts', - begin: '=>', - beginCaptures: { - '0': { - name: 'storage.type.function.arrow.ts', - }, - }, - end: '(?)(?]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))', - patterns: [ - { - include: '#type-function-return-type-core', - }, - ], - }, - ], - }, - 'type-function-return-type-core': { - patterns: [ - { - include: '#comment', - }, - { - begin: '(?<==>)(?=\\s*\\{)', - end: '(?<=\\})', - patterns: [ - { - include: '#type-object', - }, - ], - }, - { - include: '#type-predicate-operator', - }, - { - include: '#type', - }, - ], - }, - 'type-operators': { - patterns: [ - { - include: '#typeof-operator', - }, - { - include: '#type-infer', - }, - { - begin: '([&|])(?=\\s*\\{)', - beginCaptures: { - '0': { - name: 'keyword.operator.type.ts', - }, - }, - end: '(?<=\\})', - patterns: [ - { - include: '#type-object', - }, - ], - }, - { - begin: '[&|]', - beginCaptures: { - '0': { - name: 'keyword.operator.type.ts', - }, - }, - end: '(?=\\S)', - }, - { - name: 'keyword.operator.expression.keyof.ts', - match: '(?)', - endCaptures: { - '1': { - name: 'meta.type.parameters.ts punctuation.definition.typeparameters.end.ts', - }, - }, - contentName: 'meta.type.parameters.ts', - patterns: [ - { - include: '#type-arguments-body', - }, - ], - }, - { - begin: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(<)', - beginCaptures: { - '1': { - name: 'entity.name.type.ts', - }, - '2': { - name: 'meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts', - }, - }, - end: '(>)', - endCaptures: { - '1': { - name: 'meta.type.parameters.ts punctuation.definition.typeparameters.end.ts', - }, - }, - contentName: 'meta.type.parameters.ts', - patterns: [ - { - include: '#type-arguments-body', - }, - ], - }, - { - match: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))', - captures: { - '1': { - name: 'entity.name.type.module.ts', - }, - '2': { - name: 'punctuation.accessor.ts', - }, - '3': { - name: 'punctuation.accessor.optional.ts', - }, - }, - }, - { - name: 'entity.name.type.ts', - match: '[_$[:alpha:]][_$[:alnum:]]*', - }, - ], - }, - 'punctuation-comma': { - name: 'punctuation.separator.comma.ts', - match: ',', - }, - 'punctuation-semicolon': { - name: 'punctuation.terminator.statement.ts', - match: ';', - }, - 'punctuation-accessor': { - match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))', - captures: { - '1': { - name: 'punctuation.accessor.ts', - }, - '2': { - name: 'punctuation.accessor.optional.ts', - }, - }, - }, - string: { - patterns: [ - { - include: '#qstring-single', - }, - { - include: '#qstring-double', - }, - { - include: '#template', - }, - ], - }, - 'qstring-double': { - name: 'string.quoted.double.ts', - begin: '"', - beginCaptures: { - '0': { - name: 'punctuation.definition.string.begin.ts', - }, - }, - end: '(")|((?:[^\\\\\\n])$)', - endCaptures: { - '1': { - name: 'punctuation.definition.string.end.ts', - }, - '2': { - name: 'invalid.illegal.newline.ts', - }, - }, - patterns: [ - { - include: '#string-character-escape', - }, - ], - }, - 'qstring-single': { - name: 'string.quoted.single.ts', - begin: "'", - beginCaptures: { - '0': { - name: 'punctuation.definition.string.begin.ts', - }, - }, - end: "(\\')|((?:[^\\\\\\n])$)", - endCaptures: { - '1': { - name: 'punctuation.definition.string.end.ts', - }, - '2': { - name: 'invalid.illegal.newline.ts', - }, - }, - patterns: [ - { - include: '#string-character-escape', - }, - ], - }, - 'string-character-escape': { - name: 'constant.character.escape.ts', - match: '\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\\{[0-9A-Fa-f]+\\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)', - }, - template: { - patterns: [ - { - include: '#template-call', - }, - { - contentName: 'string.template.ts', - begin: '([_$[:alpha:]][_$[:alnum:]]*)?(`)', - beginCaptures: { - '1': { - name: 'entity.name.function.tagged-template.ts', - }, - '2': { - name: 'string.template.ts punctuation.definition.string.template.begin.ts', - }, - }, - end: '`', - endCaptures: { - '0': { - name: 'string.template.ts punctuation.definition.string.template.end.ts', - }, - }, - patterns: [ - { - include: '#template-substitution-element', - }, - { - include: '#string-character-escape', - }, - ], - }, - ], - }, - 'template-call': { - patterns: [ - { - begin: "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)", - end: '(?=`)', - patterns: [ - { - begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))', - end: "(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)", - patterns: [ - { - include: '#support-function-call-identifiers', - }, - { - name: 'entity.name.function.tagged-template.ts', - match: '([_$[:alpha:]][_$[:alnum:]]*)', - }, - ], - }, - { - include: '#type-arguments', - }, - ], - }, - { - begin: "([_$[:alpha:]][_$[:alnum:]]*)?\\s*(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)`)", - beginCaptures: { - '1': { - name: 'entity.name.function.tagged-template.ts', - }, - }, - end: '(?=`)', - patterns: [ - { - include: '#type-arguments', - }, - ], - }, - ], - }, - 'template-substitution-element': { - name: 'meta.template.expression.ts', - begin: '\\$\\{', - beginCaptures: { - '0': { - name: 'punctuation.definition.template-expression.begin.ts', - }, - }, - end: '\\}', - endCaptures: { - '0': { - name: 'punctuation.definition.template-expression.end.ts', - }, - }, - patterns: [ - { - include: '#expression', - }, - ], - contentName: 'meta.embedded.line.ts', - }, - 'type-string': { - patterns: [ - { - include: '#qstring-single', - }, - { - include: '#qstring-double', - }, - { - include: '#template-type', - }, - ], - }, - 'template-type': { - patterns: [ - { - include: '#template-call', - }, - { - contentName: 'string.template.ts', - begin: '([_$[:alpha:]][_$[:alnum:]]*)?(`)', - beginCaptures: { - '1': { - name: 'entity.name.function.tagged-template.ts', - }, - '2': { - name: 'string.template.ts punctuation.definition.string.template.begin.ts', - }, - }, - end: '`', - endCaptures: { - '0': { - name: 'string.template.ts punctuation.definition.string.template.end.ts', - }, - }, - patterns: [ - { - include: '#template-type-substitution-element', - }, - { - include: '#string-character-escape', - }, - ], - }, - ], - }, - 'template-type-substitution-element': { - name: 'meta.template.expression.ts', - begin: '\\$\\{', - beginCaptures: { - '0': { - name: 'punctuation.definition.template-expression.begin.ts', - }, - }, - end: '\\}', - endCaptures: { - '0': { - name: 'punctuation.definition.template-expression.end.ts', - }, - }, - patterns: [ - { - include: '#type', - }, - ], - contentName: 'meta.embedded.line.ts', - }, - regex: { - patterns: [ - { - name: 'string.regexp.ts', - begin: '(?|&&|\\|\\||\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[\\()]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\]|\\(([^\\)\\\\]|\\\\.)+\\))+\\/([dgimsuy]+|(?![\\/\\*])|(?=\\/\\*))(?!\\s*[a-zA-Z0-9_$]))', - beginCaptures: { - '1': { - name: 'punctuation.definition.string.begin.ts', - }, - }, - end: '(/)([dgimsuy]*)', - endCaptures: { - '1': { - name: 'punctuation.definition.string.end.ts', - }, - '2': { - name: 'keyword.other.ts', - }, - }, - patterns: [ - { - include: '#regexp', - }, - ], - }, - { - name: 'string.regexp.ts', - begin: '((?', - captures: { - '0': { - name: 'keyword.other.back-reference.regexp', - }, - '1': { - name: 'variable.other.regexp', - }, - }, - }, - { - name: 'keyword.operator.quantifier.regexp', - match: '[?+*]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??', - }, - { - name: 'keyword.operator.or.regexp', - match: '\\|', - }, - { - name: 'meta.group.assertion.regexp', - begin: '(\\()((\\?=)|(\\?!)|(\\?<=)|(\\?))?', - beginCaptures: { - '0': { - name: 'punctuation.definition.group.regexp', - }, - '1': { - name: 'punctuation.definition.group.no-capture.regexp', - }, - '2': { - name: 'variable.other.regexp', - }, - }, - end: '\\)', - endCaptures: { - '0': { - name: 'punctuation.definition.group.regexp', - }, - }, - patterns: [ - { - include: '#regexp', - }, - ], - }, - { - name: 'constant.other.character-class.set.regexp', - begin: '(\\[)(\\^)?', - beginCaptures: { - '1': { - name: 'punctuation.definition.character-class.regexp', - }, - '2': { - name: 'keyword.operator.negation.regexp', - }, - }, - end: '(\\])', - endCaptures: { - '1': { - name: 'punctuation.definition.character-class.regexp', - }, - }, - patterns: [ - { - name: 'constant.other.character-class.range.regexp', - match: '(?:.|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))\\-(?:[^\\]\\\\]|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))', - captures: { - '1': { - name: 'constant.character.numeric.regexp', - }, - '2': { - name: 'constant.character.control.regexp', - }, - '3': { - name: 'constant.character.escape.backslash.regexp', - }, - '4': { - name: 'constant.character.numeric.regexp', - }, - '5': { - name: 'constant.character.control.regexp', - }, - '6': { - name: 'constant.character.escape.backslash.regexp', - }, - }, - }, - { - include: '#regex-character-class', - }, - ], - }, - { - include: '#regex-character-class', - }, - ], - }, - 'regex-character-class': { - patterns: [ - { - name: 'constant.other.character-class.regexp', - match: '\\\\[wWsSdDtrnvf]|\\.', - }, - { - name: 'constant.character.numeric.regexp', - match: '\\\\([0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4})', - }, - { - name: 'constant.character.control.regexp', - match: '\\\\c[A-Z]', - }, - { - name: 'constant.character.escape.backslash.regexp', - match: '\\\\.', - }, - ], - }, - comment: { - patterns: [ - { - name: 'comment.block.documentation.ts', - begin: '/\\*\\*(?!/)', - beginCaptures: { - '0': { - name: 'punctuation.definition.comment.ts', - }, - }, - end: '\\*/', - endCaptures: { - '0': { - name: 'punctuation.definition.comment.ts', - }, - }, - patterns: [ - { - include: '#docblock', - }, - ], - }, - { - name: 'comment.block.ts', - begin: '(/\\*)(?:\\s*((@)internal)(?=\\s|(\\*/)))?', - beginCaptures: { - '1': { - name: 'punctuation.definition.comment.ts', - }, - '2': { - name: 'storage.type.internaldeclaration.ts', - }, - '3': { - name: 'punctuation.decorator.internaldeclaration.ts', - }, - }, - end: '\\*/', - endCaptures: { - '0': { - name: 'punctuation.definition.comment.ts', - }, - }, - }, - { - begin: '(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)', - beginCaptures: { - '1': { - name: 'punctuation.whitespace.comment.leading.ts', - }, - '2': { - name: 'comment.line.double-slash.ts', - }, - '3': { - name: 'punctuation.definition.comment.ts', - }, - '4': { - name: 'storage.type.internaldeclaration.ts', - }, - '5': { - name: 'punctuation.decorator.internaldeclaration.ts', - }, - }, - end: '(?=$)', - contentName: 'comment.line.double-slash.ts', - }, - ], - }, - 'single-line-comment-consuming-line-ending': { - begin: '(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)', - beginCaptures: { - '1': { - name: 'punctuation.whitespace.comment.leading.ts', - }, - '2': { - name: 'comment.line.double-slash.ts', - }, - '3': { - name: 'punctuation.definition.comment.ts', - }, - '4': { - name: 'storage.type.internaldeclaration.ts', - }, - '5': { - name: 'punctuation.decorator.internaldeclaration.ts', - }, - }, - end: '(?=^)', - contentName: 'comment.line.double-slash.ts', - }, - directives: { - name: 'comment.line.triple-slash.directive.ts', - begin: "^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|lib|name|resolution-mode)\\s*=\\s*((\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)))+\\s*/>\\s*$)", - beginCaptures: { - '1': { - name: 'punctuation.definition.comment.ts', - }, - }, - end: '(?=$)', - patterns: [ - { - name: 'meta.tag.ts', - begin: '(<)(reference|amd-dependency|amd-module)', - beginCaptures: { - '1': { - name: 'punctuation.definition.tag.directive.ts', - }, - '2': { - name: 'entity.name.tag.directive.ts', - }, - }, - end: '/>', - endCaptures: { - '0': { - name: 'punctuation.definition.tag.directive.ts', - }, - }, - patterns: [ - { - name: 'entity.other.attribute-name.directive.ts', - match: 'path|types|no-default-lib|lib|name|resolution-mode', - }, - { - name: 'keyword.operator.assignment.ts', - match: '=', - }, - { - include: '#string', - }, - ], - }, - ], - }, - docblock: { - patterns: [ - { - match: '(?x)\n((@)(?:access|api))\n\\s+\n(private|protected|public)\n\\b', - captures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - '3': { - name: 'constant.language.access-type.jsdoc', - }, - }, - }, - { - match: '(?x)\n((@)author)\n\\s+\n(\n [^@\\s<>*/]\n (?:[^@<>*/]|\\*[^/])*\n)\n(?:\n \\s*\n (<)\n ([^>\\s]+)\n (>)\n)?', - captures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - '3': { - name: 'entity.name.type.instance.jsdoc', - }, - '4': { - name: 'punctuation.definition.bracket.angle.begin.jsdoc', - }, - '5': { - name: 'constant.other.email.link.underline.jsdoc', - }, - '6': { - name: 'punctuation.definition.bracket.angle.end.jsdoc', - }, - }, - }, - { - match: '(?x)\n((@)borrows) \\s+\n((?:[^@\\s*/]|\\*[^/])+) # \n\\s+ (as) \\s+ # as\n((?:[^@\\s*/]|\\*[^/])+) # ', - captures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - '3': { - name: 'entity.name.type.instance.jsdoc', - }, - '4': { - name: 'keyword.operator.control.jsdoc', - }, - '5': { - name: 'entity.name.type.instance.jsdoc', - }, - }, - }, - { - name: 'meta.example.jsdoc', - begin: '((@)example)\\s+', - end: '(?=@|\\*/)', - beginCaptures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - }, - patterns: [ - { - match: '^\\s\\*\\s+', - }, - { - contentName: 'constant.other.description.jsdoc', - begin: '\\G(<)caption(>)', - beginCaptures: { - '0': { - name: 'entity.name.tag.inline.jsdoc', - }, - '1': { - name: 'punctuation.definition.bracket.angle.begin.jsdoc', - }, - '2': { - name: 'punctuation.definition.bracket.angle.end.jsdoc', - }, - }, - end: '()|(?=\\*/)', - endCaptures: { - '0': { - name: 'entity.name.tag.inline.jsdoc', - }, - '1': { - name: 'punctuation.definition.bracket.angle.begin.jsdoc', - }, - '2': { - name: 'punctuation.definition.bracket.angle.end.jsdoc', - }, - }, - }, - { - match: '[^\\s@*](?:[^*]|\\*[^/])*', - captures: { - '0': { - name: 'source.embedded.ts', - }, - }, - }, - ], - }, - { - match: '(?x) ((@)kind) \\s+ (class|constant|event|external|file|function|member|mixin|module|namespace|typedef) \\b', - captures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - '3': { - name: 'constant.language.symbol-type.jsdoc', - }, - }, - }, - { - match: '(?x)\n((@)see)\n\\s+\n(?:\n # URL\n (\n (?=https?://)\n (?:[^\\s*]|\\*[^/])+\n )\n |\n # JSDoc namepath\n (\n (?!\n # Avoid matching bare URIs (also acceptable as links)\n https?://\n |\n # Avoid matching {@inline tags}; we match those below\n (?:\\[[^\\[\\]]*\\])? # Possible description [preceding]{@tag}\n {@(?:link|linkcode|linkplain|tutorial)\\b\n )\n # Matched namepath\n (?:[^@\\s*/]|\\*[^/])+\n )\n)', - captures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - '3': { - name: 'variable.other.link.underline.jsdoc', - }, - '4': { - name: 'entity.name.type.instance.jsdoc', - }, - }, - }, - { - match: '(?x)\n((@)template)\n\\s+\n# One or more valid identifiers\n(\n [A-Za-z_$] # First character: non-numeric word character\n [\\w$.\\[\\]]* # Rest of identifier\n (?: # Possible list of additional identifiers\n \\s* , \\s*\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n )*\n)', - captures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - '3': { - name: 'variable.other.jsdoc', - }, - }, - }, - { - begin: '(?x)((@)template)\\s+(?={)', - beginCaptures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - }, - end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', - patterns: [ - { - include: '#jsdoctype', - }, - { - name: 'variable.other.jsdoc', - match: '([A-Za-z_$][\\w$.\\[\\]]*)', - }, - ], - }, - { - match: '(?x)\n(\n (@)\n (?:arg|argument|const|constant|member|namespace|param|var)\n)\n\\s+\n(\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n)', - captures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - '3': { - name: 'variable.other.jsdoc', - }, - }, - }, - { - begin: '((@)typedef)\\s+(?={)', - beginCaptures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - }, - end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', - patterns: [ - { - include: '#jsdoctype', - }, - { - name: 'entity.name.type.instance.jsdoc', - match: '(?:[^@\\s*/]|\\*[^/])+', - }, - ], - }, - { - begin: '((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\\s+(?={)', - beginCaptures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - }, - end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', - patterns: [ - { - include: '#jsdoctype', - }, - { - name: 'variable.other.jsdoc', - match: '([A-Za-z_$][\\w$.\\[\\]]*)', - }, - { - name: 'variable.other.jsdoc', - match: "(?x)\n(\\[)\\s*\n[\\w$]+\n(?:\n (?:\\[\\])? # Foo[ ].bar properties within an array\n \\. # Foo.Bar namespaced parameter\n [\\w$]+\n)*\n(?:\n \\s*\n (=) # [foo=bar] Default parameter value\n \\s*\n (\n # The inner regexes are to stop the match early at */ and to not stop at escaped quotes\n (?>\n \"(?:(?:\\*(?!/))|(?:\\\\(?!\"))|[^*\\\\])*?\" | # [foo=\"bar\"] Double-quoted\n '(?:(?:\\*(?!/))|(?:\\\\(?!'))|[^*\\\\])*?' | # [foo='bar'] Single-quoted\n \\[ (?:(?:\\*(?!/))|[^*])*? \\] | # [foo=[1,2]] Array literal\n (?:(?:\\*(?!/))|\\s(?!\\s*\\])|\\[.*?(?:\\]|(?=\\*/))|[^*\\s\\[\\]])* # Everything else\n )*\n )\n)?\n\\s*(?:(\\])((?:[^*\\s]|\\*[^\\s/])+)?|(?=\\*/))", - captures: { - '1': { - name: 'punctuation.definition.optional-value.begin.bracket.square.jsdoc', - }, - '2': { - name: 'keyword.operator.assignment.jsdoc', - }, - '3': { - name: 'source.embedded.ts', - }, - '4': { - name: 'punctuation.definition.optional-value.end.bracket.square.jsdoc', - }, - '5': { - name: 'invalid.illegal.syntax.jsdoc', - }, - }, - }, - ], - }, - { - begin: '(?x)\n(\n (@)\n (?:define|enum|exception|export|extends|lends|implements|modifies\n |namespace|private|protected|returns?|satisfies|suppress|this|throws|type\n |yields?)\n)\n\\s+(?={)', - beginCaptures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - }, - end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', - patterns: [ - { - include: '#jsdoctype', - }, - ], - }, - { - match: '(?x)\n(\n (@)\n (?:alias|augments|callback|constructs|emits|event|fires|exports?\n |extends|external|function|func|host|lends|listens|interface|memberof!?\n |method|module|mixes|mixin|name|requires|see|this|typedef|uses)\n)\n\\s+\n(\n (?:\n [^{}@\\s*] | \\*[^/]\n )+\n)', - captures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - '3': { - name: 'entity.name.type.instance.jsdoc', - }, - }, - }, - { - contentName: 'variable.other.jsdoc', - begin: "((@)(?:default(?:value)?|license|version))\\s+(([''\"]))", - beginCaptures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - '3': { - name: 'variable.other.jsdoc', - }, - '4': { - name: 'punctuation.definition.string.begin.jsdoc', - }, - }, - end: '(\\3)|(?=$|\\*/)', - endCaptures: { - '0': { - name: 'variable.other.jsdoc', - }, - '1': { - name: 'punctuation.definition.string.end.jsdoc', - }, - }, - }, - { - match: '((@)(?:default(?:value)?|license|tutorial|variation|version))\\s+([^\\s*]+)', - captures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - '3': { - name: 'variable.other.jsdoc', - }, - }, - }, - { - name: 'storage.type.class.jsdoc', - match: '(?x) (@) (?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles |callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright |default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception |exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func |function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc |inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method |mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects |override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected |public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary |suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation |version|virtual|writeOnce|yields?) \\b', - captures: { - '1': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - }, - }, - { - include: '#inline-tags', - }, - { - match: '((@)(?:[_$[:alpha:]][_$[:alnum:]]*))(?=\\s+)', - captures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - }, - }, - ], - }, - brackets: { - patterns: [ - { - begin: '{', - end: '}|(?=\\*/)', - patterns: [ - { - include: '#brackets', - }, - ], - }, - { - begin: '\\[', - end: '\\]|(?=\\*/)', - patterns: [ - { - include: '#brackets', - }, - ], - }, - ], - }, - 'inline-tags': { - patterns: [ - { - name: 'constant.other.description.jsdoc', - match: '(\\[)[^\\]]+(\\])(?={@(?:link|linkcode|linkplain|tutorial))', - captures: { - '1': { - name: 'punctuation.definition.bracket.square.begin.jsdoc', - }, - '2': { - name: 'punctuation.definition.bracket.square.end.jsdoc', - }, - }, - }, - { - name: 'entity.name.type.instance.jsdoc', - begin: '({)((@)(?:link(?:code|plain)?|tutorial))\\s*', - beginCaptures: { - '1': { - name: 'punctuation.definition.bracket.curly.begin.jsdoc', - }, - '2': { - name: 'storage.type.class.jsdoc', - }, - '3': { - name: 'punctuation.definition.inline.tag.jsdoc', - }, - }, - end: '}|(?=\\*/)', - endCaptures: { - '0': { - name: 'punctuation.definition.bracket.curly.end.jsdoc', - }, - }, - patterns: [ - { - match: '\\G((?=https?://)(?:[^|}\\s*]|\\*[/])+)(\\|)?', - captures: { - '1': { - name: 'variable.other.link.underline.jsdoc', - }, - '2': { - name: 'punctuation.separator.pipe.jsdoc', - }, - }, - }, - { - match: '\\G((?:[^{}@\\s|*]|\\*[^/])+)(\\|)?', - captures: { - '1': { - name: 'variable.other.description.jsdoc', - }, - '2': { - name: 'punctuation.separator.pipe.jsdoc', - }, - }, - }, - ], - }, - ], - }, - jsdoctype: { - patterns: [ - { - contentName: 'entity.name.type.instance.jsdoc', - begin: '\\G({)', - beginCaptures: { - '0': { - name: 'entity.name.type.instance.jsdoc', - }, - '1': { - name: 'punctuation.definition.bracket.curly.begin.jsdoc', - }, - }, - end: '((}))\\s*|(?=\\*/)', - endCaptures: { - '1': { - name: 'entity.name.type.instance.jsdoc', - }, - '2': { - name: 'punctuation.definition.bracket.curly.end.jsdoc', - }, - }, - patterns: [ - { - include: '#brackets', - }, - ], - }, - ], - }, - }, - }, - grammarLocation: './syntaxes/TypeScript.tmLanguage.json', - injectTo: undefined, - embeddedLanguages: undefined, - tokenTypes: { - 'meta.template.expression': 'other', - 'meta.template.expression string': 'string', - 'meta.template.expression comment': 'comment', - 'entity.name.type.instance.jsdoc': 'other', - 'entity.name.function.tagged-template': 'other', - 'meta.import string.quoted': 'other', - 'variable.other.jsdoc': 'other', - }, - }, - { - language: 'typescriptreact', - scope: 'source.tsx', - format: 'json', - grammar: { - information_for_contributors: [ - 'This file has been converted from https://github.com/microsoft/TypeScript-TmLanguage/blob/master/TypeScriptReact.tmLanguage', - 'If you want to provide a fix or improvement, please create a pull request against the original repository.', - 'Once accepted there, we are happy to receive an update request.', - ], - version: 'https://github.com/microsoft/TypeScript-TmLanguage/commit/0d73d1117e0a9b1d6635ebbe9aa37d615171b02d', - name: 'TypeScriptReact', - scopeName: 'source.tsx', - patterns: [ - { - include: '#directives', - }, - { - include: '#statements', - }, - { - include: '#shebang', - }, - ], - repository: { - shebang: { - name: 'comment.line.shebang.tsx', - match: '\\A(#!).*(?=$)', - captures: { - '1': { - name: 'punctuation.definition.comment.tsx', - }, - }, - }, - statements: { - patterns: [ - { - include: '#declaration', - }, - { - include: '#control-statement', - }, - { - include: '#after-operator-block-as-object-literal', - }, - { - include: '#decl-block', - }, - { - include: '#label', - }, - { - include: '#expression', - }, - { - include: '#punctuation-semicolon', - }, - { - include: '#string', - }, - { - include: '#comment', - }, - ], - }, - declaration: { - patterns: [ - { - include: '#decorator', - }, - { - include: '#var-expr', - }, - { - include: '#function-declaration', - }, - { - include: '#class-declaration', - }, - { - include: '#interface-declaration', - }, - { - include: '#enum-declaration', - }, - { - include: '#namespace-declaration', - }, - { - include: '#type-alias-declaration', - }, - { - include: '#import-equals-declaration', - }, - { - include: '#import-declaration', - }, - { - include: '#export-declaration', - }, - { - name: 'storage.modifier.tsx', - match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", - beginCaptures: { - '1': { - name: 'meta.definition.variable.tsx entity.name.function.tsx', - }, - '2': { - name: 'keyword.operator.definiteassignment.tsx', - }, - }, - end: '(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", - beginCaptures: { - '1': { - name: 'meta.definition.variable.tsx variable.other.constant.tsx entity.name.function.tsx', - }, - }, - end: '(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", - captures: { - '1': { - name: 'storage.modifier.tsx', - }, - '2': { - name: 'keyword.operator.rest.tsx', - }, - '3': { - name: 'entity.name.function.tsx variable.language.this.tsx', - }, - '4': { - name: 'entity.name.function.tsx', - }, - '5': { - name: 'keyword.operator.optional.tsx', - }, - }, - }, - { - match: '(?x)(?:(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", - captures: { - '1': { - name: 'meta.definition.property.tsx entity.name.function.tsx', - }, - '2': { - name: 'keyword.operator.optional.tsx', - }, - '3': { - name: 'keyword.operator.definiteassignment.tsx', - }, - }, - }, - { - name: 'meta.definition.property.tsx variable.object.property.tsx', - match: '\\#?[_$[:alpha:]][_$[:alnum:]]*', - }, - { - name: 'keyword.operator.optional.tsx', - match: '\\?', - }, - { - name: 'keyword.operator.definiteassignment.tsx', - match: '\\!', - }, - ], - }, - 'variable-initializer': { - patterns: [ - { - begin: '(?\\s*$)', - beginCaptures: { - '1': { - name: 'keyword.operator.assignment.tsx', - }, - }, - end: '(?=$|^|[,);}\\]]|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])', - beginCaptures: { - '1': { - name: 'storage.modifier.tsx', - }, - '2': { - name: 'storage.modifier.tsx', - }, - '3': { - name: 'storage.modifier.tsx', - }, - '4': { - name: 'storage.modifier.async.tsx', - }, - '5': { - name: 'keyword.operator.new.tsx', - }, - '6': { - name: 'keyword.generator.asterisk.tsx', - }, - }, - end: '(?=\\}|;|,|$)|(?<=\\})', - patterns: [ - { - include: '#method-declaration-name', - }, - { - include: '#function-body', - }, - ], - }, - { - name: 'meta.method.declaration.tsx', - begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", - beginCaptures: { - '1': { - name: 'storage.modifier.tsx', - }, - '2': { - name: 'storage.modifier.tsx', - }, - '3': { - name: 'storage.modifier.tsx', - }, - '4': { - name: 'storage.modifier.async.tsx', - }, - '5': { - name: 'storage.type.property.tsx', - }, - '6': { - name: 'keyword.generator.asterisk.tsx', - }, - }, - end: '(?=\\}|;|,|$)|(?<=\\})', - patterns: [ - { - include: '#method-declaration-name', - }, - { - include: '#function-body', - }, - ], - }, - ], - }, - 'object-literal-method-declaration': { - name: 'meta.method.declaration.tsx', - begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", - beginCaptures: { - '1': { - name: 'storage.modifier.async.tsx', - }, - '2': { - name: 'storage.type.property.tsx', - }, - '3': { - name: 'keyword.generator.asterisk.tsx', - }, - }, - end: '(?=\\}|;|,)|(?<=\\})', - patterns: [ - { - include: '#method-declaration-name', - }, - { - include: '#function-body', - }, - { - begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", - beginCaptures: { - '1': { - name: 'storage.modifier.async.tsx', - }, - '2': { - name: 'storage.type.property.tsx', - }, - '3': { - name: 'keyword.generator.asterisk.tsx', - }, - }, - end: '(?=\\(|\\<)', - patterns: [ - { - include: '#method-declaration-name', - }, - ], - }, - ], - }, - 'method-declaration-name': { - begin: "(?x)(?=((\\b(?)', - captures: { - '1': { - name: 'storage.modifier.async.tsx', - }, - '2': { - name: 'variable.parameter.tsx', - }, - }, - }, - { - name: 'meta.arrow.tsx', - begin: "(?x) (?:\n (? is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n )\n)", - beginCaptures: { - '1': { - name: 'storage.modifier.async.tsx', - }, - }, - end: '(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', - patterns: [ - { - include: '#comment', - }, - { - include: '#type-parameters', - }, - { - include: '#function-parameters', - }, - { - include: '#arrow-return-type', - }, - { - include: '#possibly-arrow-return-type', - }, - ], - }, - { - name: 'meta.arrow.tsx', - begin: '=>', - beginCaptures: { - '0': { - name: 'storage.type.function.arrow.tsx', - }, - }, - end: '((?<=\\}|\\S)(?)|((?!\\{)(?=\\S)))(?!\\/[\\/\\*])', - patterns: [ - { - include: '#single-line-comment-consuming-line-ending', - }, - { - include: '#decl-block', - }, - { - include: '#expression', - }, - ], - }, - ], - }, - 'indexer-declaration': { - name: 'meta.indexer.declaration.tsx', - begin: '(?:(?]|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^yield|[^\\._$[:alnum:]]yield|^throw|[^\\._$[:alnum:]]throw|^in|[^\\._$[:alnum:]]in|^of|[^\\._$[:alnum:]]of|^typeof|[^\\._$[:alnum:]]typeof|&&|\\|\\||\\*)\\s*(\\{)', - beginCaptures: { - '1': { - name: 'punctuation.definition.block.tsx', - }, - }, - end: '\\}', - endCaptures: { - '0': { - name: 'punctuation.definition.block.tsx', - }, - }, - patterns: [ - { - include: '#object-member', - }, - ], - }, - 'object-literal': { - name: 'meta.objectliteral.tsx', - begin: '\\{', - beginCaptures: { - '0': { - name: 'punctuation.definition.block.tsx', - }, - }, - end: '\\}', - endCaptures: { - '0': { - name: 'punctuation.definition.block.tsx', - }, - }, - patterns: [ - { - include: '#object-member', - }, - ], - }, - 'object-member': { - patterns: [ - { - include: '#comment', - }, - { - include: '#object-literal-method-declaration', - }, - { - name: 'meta.object.member.tsx meta.object-literal.key.tsx', - begin: '(?=\\[)', - end: '(?=:)|((?<=[\\]])(?=\\s*[\\(\\<]))', - patterns: [ - { - include: '#comment', - }, - { - include: '#array-literal', - }, - ], - }, - { - name: 'meta.object.member.tsx meta.object-literal.key.tsx', - begin: "(?=[\\'\\\"\\`])", - end: "(?=:)|((?<=[\\'\\\"\\`])(?=((\\s*[\\(\\<,}])|(\\s+(as|satisifies)\\s+))))", - patterns: [ - { - include: '#comment', - }, - { - include: '#string', - }, - ], - }, - { - name: 'meta.object.member.tsx meta.object-literal.key.tsx', - begin: '(?x)(?=(\\b(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", - captures: { - '0': { - name: 'meta.object-literal.key.tsx', - }, - '1': { - name: 'entity.name.function.tsx', - }, - }, - }, - { - name: 'meta.object.member.tsx', - match: '(?:[_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:)', - captures: { - '0': { - name: 'meta.object-literal.key.tsx', - }, - }, - }, - { - name: 'meta.object.member.tsx', - begin: '\\.\\.\\.', - beginCaptures: { - '0': { - name: 'keyword.operator.spread.tsx', - }, - }, - end: '(?=,|\\})', - patterns: [ - { - include: '#expression', - }, - ], - }, - { - name: 'meta.object.member.tsx', - match: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=,|\\}|$|\\/\\/|\\/\\*)', - captures: { - '1': { - name: 'variable.other.readwrite.tsx', - }, - }, - }, - { - name: 'meta.object.member.tsx', - match: '(?]|\\|\\||\\&\\&|\\!\\=\\=|$|^|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', - beginCaptures: { - '1': { - name: 'storage.modifier.async.tsx', - }, - }, - end: '(?<=\\))', - patterns: [ - { - include: '#type-parameters', - }, - { - begin: '\\(', - beginCaptures: { - '0': { - name: 'meta.brace.round.tsx', - }, - }, - end: '\\)', - endCaptures: { - '0': { - name: 'meta.brace.round.tsx', - }, - }, - patterns: [ - { - include: '#expression-inside-possibly-arrow-parens', - }, - ], - }, - ], - }, - { - begin: '(?<=:)\\s*(async)?\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', - beginCaptures: { - '1': { - name: 'storage.modifier.async.tsx', - }, - '2': { - name: 'meta.brace.round.tsx', - }, - }, - end: '\\)', - endCaptures: { - '0': { - name: 'meta.brace.round.tsx', - }, - }, - patterns: [ - { - include: '#expression-inside-possibly-arrow-parens', - }, - ], - }, - { - begin: '(?<=:)\\s*(async)?\\s*(?=\\<\\s*$)', - beginCaptures: { - '1': { - name: 'storage.modifier.async.tsx', - }, - }, - end: '(?<=\\>)', - patterns: [ - { - include: '#type-parameters', - }, - ], - }, - { - begin: '(?<=\\>)\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', - beginCaptures: { - '1': { - name: 'meta.brace.round.tsx', - }, - }, - end: '\\)', - endCaptures: { - '0': { - name: 'meta.brace.round.tsx', - }, - }, - patterns: [ - { - include: '#expression-inside-possibly-arrow-parens', - }, - ], - }, - { - include: '#possibly-arrow-return-type', - }, - { - include: '#expression', - }, - ], - }, - { - include: '#punctuation-comma', - }, - { - include: '#decl-block', - }, - ], - }, - 'ternary-expression': { - begin: '(?!\\?\\.\\s*[^[:digit:]])(\\?)(?!\\?)', - beginCaptures: { - '1': { - name: 'keyword.operator.ternary.tsx', - }, - }, - end: '\\s*(:)', - endCaptures: { - '1': { - name: 'keyword.operator.ternary.tsx', - }, - }, - patterns: [ - { - include: '#expression', - }, - ], - }, - 'function-call': { - patterns: [ - { - begin: "(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", - end: "(?<=\\))(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", - patterns: [ - { - name: 'meta.function-call.tsx', - begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))', - end: "(?=\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", - patterns: [ - { - include: '#function-call-target', - }, - ], - }, - { - include: '#comment', - }, - { - include: '#function-call-optionals', - }, - { - include: '#type-arguments', - }, - { - include: '#paren-expression', - }, - ], - }, - { - begin: '(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))(<\\s*[\\{\\[\\(]\\s*$))', - end: '(?<=\\>)(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))(<\\s*[\\{\\[\\(]\\s*$))', - patterns: [ - { - name: 'meta.function-call.tsx', - begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))', - end: '(?=(<\\s*[\\{\\[\\(]\\s*$))', - patterns: [ - { - include: '#function-call-target', - }, - ], - }, - { - include: '#comment', - }, - { - include: '#function-call-optionals', - }, - { - include: '#type-arguments', - }, - ], - }, - ], - }, - 'function-call-target': { - patterns: [ - { - include: '#support-function-call-identifiers', - }, - { - name: 'entity.name.function.tsx', - match: '(\\#?[_$[:alpha:]][_$[:alnum:]]*)', - }, - ], - }, - 'function-call-optionals': { - patterns: [ - { - name: 'meta.function-call.tsx punctuation.accessor.optional.tsx', - match: '\\?\\.', - }, - { - name: 'meta.function-call.tsx keyword.operator.definiteassignment.tsx', - match: '\\!', - }, - ], - }, - 'support-function-call-identifiers': { - patterns: [ - { - include: '#literal', - }, - { - include: '#support-objects', - }, - { - include: '#object-identifiers', - }, - { - include: '#punctuation-accessor', - }, - { - name: 'keyword.operator.expression.import.tsx', - match: "(?:(?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|(===|!==|==|!=)|(([\\&\\~\\^\\|]\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s+instanceof(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', - beginCaptures: { - '1': { - name: 'storage.modifier.async.tsx', - }, - }, - end: '(?<=\\))', - patterns: [ - { - include: '#paren-expression-possibly-arrow-with-typeparameters', - }, - ], - }, - { - begin: '(?<=[(=,]|=>|^return|[^\\._$[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\()|(<)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)))\\s*$)', - beginCaptures: { - '1': { - name: 'storage.modifier.async.tsx', - }, - }, - end: '(?<=\\))', - patterns: [ - { - include: '#paren-expression-possibly-arrow-with-typeparameters', - }, - ], - }, - { - include: '#possibly-arrow-return-type', - }, - ], - }, - 'paren-expression-possibly-arrow-with-typeparameters': { - patterns: [ - { - include: '#type-parameters', - }, - { - begin: '\\(', - beginCaptures: { - '0': { - name: 'meta.brace.round.tsx', - }, - }, - end: '\\)', - endCaptures: { - '0': { - name: 'meta.brace.round.tsx', - }, - }, - patterns: [ - { - include: '#expression-inside-possibly-arrow-parens', - }, - ], - }, - ], - }, - 'expression-inside-possibly-arrow-parens': { - patterns: [ - { - include: '#expressionWithoutIdentifiers', - }, - { - include: '#comment', - }, - { - include: '#string', - }, - { - include: '#decorator', - }, - { - include: '#destructuring-parameter', - }, - { - match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", - captures: { - '1': { - name: 'storage.modifier.tsx', - }, - '2': { - name: 'keyword.operator.rest.tsx', - }, - '3': { - name: 'entity.name.function.tsx variable.language.this.tsx', - }, - '4': { - name: 'entity.name.function.tsx', - }, - '5': { - name: 'keyword.operator.optional.tsx', - }, - }, - }, - { - match: '(?x)(?:(?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?>=|>>>=|\\|=', - }, - { - name: 'keyword.operator.bitwise.shift.tsx', - match: '<<|>>>|>>', - }, - { - name: 'keyword.operator.comparison.tsx', - match: '===|!==|==|!=', - }, - { - name: 'keyword.operator.relational.tsx', - match: '<=|>=|<>|<|>', - }, - { - match: '(?<=[_$[:alnum:]])(\\!)\\s*(?:(/=)|(?:(/)(?![/*])))', - captures: { - '1': { - name: 'keyword.operator.logical.tsx', - }, - '2': { - name: 'keyword.operator.assignment.compound.tsx', - }, - '3': { - name: 'keyword.operator.arithmetic.tsx', - }, - }, - }, - { - name: 'keyword.operator.logical.tsx', - match: '\\!|&&|\\|\\||\\?\\?', - }, - { - name: 'keyword.operator.bitwise.tsx', - match: '\\&|~|\\^|\\|', - }, - { - name: 'keyword.operator.assignment.tsx', - match: '\\=', - }, - { - name: 'keyword.operator.decrement.tsx', - match: '--', - }, - { - name: 'keyword.operator.increment.tsx', - match: '\\+\\+', - }, - { - name: 'keyword.operator.arithmetic.tsx', - match: '%|\\*|/|-|\\+', - }, - { - begin: '(?<=[_$[:alnum:])\\]])\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)+(?:(/=)|(?:(/)(?![/*]))))', - end: '(?:(/=)|(?:(/)(?!\\*([^\\*]|(\\*[^\\/]))*\\*\\/)))', - endCaptures: { - '1': { - name: 'keyword.operator.assignment.compound.tsx', - }, - '2': { - name: 'keyword.operator.arithmetic.tsx', - }, - }, - patterns: [ - { - include: '#comment', - }, - ], - }, - { - match: '(?<=[_$[:alnum:])\\]])\\s*(?:(/=)|(?:(/)(?![/*])))', - captures: { - '1': { - name: 'keyword.operator.assignment.compound.tsx', - }, - '2': { - name: 'keyword.operator.arithmetic.tsx', - }, - }, - }, - ], - }, - 'typeof-operator': { - begin: '(?:&|{\\?]|(extends\\s+)|$|;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))', - patterns: [ - { - include: '#type-arguments', - }, - { - include: '#expression', - }, - ], - }, - literal: { - patterns: [ - { - include: '#numeric-literal', - }, - { - include: '#boolean-literal', - }, - { - include: '#null-literal', - }, - { - include: '#undefined-literal', - }, - { - include: '#numericConstant-literal', - }, - { - include: '#array-literal', - }, - { - include: '#this-literal', - }, - { - include: '#super-literal', - }, - ], - }, - 'array-literal': { - name: 'meta.array.literal.tsx', - begin: '\\s*(\\[)', - beginCaptures: { - '1': { - name: 'meta.brace.square.tsx', - }, - }, - end: '\\]', - endCaptures: { - '0': { - name: 'meta.brace.square.tsx', - }, - }, - patterns: [ - { - include: '#expression', - }, - { - include: '#punctuation-comma', - }, - ], - }, - 'numeric-literal': { - patterns: [ - { - name: 'constant.numeric.hex.tsx', - match: '\\b(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\\())\n |\n (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$)))', - captures: { - '1': { - name: 'punctuation.accessor.tsx', - }, - '2': { - name: 'punctuation.accessor.optional.tsx', - }, - '3': { - name: 'support.variable.property.tsx', - }, - '4': { - name: 'support.constant.tsx', - }, - }, - }, - { - match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n))", - captures: { - '1': { - name: 'punctuation.accessor.tsx', - }, - '2': { - name: 'punctuation.accessor.optional.tsx', - }, - '3': { - name: 'entity.name.function.tsx', - }, - }, - }, - { - match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])', - captures: { - '1': { - name: 'punctuation.accessor.tsx', - }, - '2': { - name: 'punctuation.accessor.optional.tsx', - }, - '3': { - name: 'variable.other.constant.property.tsx', - }, - }, - }, - { - match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*)', - captures: { - '1': { - name: 'punctuation.accessor.tsx', - }, - '2': { - name: 'punctuation.accessor.optional.tsx', - }, - '3': { - name: 'variable.other.property.tsx', - }, - }, - }, - { - name: 'variable.other.constant.tsx', - match: '([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])', - }, - { - name: 'variable.other.readwrite.tsx', - match: '[_$[:alpha:]][_$[:alnum:]]*', - }, - ], - }, - 'object-identifiers': { - patterns: [ - { - name: 'support.class.tsx', - match: '([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\??\\.\\s*prototype\\b(?!\\$))', - }, - { - match: '(?x)(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n (\\#?[[:upper:]][_$[:digit:][:upper:]]*) |\n (\\#?[_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)', - captures: { - '1': { - name: 'punctuation.accessor.tsx', - }, - '2': { - name: 'punctuation.accessor.optional.tsx', - }, - '3': { - name: 'variable.other.constant.object.property.tsx', - }, - '4': { - name: 'variable.other.object.property.tsx', - }, - }, - }, - { - match: '(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)', - captures: { - '1': { - name: 'variable.other.constant.object.tsx', - }, - '2': { - name: 'variable.other.object.tsx', - }, - }, - }, - ], - }, - 'type-annotation': { - patterns: [ - { - name: 'meta.type.annotation.tsx', - begin: '(:)(?=\\s*\\S)', - beginCaptures: { - '1': { - name: 'keyword.operator.type.annotation.tsx', - }, - }, - end: '(?])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))', - patterns: [ - { - include: '#type', - }, - ], - }, - { - name: 'meta.type.annotation.tsx', - begin: '(:)', - beginCaptures: { - '1': { - name: 'keyword.operator.type.annotation.tsx', - }, - }, - end: '(?])|(?=^\\s*$)|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))', - patterns: [ - { - include: '#type', - }, - ], - }, - ], - }, - 'parameter-type-annotation': { - patterns: [ - { - name: 'meta.type.annotation.tsx', - begin: '(:)', - beginCaptures: { - '1': { - name: 'keyword.operator.type.annotation.tsx', - }, - }, - end: '(?=[,)])|(?==[^>])', - patterns: [ - { - include: '#type', - }, - ], - }, - ], - }, - 'return-type': { - patterns: [ - { - name: 'meta.return.type.tsx', - begin: '(?<=\\))\\s*(:)(?=\\s*\\S)', - beginCaptures: { - '1': { - name: 'keyword.operator.type.annotation.tsx', - }, - }, - end: '(?|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', - patterns: [ - { - include: '#arrow-return-type-body', - }, - ], - }, - 'possibly-arrow-return-type': { - begin: '(?<=\\)|^)\\s*(:)(?=\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*=>)', - beginCaptures: { - '1': { - name: 'meta.arrow.tsx meta.return.type.arrow.tsx keyword.operator.type.annotation.tsx', - }, - }, - end: '(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', - contentName: 'meta.arrow.tsx meta.return.type.arrow.tsx', - patterns: [ - { - include: '#arrow-return-type-body', - }, - ], - }, - 'arrow-return-type-body': { - patterns: [ - { - begin: '(?<=[:])(?=\\s*\\{)', - end: '(?<=\\})', - patterns: [ - { - include: '#type-object', - }, - ], - }, - { - include: '#type-predicate-operator', - }, - { - include: '#type', - }, - ], - }, - 'type-parameters': { - name: 'meta.type.parameters.tsx', - begin: '(<)', - beginCaptures: { - '1': { - name: 'punctuation.definition.typeparameters.begin.tsx', - }, - }, - end: '(>)', - endCaptures: { - '1': { - name: 'punctuation.definition.typeparameters.end.tsx', - }, - }, - patterns: [ - { - include: '#comment', - }, - { - name: 'storage.modifier.tsx', - match: '(?)', - }, - ], - }, - 'type-arguments': { - name: 'meta.type.parameters.tsx', - begin: '\\<', - beginCaptures: { - '0': { - name: 'punctuation.definition.typeparameters.begin.tsx', - }, - }, - end: '\\>', - endCaptures: { - '0': { - name: 'punctuation.definition.typeparameters.end.tsx', - }, - }, - patterns: [ - { - include: '#type-arguments-body', - }, - ], - }, - 'type-arguments-body': { - patterns: [ - { - match: '(?)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))))', - captures: { - '1': { - name: 'storage.modifier.tsx', - }, - '2': { - name: 'keyword.operator.rest.tsx', - }, - '3': { - name: 'entity.name.function.tsx variable.language.this.tsx', - }, - '4': { - name: 'entity.name.function.tsx', - }, - '5': { - name: 'keyword.operator.optional.tsx', - }, - }, - }, - { - match: '(?x)(?:(?)', - patterns: [ - { - include: '#comment', - }, - { - include: '#type-parameters', - }, - ], - }, - { - name: 'meta.type.constructor.tsx', - begin: '(?)\n ))\n )\n )\n)', - end: '(?<=\\))', - patterns: [ - { - include: '#function-parameters', - }, - ], - }, - ], - }, - 'type-function-return-type': { - patterns: [ - { - name: 'meta.type.function.return.tsx', - begin: '(=>)(?=\\s*\\S)', - beginCaptures: { - '1': { - name: 'storage.type.function.arrow.tsx', - }, - }, - end: '(?)(?:\\?]|//|$)', - patterns: [ - { - include: '#type-function-return-type-core', - }, - ], - }, - { - name: 'meta.type.function.return.tsx', - begin: '=>', - beginCaptures: { - '0': { - name: 'storage.type.function.arrow.tsx', - }, - }, - end: '(?)(?]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))', - patterns: [ - { - include: '#type-function-return-type-core', - }, - ], - }, - ], - }, - 'type-function-return-type-core': { - patterns: [ - { - include: '#comment', - }, - { - begin: '(?<==>)(?=\\s*\\{)', - end: '(?<=\\})', - patterns: [ - { - include: '#type-object', - }, - ], - }, - { - include: '#type-predicate-operator', - }, - { - include: '#type', - }, - ], - }, - 'type-operators': { - patterns: [ - { - include: '#typeof-operator', - }, - { - include: '#type-infer', - }, - { - begin: '([&|])(?=\\s*\\{)', - beginCaptures: { - '0': { - name: 'keyword.operator.type.tsx', - }, - }, - end: '(?<=\\})', - patterns: [ - { - include: '#type-object', - }, - ], - }, - { - begin: '[&|]', - beginCaptures: { - '0': { - name: 'keyword.operator.type.tsx', - }, - }, - end: '(?=\\S)', - }, - { - name: 'keyword.operator.expression.keyof.tsx', - match: '(?)', - endCaptures: { - '1': { - name: 'meta.type.parameters.tsx punctuation.definition.typeparameters.end.tsx', - }, - }, - contentName: 'meta.type.parameters.tsx', - patterns: [ - { - include: '#type-arguments-body', - }, - ], - }, - { - begin: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(<)', - beginCaptures: { - '1': { - name: 'entity.name.type.tsx', - }, - '2': { - name: 'meta.type.parameters.tsx punctuation.definition.typeparameters.begin.tsx', - }, - }, - end: '(>)', - endCaptures: { - '1': { - name: 'meta.type.parameters.tsx punctuation.definition.typeparameters.end.tsx', - }, - }, - contentName: 'meta.type.parameters.tsx', - patterns: [ - { - include: '#type-arguments-body', - }, - ], - }, - { - match: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))', - captures: { - '1': { - name: 'entity.name.type.module.tsx', - }, - '2': { - name: 'punctuation.accessor.tsx', - }, - '3': { - name: 'punctuation.accessor.optional.tsx', - }, - }, - }, - { - name: 'entity.name.type.tsx', - match: '[_$[:alpha:]][_$[:alnum:]]*', - }, - ], - }, - 'punctuation-comma': { - name: 'punctuation.separator.comma.tsx', - match: ',', - }, - 'punctuation-semicolon': { - name: 'punctuation.terminator.statement.tsx', - match: ';', - }, - 'punctuation-accessor': { - match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))', - captures: { - '1': { - name: 'punctuation.accessor.tsx', - }, - '2': { - name: 'punctuation.accessor.optional.tsx', - }, - }, - }, - string: { - patterns: [ - { - include: '#qstring-single', - }, - { - include: '#qstring-double', - }, - { - include: '#template', - }, - ], - }, - 'qstring-double': { - name: 'string.quoted.double.tsx', - begin: '"', - beginCaptures: { - '0': { - name: 'punctuation.definition.string.begin.tsx', - }, - }, - end: '(")|((?:[^\\\\\\n])$)', - endCaptures: { - '1': { - name: 'punctuation.definition.string.end.tsx', - }, - '2': { - name: 'invalid.illegal.newline.tsx', - }, - }, - patterns: [ - { - include: '#string-character-escape', - }, - ], - }, - 'qstring-single': { - name: 'string.quoted.single.tsx', - begin: "'", - beginCaptures: { - '0': { - name: 'punctuation.definition.string.begin.tsx', - }, - }, - end: "(\\')|((?:[^\\\\\\n])$)", - endCaptures: { - '1': { - name: 'punctuation.definition.string.end.tsx', - }, - '2': { - name: 'invalid.illegal.newline.tsx', - }, - }, - patterns: [ - { - include: '#string-character-escape', - }, - ], - }, - 'string-character-escape': { - name: 'constant.character.escape.tsx', - match: '\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\\{[0-9A-Fa-f]+\\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)', - }, - template: { - patterns: [ - { - include: '#template-call', - }, - { - contentName: 'string.template.tsx', - begin: '([_$[:alpha:]][_$[:alnum:]]*)?(`)', - beginCaptures: { - '1': { - name: 'entity.name.function.tagged-template.tsx', - }, - '2': { - name: 'string.template.tsx punctuation.definition.string.template.begin.tsx', - }, - }, - end: '`', - endCaptures: { - '0': { - name: 'string.template.tsx punctuation.definition.string.template.end.tsx', - }, - }, - patterns: [ - { - include: '#template-substitution-element', - }, - { - include: '#string-character-escape', - }, - ], - }, - ], - }, - 'template-call': { - patterns: [ - { - begin: "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)", - end: '(?=`)', - patterns: [ - { - begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))', - end: "(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)", - patterns: [ - { - include: '#support-function-call-identifiers', - }, - { - name: 'entity.name.function.tagged-template.tsx', - match: '([_$[:alpha:]][_$[:alnum:]]*)', - }, - ], - }, - { - include: '#type-arguments', - }, - ], - }, - { - begin: "([_$[:alpha:]][_$[:alnum:]]*)?\\s*(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)`)", - beginCaptures: { - '1': { - name: 'entity.name.function.tagged-template.tsx', - }, - }, - end: '(?=`)', - patterns: [ - { - include: '#type-arguments', - }, - ], - }, - ], - }, - 'template-substitution-element': { - name: 'meta.template.expression.tsx', - begin: '\\$\\{', - beginCaptures: { - '0': { - name: 'punctuation.definition.template-expression.begin.tsx', - }, - }, - end: '\\}', - endCaptures: { - '0': { - name: 'punctuation.definition.template-expression.end.tsx', - }, - }, - patterns: [ - { - include: '#expression', - }, - ], - contentName: 'meta.embedded.line.tsx', - }, - 'type-string': { - patterns: [ - { - include: '#qstring-single', - }, - { - include: '#qstring-double', - }, - { - include: '#template-type', - }, - ], - }, - 'template-type': { - patterns: [ - { - include: '#template-call', - }, - { - contentName: 'string.template.tsx', - begin: '([_$[:alpha:]][_$[:alnum:]]*)?(`)', - beginCaptures: { - '1': { - name: 'entity.name.function.tagged-template.tsx', - }, - '2': { - name: 'string.template.tsx punctuation.definition.string.template.begin.tsx', - }, - }, - end: '`', - endCaptures: { - '0': { - name: 'string.template.tsx punctuation.definition.string.template.end.tsx', - }, - }, - patterns: [ - { - include: '#template-type-substitution-element', - }, - { - include: '#string-character-escape', - }, - ], - }, - ], - }, - 'template-type-substitution-element': { - name: 'meta.template.expression.tsx', - begin: '\\$\\{', - beginCaptures: { - '0': { - name: 'punctuation.definition.template-expression.begin.tsx', - }, - }, - end: '\\}', - endCaptures: { - '0': { - name: 'punctuation.definition.template-expression.end.tsx', - }, - }, - patterns: [ - { - include: '#type', - }, - ], - contentName: 'meta.embedded.line.tsx', - }, - regex: { - patterns: [ - { - name: 'string.regexp.tsx', - begin: '(?|&&|\\|\\||\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[\\()]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\]|\\(([^\\)\\\\]|\\\\.)+\\))+\\/([dgimsuy]+|(?![\\/\\*])|(?=\\/\\*))(?!\\s*[a-zA-Z0-9_$]))', - beginCaptures: { - '1': { - name: 'punctuation.definition.string.begin.tsx', - }, - }, - end: '(/)([dgimsuy]*)', - endCaptures: { - '1': { - name: 'punctuation.definition.string.end.tsx', - }, - '2': { - name: 'keyword.other.tsx', - }, - }, - patterns: [ - { - include: '#regexp', - }, - ], - }, - { - name: 'string.regexp.tsx', - begin: '((?', - captures: { - '0': { - name: 'keyword.other.back-reference.regexp', - }, - '1': { - name: 'variable.other.regexp', - }, - }, - }, - { - name: 'keyword.operator.quantifier.regexp', - match: '[?+*]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??', - }, - { - name: 'keyword.operator.or.regexp', - match: '\\|', - }, - { - name: 'meta.group.assertion.regexp', - begin: '(\\()((\\?=)|(\\?!)|(\\?<=)|(\\?))?', - beginCaptures: { - '0': { - name: 'punctuation.definition.group.regexp', - }, - '1': { - name: 'punctuation.definition.group.no-capture.regexp', - }, - '2': { - name: 'variable.other.regexp', - }, - }, - end: '\\)', - endCaptures: { - '0': { - name: 'punctuation.definition.group.regexp', - }, - }, - patterns: [ - { - include: '#regexp', - }, - ], - }, - { - name: 'constant.other.character-class.set.regexp', - begin: '(\\[)(\\^)?', - beginCaptures: { - '1': { - name: 'punctuation.definition.character-class.regexp', - }, - '2': { - name: 'keyword.operator.negation.regexp', - }, - }, - end: '(\\])', - endCaptures: { - '1': { - name: 'punctuation.definition.character-class.regexp', - }, - }, - patterns: [ - { - name: 'constant.other.character-class.range.regexp', - match: '(?:.|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))\\-(?:[^\\]\\\\]|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))', - captures: { - '1': { - name: 'constant.character.numeric.regexp', - }, - '2': { - name: 'constant.character.control.regexp', - }, - '3': { - name: 'constant.character.escape.backslash.regexp', - }, - '4': { - name: 'constant.character.numeric.regexp', - }, - '5': { - name: 'constant.character.control.regexp', - }, - '6': { - name: 'constant.character.escape.backslash.regexp', - }, - }, - }, - { - include: '#regex-character-class', - }, - ], - }, - { - include: '#regex-character-class', - }, - ], - }, - 'regex-character-class': { - patterns: [ - { - name: 'constant.other.character-class.regexp', - match: '\\\\[wWsSdDtrnvf]|\\.', - }, - { - name: 'constant.character.numeric.regexp', - match: '\\\\([0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4})', - }, - { - name: 'constant.character.control.regexp', - match: '\\\\c[A-Z]', - }, - { - name: 'constant.character.escape.backslash.regexp', - match: '\\\\.', - }, - ], - }, - comment: { - patterns: [ - { - name: 'comment.block.documentation.tsx', - begin: '/\\*\\*(?!/)', - beginCaptures: { - '0': { - name: 'punctuation.definition.comment.tsx', - }, - }, - end: '\\*/', - endCaptures: { - '0': { - name: 'punctuation.definition.comment.tsx', - }, - }, - patterns: [ - { - include: '#docblock', - }, - ], - }, - { - name: 'comment.block.tsx', - begin: '(/\\*)(?:\\s*((@)internal)(?=\\s|(\\*/)))?', - beginCaptures: { - '1': { - name: 'punctuation.definition.comment.tsx', - }, - '2': { - name: 'storage.type.internaldeclaration.tsx', - }, - '3': { - name: 'punctuation.decorator.internaldeclaration.tsx', - }, - }, - end: '\\*/', - endCaptures: { - '0': { - name: 'punctuation.definition.comment.tsx', - }, - }, - }, - { - begin: '(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)', - beginCaptures: { - '1': { - name: 'punctuation.whitespace.comment.leading.tsx', - }, - '2': { - name: 'comment.line.double-slash.tsx', - }, - '3': { - name: 'punctuation.definition.comment.tsx', - }, - '4': { - name: 'storage.type.internaldeclaration.tsx', - }, - '5': { - name: 'punctuation.decorator.internaldeclaration.tsx', - }, - }, - end: '(?=$)', - contentName: 'comment.line.double-slash.tsx', - }, - ], - }, - 'single-line-comment-consuming-line-ending': { - begin: '(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)', - beginCaptures: { - '1': { - name: 'punctuation.whitespace.comment.leading.tsx', - }, - '2': { - name: 'comment.line.double-slash.tsx', - }, - '3': { - name: 'punctuation.definition.comment.tsx', - }, - '4': { - name: 'storage.type.internaldeclaration.tsx', - }, - '5': { - name: 'punctuation.decorator.internaldeclaration.tsx', - }, - }, - end: '(?=^)', - contentName: 'comment.line.double-slash.tsx', - }, - directives: { - name: 'comment.line.triple-slash.directive.tsx', - begin: "^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|lib|name|resolution-mode)\\s*=\\s*((\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)))+\\s*/>\\s*$)", - beginCaptures: { - '1': { - name: 'punctuation.definition.comment.tsx', - }, - }, - end: '(?=$)', - patterns: [ - { - name: 'meta.tag.tsx', - begin: '(<)(reference|amd-dependency|amd-module)', - beginCaptures: { - '1': { - name: 'punctuation.definition.tag.directive.tsx', - }, - '2': { - name: 'entity.name.tag.directive.tsx', - }, - }, - end: '/>', - endCaptures: { - '0': { - name: 'punctuation.definition.tag.directive.tsx', - }, - }, - patterns: [ - { - name: 'entity.other.attribute-name.directive.tsx', - match: 'path|types|no-default-lib|lib|name|resolution-mode', - }, - { - name: 'keyword.operator.assignment.tsx', - match: '=', - }, - { - include: '#string', - }, - ], - }, - ], - }, - docblock: { - patterns: [ - { - match: '(?x)\n((@)(?:access|api))\n\\s+\n(private|protected|public)\n\\b', - captures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - '3': { - name: 'constant.language.access-type.jsdoc', - }, - }, - }, - { - match: '(?x)\n((@)author)\n\\s+\n(\n [^@\\s<>*/]\n (?:[^@<>*/]|\\*[^/])*\n)\n(?:\n \\s*\n (<)\n ([^>\\s]+)\n (>)\n)?', - captures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - '3': { - name: 'entity.name.type.instance.jsdoc', - }, - '4': { - name: 'punctuation.definition.bracket.angle.begin.jsdoc', - }, - '5': { - name: 'constant.other.email.link.underline.jsdoc', - }, - '6': { - name: 'punctuation.definition.bracket.angle.end.jsdoc', - }, - }, - }, - { - match: '(?x)\n((@)borrows) \\s+\n((?:[^@\\s*/]|\\*[^/])+) # \n\\s+ (as) \\s+ # as\n((?:[^@\\s*/]|\\*[^/])+) # ', - captures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - '3': { - name: 'entity.name.type.instance.jsdoc', - }, - '4': { - name: 'keyword.operator.control.jsdoc', - }, - '5': { - name: 'entity.name.type.instance.jsdoc', - }, - }, - }, - { - name: 'meta.example.jsdoc', - begin: '((@)example)\\s+', - end: '(?=@|\\*/)', - beginCaptures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - }, - patterns: [ - { - match: '^\\s\\*\\s+', - }, - { - contentName: 'constant.other.description.jsdoc', - begin: '\\G(<)caption(>)', - beginCaptures: { - '0': { - name: 'entity.name.tag.inline.jsdoc', - }, - '1': { - name: 'punctuation.definition.bracket.angle.begin.jsdoc', - }, - '2': { - name: 'punctuation.definition.bracket.angle.end.jsdoc', - }, - }, - end: '()|(?=\\*/)', - endCaptures: { - '0': { - name: 'entity.name.tag.inline.jsdoc', - }, - '1': { - name: 'punctuation.definition.bracket.angle.begin.jsdoc', - }, - '2': { - name: 'punctuation.definition.bracket.angle.end.jsdoc', - }, - }, - }, - { - match: '[^\\s@*](?:[^*]|\\*[^/])*', - captures: { - '0': { - name: 'source.embedded.tsx', - }, - }, - }, - ], - }, - { - match: '(?x) ((@)kind) \\s+ (class|constant|event|external|file|function|member|mixin|module|namespace|typedef) \\b', - captures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - '3': { - name: 'constant.language.symbol-type.jsdoc', - }, - }, - }, - { - match: '(?x)\n((@)see)\n\\s+\n(?:\n # URL\n (\n (?=https?://)\n (?:[^\\s*]|\\*[^/])+\n )\n |\n # JSDoc namepath\n (\n (?!\n # Avoid matching bare URIs (also acceptable as links)\n https?://\n |\n # Avoid matching {@inline tags}; we match those below\n (?:\\[[^\\[\\]]*\\])? # Possible description [preceding]{@tag}\n {@(?:link|linkcode|linkplain|tutorial)\\b\n )\n # Matched namepath\n (?:[^@\\s*/]|\\*[^/])+\n )\n)', - captures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - '3': { - name: 'variable.other.link.underline.jsdoc', - }, - '4': { - name: 'entity.name.type.instance.jsdoc', - }, - }, - }, - { - match: '(?x)\n((@)template)\n\\s+\n# One or more valid identifiers\n(\n [A-Za-z_$] # First character: non-numeric word character\n [\\w$.\\[\\]]* # Rest of identifier\n (?: # Possible list of additional identifiers\n \\s* , \\s*\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n )*\n)', - captures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - '3': { - name: 'variable.other.jsdoc', - }, - }, - }, - { - begin: '(?x)((@)template)\\s+(?={)', - beginCaptures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - }, - end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', - patterns: [ - { - include: '#jsdoctype', - }, - { - name: 'variable.other.jsdoc', - match: '([A-Za-z_$][\\w$.\\[\\]]*)', - }, - ], - }, - { - match: '(?x)\n(\n (@)\n (?:arg|argument|const|constant|member|namespace|param|var)\n)\n\\s+\n(\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n)', - captures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - '3': { - name: 'variable.other.jsdoc', - }, - }, - }, - { - begin: '((@)typedef)\\s+(?={)', - beginCaptures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - }, - end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', - patterns: [ - { - include: '#jsdoctype', - }, - { - name: 'entity.name.type.instance.jsdoc', - match: '(?:[^@\\s*/]|\\*[^/])+', - }, - ], - }, - { - begin: '((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\\s+(?={)', - beginCaptures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - }, - end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', - patterns: [ - { - include: '#jsdoctype', - }, - { - name: 'variable.other.jsdoc', - match: '([A-Za-z_$][\\w$.\\[\\]]*)', - }, - { - name: 'variable.other.jsdoc', - match: "(?x)\n(\\[)\\s*\n[\\w$]+\n(?:\n (?:\\[\\])? # Foo[ ].bar properties within an array\n \\. # Foo.Bar namespaced parameter\n [\\w$]+\n)*\n(?:\n \\s*\n (=) # [foo=bar] Default parameter value\n \\s*\n (\n # The inner regexes are to stop the match early at */ and to not stop at escaped quotes\n (?>\n \"(?:(?:\\*(?!/))|(?:\\\\(?!\"))|[^*\\\\])*?\" | # [foo=\"bar\"] Double-quoted\n '(?:(?:\\*(?!/))|(?:\\\\(?!'))|[^*\\\\])*?' | # [foo='bar'] Single-quoted\n \\[ (?:(?:\\*(?!/))|[^*])*? \\] | # [foo=[1,2]] Array literal\n (?:(?:\\*(?!/))|\\s(?!\\s*\\])|\\[.*?(?:\\]|(?=\\*/))|[^*\\s\\[\\]])* # Everything else\n )*\n )\n)?\n\\s*(?:(\\])((?:[^*\\s]|\\*[^\\s/])+)?|(?=\\*/))", - captures: { - '1': { - name: 'punctuation.definition.optional-value.begin.bracket.square.jsdoc', - }, - '2': { - name: 'keyword.operator.assignment.jsdoc', - }, - '3': { - name: 'source.embedded.tsx', - }, - '4': { - name: 'punctuation.definition.optional-value.end.bracket.square.jsdoc', - }, - '5': { - name: 'invalid.illegal.syntax.jsdoc', - }, - }, - }, - ], - }, - { - begin: '(?x)\n(\n (@)\n (?:define|enum|exception|export|extends|lends|implements|modifies\n |namespace|private|protected|returns?|satisfies|suppress|this|throws|type\n |yields?)\n)\n\\s+(?={)', - beginCaptures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - }, - end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', - patterns: [ - { - include: '#jsdoctype', - }, - ], - }, - { - match: '(?x)\n(\n (@)\n (?:alias|augments|callback|constructs|emits|event|fires|exports?\n |extends|external|function|func|host|lends|listens|interface|memberof!?\n |method|module|mixes|mixin|name|requires|see|this|typedef|uses)\n)\n\\s+\n(\n (?:\n [^{}@\\s*] | \\*[^/]\n )+\n)', - captures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - '3': { - name: 'entity.name.type.instance.jsdoc', - }, - }, - }, - { - contentName: 'variable.other.jsdoc', - begin: "((@)(?:default(?:value)?|license|version))\\s+(([''\"]))", - beginCaptures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - '3': { - name: 'variable.other.jsdoc', - }, - '4': { - name: 'punctuation.definition.string.begin.jsdoc', - }, - }, - end: '(\\3)|(?=$|\\*/)', - endCaptures: { - '0': { - name: 'variable.other.jsdoc', - }, - '1': { - name: 'punctuation.definition.string.end.jsdoc', - }, - }, - }, - { - match: '((@)(?:default(?:value)?|license|tutorial|variation|version))\\s+([^\\s*]+)', - captures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - '3': { - name: 'variable.other.jsdoc', - }, - }, - }, - { - name: 'storage.type.class.jsdoc', - match: '(?x) (@) (?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles |callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright |default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception |exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func |function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc |inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method |mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects |override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected |public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary |suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation |version|virtual|writeOnce|yields?) \\b', - captures: { - '1': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - }, - }, - { - include: '#inline-tags', - }, - { - match: '((@)(?:[_$[:alpha:]][_$[:alnum:]]*))(?=\\s+)', - captures: { - '1': { - name: 'storage.type.class.jsdoc', - }, - '2': { - name: 'punctuation.definition.block.tag.jsdoc', - }, - }, - }, - ], - }, - brackets: { - patterns: [ - { - begin: '{', - end: '}|(?=\\*/)', - patterns: [ - { - include: '#brackets', - }, - ], - }, - { - begin: '\\[', - end: '\\]|(?=\\*/)', - patterns: [ - { - include: '#brackets', - }, - ], - }, - ], - }, - 'inline-tags': { - patterns: [ - { - name: 'constant.other.description.jsdoc', - match: '(\\[)[^\\]]+(\\])(?={@(?:link|linkcode|linkplain|tutorial))', - captures: { - '1': { - name: 'punctuation.definition.bracket.square.begin.jsdoc', - }, - '2': { - name: 'punctuation.definition.bracket.square.end.jsdoc', - }, - }, - }, - { - name: 'entity.name.type.instance.jsdoc', - begin: '({)((@)(?:link(?:code|plain)?|tutorial))\\s*', - beginCaptures: { - '1': { - name: 'punctuation.definition.bracket.curly.begin.jsdoc', - }, - '2': { - name: 'storage.type.class.jsdoc', - }, - '3': { - name: 'punctuation.definition.inline.tag.jsdoc', - }, - }, - end: '}|(?=\\*/)', - endCaptures: { - '0': { - name: 'punctuation.definition.bracket.curly.end.jsdoc', - }, - }, - patterns: [ - { - match: '\\G((?=https?://)(?:[^|}\\s*]|\\*[/])+)(\\|)?', - captures: { - '1': { - name: 'variable.other.link.underline.jsdoc', - }, - '2': { - name: 'punctuation.separator.pipe.jsdoc', - }, - }, - }, - { - match: '\\G((?:[^{}@\\s|*]|\\*[^/])+)(\\|)?', - captures: { - '1': { - name: 'variable.other.description.jsdoc', - }, - '2': { - name: 'punctuation.separator.pipe.jsdoc', - }, - }, - }, - ], - }, - ], - }, - jsdoctype: { - patterns: [ - { - contentName: 'entity.name.type.instance.jsdoc', - begin: '\\G({)', - beginCaptures: { - '0': { - name: 'entity.name.type.instance.jsdoc', - }, - '1': { - name: 'punctuation.definition.bracket.curly.begin.jsdoc', - }, - }, - end: '((}))\\s*|(?=\\*/)', - endCaptures: { - '1': { - name: 'entity.name.type.instance.jsdoc', - }, - '2': { - name: 'punctuation.definition.bracket.curly.end.jsdoc', - }, - }, - patterns: [ - { - include: '#brackets', - }, - ], - }, - ], - }, - jsx: { - patterns: [ - { - include: '#jsx-tag-without-attributes-in-expression', - }, - { - include: '#jsx-tag-in-expression', - }, - ], - }, - 'jsx-tag-without-attributes-in-expression': { - begin: '(?:*]|&&|\\|\\||\\?|\\*\\/|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^default|[^\\._$[:alnum:]]default|^yield|[^\\._$[:alnum:]]yield|^)\\s*(?=(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))', - end: '(?!(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))', - patterns: [ - { - include: '#jsx-tag-without-attributes', - }, - ], - }, - 'jsx-tag-without-attributes': { - name: 'meta.tag.without-attributes.tsx', - begin: '(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?)', - end: '()', - beginCaptures: { - '1': { - name: 'punctuation.definition.tag.begin.tsx', - }, - '2': { - name: 'entity.name.tag.namespace.tsx', - }, - '3': { - name: 'punctuation.separator.namespace.tsx', - }, - '4': { - name: 'entity.name.tag.tsx', - }, - '5': { - name: 'support.class.component.tsx', - }, - '6': { - name: 'punctuation.definition.tag.end.tsx', - }, - }, - endCaptures: { - '1': { - name: 'punctuation.definition.tag.begin.tsx', - }, - '2': { - name: 'entity.name.tag.namespace.tsx', - }, - '3': { - name: 'punctuation.separator.namespace.tsx', - }, - '4': { - name: 'entity.name.tag.tsx', - }, - '5': { - name: 'support.class.component.tsx', - }, - '6': { - name: 'punctuation.definition.tag.end.tsx', - }, - }, - contentName: 'meta.jsx.children.tsx', - patterns: [ - { - include: '#jsx-children', - }, - ], - }, - 'jsx-tag-in-expression': { - begin: '(?x)\n (?:*]|&&|\\|\\||\\?|\\*\\/|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^default|[^\\._$[:alnum:]]default|^yield|[^\\._$[:alnum:]]yield|^)\\s*\n (?!<\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s+[^=>])|,)) # look ahead is not type parameter of arrow\n (?=(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))', - end: '(?!(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))', - patterns: [ - { - include: '#jsx-tag', - }, - ], - }, - 'jsx-tag': { - name: 'meta.tag.tsx', - begin: '(?=(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))', - end: '(/>)|(?:())', - endCaptures: { - '1': { - name: 'punctuation.definition.tag.end.tsx', - }, - '2': { - name: 'punctuation.definition.tag.begin.tsx', - }, - '3': { - name: 'entity.name.tag.namespace.tsx', - }, - '4': { - name: 'punctuation.separator.namespace.tsx', - }, - '5': { - name: 'entity.name.tag.tsx', - }, - '6': { - name: 'support.class.component.tsx', - }, - '7': { - name: 'punctuation.definition.tag.end.tsx', - }, - }, - patterns: [ - { - begin: '(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?)', - beginCaptures: { - '1': { - name: 'punctuation.definition.tag.begin.tsx', - }, - '2': { - name: 'entity.name.tag.namespace.tsx', - }, - '3': { - name: 'punctuation.separator.namespace.tsx', - }, - '4': { - name: 'entity.name.tag.tsx', - }, - '5': { - name: 'support.class.component.tsx', - }, - }, - end: '(?=[/]?>)', - patterns: [ - { - include: '#comment', - }, - { - include: '#type-arguments', - }, - { - include: '#jsx-tag-attributes', - }, - ], - }, - { - begin: '(>)', - beginCaptures: { - '1': { - name: 'punctuation.definition.tag.end.tsx', - }, - }, - end: '(?=)', - patterns: [ - { - include: '#comment', - }, - { - include: '#jsx-tag-attribute-name', - }, - { - include: '#jsx-tag-attribute-assignment', - }, - { - include: '#jsx-string-double-quoted', - }, - { - include: '#jsx-string-single-quoted', - }, - { - include: '#jsx-evaluated-code', - }, - { - include: '#jsx-tag-attributes-illegal', - }, - ], - }, - 'jsx-tag-attribute-name': { - match: '(?x)\n \\s*\n (?:([_$[:alpha:]][-_$[:alnum:].]*)(:))?\n ([_$[:alpha:]][-_$[:alnum:]]*)\n (?=\\s|=|/?>|/\\*|//)', - captures: { - '1': { - name: 'entity.other.attribute-name.namespace.tsx', - }, - '2': { - name: 'punctuation.separator.namespace.tsx', - }, - '3': { - name: 'entity.other.attribute-name.tsx', - }, - }, - }, - 'jsx-tag-attribute-assignment': { - name: 'keyword.operator.assignment.tsx', - match: "=(?=\\s*(?:'|\"|{|/\\*|//|\\n))", - }, - 'jsx-string-double-quoted': { - name: 'string.quoted.double.tsx', - begin: '"', - end: '"', - beginCaptures: { - '0': { - name: 'punctuation.definition.string.begin.tsx', - }, - }, - endCaptures: { - '0': { - name: 'punctuation.definition.string.end.tsx', - }, - }, - patterns: [ - { - include: '#jsx-entities', - }, - ], - }, - 'jsx-string-single-quoted': { - name: 'string.quoted.single.tsx', - begin: "'", - end: "'", - beginCaptures: { - '0': { - name: 'punctuation.definition.string.begin.tsx', - }, - }, - endCaptures: { - '0': { - name: 'punctuation.definition.string.end.tsx', - }, - }, - patterns: [ - { - include: '#jsx-entities', - }, - ], - }, - 'jsx-tag-attributes-illegal': { - name: 'invalid.illegal.attribute.tsx', - match: '\\S+', - }, - }, - }, - grammarLocation: './syntaxes/TypeScriptReact.tmLanguage.json', - injectTo: undefined, - embeddedLanguages: { - 'meta.tag.tsx': 'jsx-tags', - 'meta.tag.without-attributes.tsx': 'jsx-tags', - 'meta.tag.attributes.tsx': 'typescriptreact', - 'meta.embedded.expression.tsx': 'typescriptreact', - }, - tokenTypes: { - 'meta.template.expression': 'other', - 'meta.template.expression string': 'string', - 'meta.template.expression comment': 'comment', - 'entity.name.type.instance.jsdoc': 'other', - 'entity.name.function.tagged-template': 'other', - 'meta.import string.quoted': 'other', - 'variable.other.jsdoc': 'other', - }, - }, - { - language: undefined, - scope: 'documentation.injection.ts', - format: 'json', - grammar: { - injectionSelector: 'L:comment.block.documentation', - patterns: [ - { - include: '#jsdocbody', - }, - ], - repository: { - jsdocbody: { - begin: '(?<=/\\*\\*)([^*]|\\*(?!/))*$', - while: '(^|\\G)\\s*\\*(?!/)(?=([^*]|[*](?!/))*$)', - patterns: [ - { - include: 'source.ts#docblock', - }, - ], - }, - }, - scopeName: 'documentation.injection.ts', - }, - grammarLocation: './syntaxes/jsdoc.ts.injection.tmLanguage.json', - injectTo: [ - 'source.ts', - 'source.tsx', - ], - embeddedLanguages: undefined, - tokenTypes: undefined, - }, - { - language: undefined, - scope: 'documentation.injection.js.jsx', - format: 'json', - grammar: { - injectionSelector: 'L:comment.block.documentation', - patterns: [ - { - include: '#jsdocbody', - }, - ], - repository: { - jsdocbody: { - begin: '(?<=/\\*\\*)([^*]|\\*(?!/))*$', - while: '(^|\\G)\\s*\\*(?!/)(?=([^*]|[*](?!/))*$)', - patterns: [ - { - include: 'source.ts#docblock', - }, - ], - }, - }, - scopeName: 'documentation.injection.js.jsx', - }, - grammarLocation: './syntaxes/jsdoc.js.injection.tmLanguage.json', - injectTo: [ - 'source.js', - 'source.js.jsx', - ], - embeddedLanguages: undefined, - tokenTypes: undefined, - }, - ], - problemMatchers: undefined, - problemPatterns: undefined, - resourceLabelFormatters: undefined, - authentication: undefined, - notebooks: undefined, - snippets: [ - { - language: 'typescript', - source: 'TypeScript Language Basics (built-in)', - uri: 'file:///home/tobias/Git/OpenSource/theia/theia/plugins/ts-base/extension/snippets/typescript.code-snippets', - }, - { - language: 'typescriptreact', - source: 'TypeScript Language Basics (built-in)', - uri: 'file:///home/tobias/Git/OpenSource/theia/theia/plugins/ts-base/extension/snippets/typescript.code-snippets', - }, - ], - themes: undefined, - iconThemes: undefined, - colors: undefined, - localizations: undefined, - terminalProfiles: undefined, + 'outOfSync': false, + 'isUnderDevelopment': false }, + 'type': 0, + 'contributes': { + 'activationEvents': [ + '*' + ] + } }, ]; From c4620b0e149e7370f47374caa6529a597f812e09 Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Wed, 27 Nov 2024 00:28:28 +0100 Subject: [PATCH 15/36] Add script to move plugins for static browser-only implementation --- examples/browser-only/prepare-plugins.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 examples/browser-only/prepare-plugins.js diff --git a/examples/browser-only/prepare-plugins.js b/examples/browser-only/prepare-plugins.js new file mode 100644 index 0000000000000..16c10ca1a11af --- /dev/null +++ b/examples/browser-only/prepare-plugins.js @@ -0,0 +1,22 @@ +const { promisify } = require('util'); +const glob = promisify(require('glob')); +const fs = require('fs').promises; +const path = require('path'); + +async function run() { + // Resolve the `package.json` at the current working directory. + const pck = JSON.parse(await fs.readFile(path.resolve('package.json'), 'utf8')); + + // Resolve the directory for which to download the plugins. + const pluginsDir = pck.theiaPluginsDir || 'plugins'; + + // Move all the plugins from pluginsDir into /lib/frontend/hostedPlugin + const plugins = await glob(`${pluginsDir}/**/*`, { nodir: true }); + for (const plugin of plugins) { + const target = path.join('lib', 'frontend', 'hostedPlugin', path.relative(pluginsDir, plugin)); + await fs.mkdir(path.dirname(target), { recursive: true }); + await fs.copyFile(plugin, target); + } +} + +run(); From 82d34b01f031e701727f7a7af63348ca120db065 Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Wed, 27 Nov 2024 09:13:05 +0100 Subject: [PATCH 16/36] Update getDefaultShell method to return an empty string instead of 'none' --- .../src/browser-only/terminal-frontend-only-contribution.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/terminal/src/browser-only/terminal-frontend-only-contribution.ts b/packages/terminal/src/browser-only/terminal-frontend-only-contribution.ts index 552b3933f6279..8726ff29b4328 100644 --- a/packages/terminal/src/browser-only/terminal-frontend-only-contribution.ts +++ b/packages/terminal/src/browser-only/terminal-frontend-only-contribution.ts @@ -60,6 +60,6 @@ export class TerminalFrontendOnlyContribution implements TerminalService { } async getDefaultShell(): Promise { - return 'none'; + return ''; } } From 3bf06fe0174b01d54d6c4f3ddf749822757ec5a3 Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Thu, 5 Dec 2024 15:28:16 +0100 Subject: [PATCH 17/36] Add mock plugin metadata and update prepare-plugins script for browser-only implementation --- .../plugin-sample/mock-plugin-metadata.ts | 62 ++++++++++++++++++- examples/browser-only/package.json | 5 +- examples/browser-only/prepare-plugins.js | 38 +++++++++--- 3 files changed, 91 insertions(+), 14 deletions(-) diff --git a/examples/api-samples/src/browser-only/plugin-sample/mock-plugin-metadata.ts b/examples/api-samples/src/browser-only/plugin-sample/mock-plugin-metadata.ts index b2dd15585eca5..6c4c1320a1395 100644 --- a/examples/api-samples/src/browser-only/plugin-sample/mock-plugin-metadata.ts +++ b/examples/api-samples/src/browser-only/plugin-sample/mock-plugin-metadata.ts @@ -19,8 +19,8 @@ export const mockData: any[] = [ metadata: { host: 'main', 'model': { - 'packagePath': '/theia/plugins/demo-plugin', // Deprecated - 'packageUri': 'file:///theia/plugins/demo-plugin', // TODO Path to the plugin + 'packagePath': '/Users/robertjandow/Documents/Development/theia/plugins/demo-plugin', // Deprecated + 'packageUri': 'file:///Users/robertjandow/Documents/Development/theia/plugins/demo-plugin', 'id': 'theia.demo-plugin', 'name': 'demo-plugin', 'publisher': 'theia', @@ -39,7 +39,7 @@ export const mockData: any[] = [ 'startMethod': 'start', 'stopMethod': 'stop', 'frontendModuleName': 'theia_demo_plugin', - 'backendInitPath': '/theia/examples/browser/lib/backend/backend-init-theia' // TODO Path to the backend initialization file + 'backendInitPath': '/Users/robertjandow/Documents/Development/theia/examples/browser/lib/backend/backend-init-theia' }, 'outOfSync': false, 'isUnderDevelopment': false @@ -51,4 +51,60 @@ export const mockData: any[] = [ ] } }, + { + metadata: { + host: 'main', + 'model': { + 'packagePath': '/Users/robertjandow/Documents/Development/theia/plugins/vscode.simple-browser/extension', // Deprecated + 'packageUri': 'file:///Users/robertjandow/Documents/Development/theia/plugins/vscode.simple-browser/extension', + 'id': 'vscode.simple-browser', + 'name': 'simple-browser', + 'publisher': 'vscode', + 'version': '1.88.1', + 'displayName': 'vscode.simple-browser', + 'description': '', + 'engine': { + 'type': 'vscode', + 'version': '^1.70.0' + }, + 'entryPoint': { + 'frontend': 'dist/browser/extension.js' + } + }, + 'lifecycle': { + 'startMethod': 'start', + 'stopMethod': 'stop', + 'frontendModuleName': 'vscode_simple_browser', + 'backendInitPath': '/Users/robertjandow/Documents/Development/theia/examples/browser/lib/backend/plugin-vscode-init' + }, + 'outOfSync': false, + 'isUnderDevelopment': false + }, + 'type': 0, + "contributes": { + "activationEvents": [ + "*" + ], + "commands": [ + { + "command": "simpleBrowser.show", + "title": "Show", + "category": "Simple Browser" + } + ], + "configuration": [ + { + "title": "Simple Browser", + "properties": { + "simpleBrowser.focusLockIndicator.enabled": { + "type": "boolean", + "default": true, + "title": "Focus Lock Indicator Enabled", + "description": "%configuration.focusLockIndicator.enabled.description%" + } + } + } + ] + }, + }, ]; diff --git a/examples/browser-only/package.json b/examples/browser-only/package.json index 688881d2c576a..d4f4b73b5beb1 100644 --- a/examples/browser-only/package.json +++ b/examples/browser-only/package.json @@ -16,7 +16,7 @@ }, "theiaPluginsDir": "plugins", "theiaPlugins": { - "vscode.typescript": "https://open-vsx.org/api/vscode/typescript/1.88.1/file/vscode.typescript-1.88.1.vsix" + "vscode.simple-browser": "https://open-vsx.org/api/vscode/simple-browser/1.88.1/file/vscode.simple-browser-1.88.1.vsix" }, "dependencies": { "@theia/ai-chat": "1.54.0", @@ -74,9 +74,10 @@ "scripts": { "prepare:no-native": "lerna run prepare --scope=\"@theia/re-exports\" && lerna run generate-theia-re-exports --scope=\"@theia/core\"", "clean": "theia clean", - "build": "yarn -s compile && yarn -s bundle", + "build": "yarn -s compile && yarn deploy:plugin && yarn -s bundle", "bundle": "theia build --mode development", "download:plugins": "theia download:plugins", + "deploy:plugin": "node ./prepare-plugins.js", "compile": "tsc -b", "start": "theia start", "start:debug": "yarn -s start --log-level=debug", diff --git a/examples/browser-only/prepare-plugins.js b/examples/browser-only/prepare-plugins.js index 16c10ca1a11af..7a9dc2d561142 100644 --- a/examples/browser-only/prepare-plugins.js +++ b/examples/browser-only/prepare-plugins.js @@ -8,15 +8,35 @@ async function run() { const pck = JSON.parse(await fs.readFile(path.resolve('package.json'), 'utf8')); // Resolve the directory for which to download the plugins. - const pluginsDir = pck.theiaPluginsDir || 'plugins'; - - // Move all the plugins from pluginsDir into /lib/frontend/hostedPlugin - const plugins = await glob(`${pluginsDir}/**/*`, { nodir: true }); - for (const plugin of plugins) { - const target = path.join('lib', 'frontend', 'hostedPlugin', path.relative(pluginsDir, plugin)); - await fs.mkdir(path.dirname(target), { recursive: true }); - await fs.copyFile(plugin, target); + const pluginsDir = pck.theiaPluginsDir || 'extension'; + + // Find all `plugin/extension/*` directories. + const plugins = await glob(`${pluginsDir}/*/extension`); + + for (const pluginExtensionPath of plugins) { + // Extract the plugin name from the parent folder of the extension. + const pluginName = path.basename(path.dirname(pluginExtensionPath)).replace(/[.\-]/g, '_'); + const targetDir = path.join('lib', 'frontend', 'hostedPlugin', pluginName); + + // Ensure the target directory exists. + await fs.mkdir(targetDir, { recursive: true }); + + // Copy the content of the `extension` folder to the target directory. + const files = await glob(`${pluginExtensionPath}/**/*`, { nodir: true }); + for (const file of files) { + const relativePath = path.relative(pluginExtensionPath, file); + const target = path.join(targetDir, relativePath); + + // Ensure the target directory structure exists. + await fs.mkdir(path.dirname(target), { recursive: true }); + + // Copy the file. + await fs.copyFile(file, target); + } } } -run(); +run().catch(err => { + console.error(err); + process.exit(1); +}); From 42a50f4c7402ea7cadc9223884ca7069932eb2ea Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Thu, 12 Dec 2024 14:33:05 +0100 Subject: [PATCH 18/36] Fix lifecycle methods and activation events --- .../browser-only/plugin-sample/mock-plugin-metadata.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/api-samples/src/browser-only/plugin-sample/mock-plugin-metadata.ts b/examples/api-samples/src/browser-only/plugin-sample/mock-plugin-metadata.ts index 6c4c1320a1395..38423d673404b 100644 --- a/examples/api-samples/src/browser-only/plugin-sample/mock-plugin-metadata.ts +++ b/examples/api-samples/src/browser-only/plugin-sample/mock-plugin-metadata.ts @@ -72,9 +72,10 @@ export const mockData: any[] = [ } }, 'lifecycle': { - 'startMethod': 'start', - 'stopMethod': 'stop', + 'startMethod': 'activate', + 'stopMethod': 'deactivate', 'frontendModuleName': 'vscode_simple_browser', + 'frontendInitPath': 'plugin-vscode-init-fe.js', 'backendInitPath': '/Users/robertjandow/Documents/Development/theia/examples/browser/lib/backend/plugin-vscode-init' }, 'outOfSync': false, @@ -83,7 +84,10 @@ export const mockData: any[] = [ 'type': 0, "contributes": { "activationEvents": [ - "*" + "onCommand:simpleBrowser.api.open", + "onOpenExternalUri:http", + "onOpenExternalUri:https", + "onWebviewPanel:simpleBrowser.view" ], "commands": [ { From fbd9da8bff6e1b6234ea1cbf07c8998c11f04ebd Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Tue, 7 Jan 2025 17:42:43 +0100 Subject: [PATCH 19/36] Filter deployed plugins by specified plugin IDs in getDeployedPlugins method --- .../src/hosted/browser-only/frontend-hosted-plugin-server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts b/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts index 9e8f70c4ee8e7..09601537a4f6d 100644 --- a/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts +++ b/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts @@ -42,7 +42,7 @@ export class FrontendHostedPluginServer implements HostedPluginServer, RpcConnec } async getDeployedPlugins(params: GetDeployedPluginsParams): Promise { console.log('getDeployedPlugins'); - return this.options.pluginMetadata; + return this.options.pluginMetadata.filter(p => params.pluginIds.includes(p.metadata.model.id + '@' + p.metadata.model.version as `${string}.${string}@${string}`)); } async getExtPluginAPI(): Promise { From a1bc7e8e00b56e04ad5fd0d80a8fe79aaacf3aa0 Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Tue, 7 Jan 2025 18:05:56 +0100 Subject: [PATCH 20/36] Rename mock plugin metadata to static plugin metadata --- .../plugin-sample/example-plugin-initialization.ts | 4 ++-- ...k-plugin-metadata.ts => example-static-plugin-metadata.ts} | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename examples/api-samples/src/browser-only/plugin-sample/{mock-plugin-metadata.ts => example-static-plugin-metadata.ts} (98%) diff --git a/examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts b/examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts index 35a8a2bff88f7..f2238d8de85d3 100644 --- a/examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts +++ b/examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts @@ -1,11 +1,11 @@ import { interfaces } from '@theia/core/shared/inversify'; import { PluginLocalOptions } from '@theia/plugin-ext/lib/hosted/browser-only/frontend-hosted-plugin-server'; -import { mockData } from './mock-plugin-metadata'; +import { staticMetadata } from './example-static-plugin-metadata'; export const bindPluginInitialization = (bind: interfaces.Bind, rebind: interfaces.Rebind): void => { const pluginLocalOptions = { - pluginMetadata: mockData, + pluginMetadata: staticMetadata, }; bind(PluginLocalOptions).toConstantValue(pluginLocalOptions); }; diff --git a/examples/api-samples/src/browser-only/plugin-sample/mock-plugin-metadata.ts b/examples/api-samples/src/browser-only/plugin-sample/example-static-plugin-metadata.ts similarity index 98% rename from examples/api-samples/src/browser-only/plugin-sample/mock-plugin-metadata.ts rename to examples/api-samples/src/browser-only/plugin-sample/example-static-plugin-metadata.ts index 38423d673404b..8623878546fce 100644 --- a/examples/api-samples/src/browser-only/plugin-sample/mock-plugin-metadata.ts +++ b/examples/api-samples/src/browser-only/plugin-sample/example-static-plugin-metadata.ts @@ -14,7 +14,7 @@ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 // **************************************************************************** -export const mockData: any[] = [ +export const staticMetadata: any[] = [ { metadata: { host: 'main', From 82baacdac9d414999f0e55dcb3c5cc3caa6023cf Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Thu, 9 Jan 2025 14:49:16 +0100 Subject: [PATCH 21/36] Refactor plugin ID handling to use PluginIdentifiers for consistency --- .../browser-only/frontend-hosted-plugin-server.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts b/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts index 09601537a4f6d..7e4ef5ef180a6 100644 --- a/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts +++ b/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts @@ -15,7 +15,7 @@ // **************************************************************************** import { injectable, inject } from '@theia/core/shared/inversify'; -import { DeployedPlugin, ExtPluginApi, GetDeployedPluginsParams, HostedPluginClient, HostedPluginServer } from '../../common'; +import { DeployedPlugin, ExtPluginApi, GetDeployedPluginsParams, HostedPluginClient, HostedPluginServer, PluginIdentifiers } from '../../common'; import { Event, RpcConnectionEventEmitter } from '@theia/core'; export const PluginLocalOptions = Symbol('PluginLocalOptions'); @@ -31,18 +31,18 @@ export class FrontendHostedPluginServer implements HostedPluginServer, RpcConnec @inject(PluginLocalOptions) protected readonly options: PluginLocalOptions; - async getDeployedPluginIds(): Promise<`${string}.${string}@${string}`[]> { + async getDeployedPluginIds(): Promise { console.log('getDeployedPluginIds'); // Use the plugin metadata to build the correct plugin id - return this.options.pluginMetadata.map(p => p.metadata.model.id + '@' + p.metadata.model.version as `${string}.${string}@${string}`); + return this.options.pluginMetadata.map(p => PluginIdentifiers.componentsToVersionedId(p.metadata.model)); } - async getUninstalledPluginIds(): Promise { + async getUninstalledPluginIds(): Promise { return []; } async getDeployedPlugins(params: GetDeployedPluginsParams): Promise { console.log('getDeployedPlugins'); - return this.options.pluginMetadata.filter(p => params.pluginIds.includes(p.metadata.model.id + '@' + p.metadata.model.version as `${string}.${string}@${string}`)); + return this.options.pluginMetadata.filter(p => params.pluginIds.includes(PluginIdentifiers.componentsToVersionedId(p.metadata.model))); } async getExtPluginAPI(): Promise { From 8fea9e5b48f544220e4ac8dc7705560cbe86d03a Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Sat, 25 Jan 2025 17:57:35 +0100 Subject: [PATCH 22/36] Add documentation for Browser-Only static extension support and update naming of package.json scripts --- ADOPTING.md | 74 ++++++++++++++++++++++++++++++ examples/browser-only/package.json | 8 ++-- 2 files changed, 77 insertions(+), 5 deletions(-) create mode 100644 ADOPTING.md diff --git a/ADOPTING.md b/ADOPTING.md new file mode 100644 index 0000000000000..758a2ce697ba8 --- /dev/null +++ b/ADOPTING.md @@ -0,0 +1,74 @@ +## Browser-Only + +### Static Extension Support + +Currently, Theia Browser-Only supports the static configuration of extensions. This means only the extensions that are statically configured at build time will be available in the browser. Theia Browser-Only does not support dynamic extension loading at runtime. + +When it comes to extension support, there are some restrictions to consider: +1. The extensions must be compatible to run in a browser environment. This means that ideally, the extension is already a web extension according to the [VS Code Web Extension API](https://code.visualstudio.com/api/extension-guides/web-extensions). +2. The extensions must not rely on Node.js APIs or other APIs that are not available in the browser. + +There are two ways to retrieve extensions: +1. VSIX packages: Copy the `.vsix` files to the directory specified in the `package.json` file by the `theiaPluginsDir` property. (e.g. `"theiaPluginsDir": "plugins"`) +2. Open VSX Link: Specify a list of `id:link` mappings in the `package.json` file by the `theiaPlugins` property (e.g. `"theiaPlugins": { "vscodevim.vim": "https://open-vsx.org/api/vscodevim/vim/1.29.0/file/vscodevim.vim-1.29.0.vsix" }`). Extensions can be found on the [Open VSX Registry](https://open-vsx.org/) by searching for the extension and copying the link linked to the Download button. +When using the command `yarn download:plugins`, Theia will download the `.vsix` files from the specified links and install them in the directory specified by the `theiaPluginsDir` property. + +After the extensions are downloaded, they need be packaged into the Theia Browser-Only application. To do this, run the command `yarn package:plugins` which in turn will run the [script](examples/browser-only/prepare-plugins.js) to unpack the `.vsix` files and copy the contents to the `lib/frontend/hostedPlugin` directory. + +As Theia need to know which extensions are available, the `pluginMetadata` inside the `PluginLocalOptions` needs to be updated with the metadata of the extensions. This can be achieved by specifying the metadata and binding it to `PluginLocalOptions` (see this [example initialization](examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts)). + +As of now, the metadata is required to be specified manually. In the future, it is planned to automate this process. +An example of the format of meta can be found [here](examples/api-samples/src/browser-only/plugin-sample/example-static-plugin-metadata.ts). In the following section we will give tips on how to generate this metadata such that it adheres to the `DeployedPlugin` interface (see [`plugin-protocol.ts`](packages/plugin-ext/src/common/plugin-protocol.ts)). + +#### Creating the static metadata +Most of the information to create the model in metadata can be found in the `package.json` file of the extension. + +The general structure of each entry should be as follows: +```typescript +{ + "metadata": { + ... + }, + "type": 0, // should always be set to 0 + "contributes": { + ... + }, + }, +``` + +The `metadata` object should contain the following fields: +```typescript +metadata: { + 'host': 'main', // Should always be set to 'main' + 'model': { + 'packagePath': '/home/user/theia/examples/browser-only/plugins/theia.helloworld-web-sample/extension', // Deprecated + 'packageUri': 'file:///home/user/theia/examples/browser-only/plugins/theia.helloworld-web-sample/extension', // The absolute path to the extension's location inside the 'theiaPluginsDir' directory; prefixed with 'file://' protocol + 'id': 'theia.helloworld-web-sample', // the extension's id; typically the publisher name and the extension name separated by a dot + 'name': 'helloworld-web-sample', // the extension's name as specified in the 'package.json' file + 'publisher': 'theia', // the extension's publisher as specified in the 'package.json' file + 'version': '0.0.1', // the extension's version as specified in the 'package.json' file + 'displayName': 'theia.helloworld-web-sample', // the extension's display name as specified in the 'package.json' file + 'description': '', // the extension's description as specified in the 'package.json' file + 'engine': { + 'type': 'vscode', // incase of vscode web extension; if Theia plugin, set to 'theiaPlugin' + 'version': '^1.74.0' // the version of the engine the extension is compatible with; specified in the 'engines' field of the 'package.json' file + }, + 'entryPoint': { + 'frontend': 'dist/web/extension.js' // specified by the 'browser' field in the 'package.json' file for VScode web extensions or 'frontend' field for Theia plugins + } + }, + 'lifecycle': { + 'startMethod': 'activate', // the method to call when the extension is activated; typically 'activate' for VS Code extensions and 'start' for Theia plugins + 'stopMethod': 'deactivate', // the method to call when the extension is deactivated; typically 'deactivate' for VS Code extensions and 'stop' for Theia plugins + 'frontendModuleName': 'theia_helloworld_web_sample', // the id specified above but with underscores instead of dots and dashes + 'frontendInitPath': 'plugin-vscode-init-fe.js', // the path to the frontend initialization script; only required for VS Code extensions + 'backendInitPath': '/Users/user/theia/examples/browser/lib/backend/plugin-vscode-init' // the path to the backend initialization script; for Theia plugins, this path ends with 'backend-init-theia' + }, + 'outOfSync': false, // should always be set to false + 'isUnderDevelopment': false // should always be set to false +}, +``` + +For the `contributes` object, one can copy the `contributes` object from the `package.json` file of the extension. This object contains the contributions the extension makes to the Theia application. This includes 'activationEvents', 'commands', 'configuration', 'debuggers' etc. Details on the structure of the `contributes` object can be found in the [plugin-protocol file under PluginContribution](packages/plugin-ext/src/common/plugin-protocol.ts). + +Once this static metadata is complete, one can build and start the Theia Browser-Only application. The extensions should now be available in the browser. To verify that the extensions are correctly packaged with the Theia Browser-Only application, one can check the `lib/frontend/hostedPlugin` directory. The extensions should be present in this directory with the correct `frontendModuleName`. diff --git a/examples/browser-only/package.json b/examples/browser-only/package.json index d4f4b73b5beb1..4decd9691fd0f 100644 --- a/examples/browser-only/package.json +++ b/examples/browser-only/package.json @@ -15,9 +15,7 @@ } }, "theiaPluginsDir": "plugins", - "theiaPlugins": { - "vscode.simple-browser": "https://open-vsx.org/api/vscode/simple-browser/1.88.1/file/vscode.simple-browser-1.88.1.vsix" - }, + "theiaPlugins": {}, "dependencies": { "@theia/ai-chat": "1.54.0", "@theia/ai-chat-ui": "1.54.0", @@ -74,10 +72,10 @@ "scripts": { "prepare:no-native": "lerna run prepare --scope=\"@theia/re-exports\" && lerna run generate-theia-re-exports --scope=\"@theia/core\"", "clean": "theia clean", - "build": "yarn -s compile && yarn deploy:plugin && yarn -s bundle", + "build": "yarn -s compile && yarn package:plugins && yarn -s bundle", "bundle": "theia build --mode development", "download:plugins": "theia download:plugins", - "deploy:plugin": "node ./prepare-plugins.js", + "package:plugins": "node ./prepare-plugins.js", "compile": "tsc -b", "start": "theia start", "start:debug": "yarn -s start --log-level=debug", From f1ea8c05854597ac84b1b5e1e6ef57c8a4ca8a5a Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Sat, 25 Jan 2025 18:06:53 +0100 Subject: [PATCH 23/36] Add TypeScript plugins and enhance ADOPTING.md --- ADOPTING.md | 6 +- .../example-static-plugin-metadata.ts | 13841 +++++++++++++++- examples/browser-only/package.json | 5 +- 3 files changed, 13772 insertions(+), 80 deletions(-) diff --git a/ADOPTING.md b/ADOPTING.md index 758a2ce697ba8..1aa0be19969e0 100644 --- a/ADOPTING.md +++ b/ADOPTING.md @@ -56,11 +56,15 @@ metadata: { 'entryPoint': { 'frontend': 'dist/web/extension.js' // specified by the 'browser' field in the 'package.json' file for VScode web extensions or 'frontend' field for Theia plugins } + iconUrl: 'hostedPlugin/theia_helloworld_web_sample/media%2Ficon.png', // optional: the path to the extension's icon; prefixed with 'hostedPlugin' and URL encoded + l10n: undefined, + readmeUrl: 'hostedPlugin/theia_helloworld_web_sample/.%2FREADME.md', // optional: the path to the extension's README file; prefixed with 'hostedPlugin' and URL encoded + licenseUrl: 'hostedPlugin/theia_helloworld_web_sample/.%2FLICENSE', // optional: the path to the extension's LICENSE file; prefixed with 'hostedPlugin' and URL encoded }, 'lifecycle': { 'startMethod': 'activate', // the method to call when the extension is activated; typically 'activate' for VS Code extensions and 'start' for Theia plugins 'stopMethod': 'deactivate', // the method to call when the extension is deactivated; typically 'deactivate' for VS Code extensions and 'stop' for Theia plugins - 'frontendModuleName': 'theia_helloworld_web_sample', // the id specified above but with underscores instead of dots and dashes + 'frontendModuleName': 'theia_helloworld_web_sample', // the id specified above but with underscores instead of dots and dashes similar to iconUrl, readmeUrl, and licenseUrl 'frontendInitPath': 'plugin-vscode-init-fe.js', // the path to the frontend initialization script; only required for VS Code extensions 'backendInitPath': '/Users/user/theia/examples/browser/lib/backend/plugin-vscode-init' // the path to the backend initialization script; for Theia plugins, this path ends with 'backend-init-theia' }, diff --git a/examples/api-samples/src/browser-only/plugin-sample/example-static-plugin-metadata.ts b/examples/api-samples/src/browser-only/plugin-sample/example-static-plugin-metadata.ts index 8623878546fce..c0a4b654e5746 100644 --- a/examples/api-samples/src/browser-only/plugin-sample/example-static-plugin-metadata.ts +++ b/examples/api-samples/src/browser-only/plugin-sample/example-static-plugin-metadata.ts @@ -18,97 +18,13782 @@ export const staticMetadata: any[] = [ { metadata: { host: 'main', - 'model': { - 'packagePath': '/Users/robertjandow/Documents/Development/theia/plugins/demo-plugin', // Deprecated - 'packageUri': 'file:///Users/robertjandow/Documents/Development/theia/plugins/demo-plugin', - 'id': 'theia.demo-plugin', - 'name': 'demo-plugin', - 'publisher': 'theia', - 'version': '0.0.1', - 'displayName': 'theia.demo-plugin', - 'description': '', - 'engine': { - 'type': 'theiaPlugin', - 'version': 'next' - }, - 'entryPoint': { - 'frontend': 'dist/demo-plugin-frontend.js' - } + model: { + packagePath: '/home/user/theia/examples/browser-only/plugins/vscode.typescript-language-features/extension', + packageUri: 'file:///home/user/theia/examples/browser-only/plugins/vscode.typescript-language-features', + id: 'vscode.typescript-language-features', + name: 'typescript-language-features', + publisher: 'vscode', + version: '1.95.3', + displayName: 'TypeScript and JavaScript Language Features (built-in)', + description: 'Provides rich language support for JavaScript and TypeScript.', + engine: { + type: 'vscode', + version: '^1.30.0', + }, + entryPoint: { + frontend: './dist/browser/extension.js', + }, + iconUrl: 'hostedPlugin/vscode_typescript_language_features/media%2Ficon.png', + l10n: undefined, + readmeUrl: 'hostedPlugin/vscode_typescript_language_features/.%2FREADME.md', + licenseUrl: 'hostedPlugin/vscode_typescript_language_features/.%2FLICENSE', }, - 'lifecycle': { - 'startMethod': 'start', - 'stopMethod': 'stop', - 'frontendModuleName': 'theia_demo_plugin', - 'backendInitPath': '/Users/robertjandow/Documents/Development/theia/examples/browser/lib/backend/backend-init-theia' + lifecycle: { + startMethod: 'activate', + stopMethod: 'deactivate', + frontendModuleName: 'vscode_typescript_language_features', + frontendInitPath: 'plugin-vscode-init-fe.js', + backendInitPath: '/home/user/theia/examples/browser/lib/backend/plugin-vscode-init', }, - 'outOfSync': false, - 'isUnderDevelopment': false + outOfSync: false, + isUnderDevelopment: false, + }, + type: 0, + contributes: { + activationEvents: [ + 'onLanguage:javascript', + 'onLanguage:javascriptreact', + 'onLanguage:typescript', + 'onLanguage:typescriptreact', + 'onLanguage:jsx-tags', + 'onCommand:typescript.tsserverRequest', + 'onCommand:_typescript.configurePlugin', + 'onCommand:_typescript.learnMoreAboutRefactorings', + 'onCommand:typescript.fileReferences', + 'onTaskType:typescript', + 'onLanguage:jsonc', + 'onWalkthrough:nodejsWelcome', + 'onCommand:typescript.reloadProjects', + 'onCommand:javascript.reloadProjects', + 'onCommand:typescript.selectTypeScriptVersion', + 'onCommand:typescript.goToProjectConfig', + 'onCommand:javascript.goToProjectConfig', + 'onCommand:typescript.openTsServerLog', + 'onCommand:typescript.restartTsServer', + 'onCommand:typescript.findAllFileReferences', + 'onCommand:typescript.goToSourceDefinition', + 'onCommand:typescript.sortImports', + 'onCommand:javascript.sortImports', + 'onCommand:typescript.removeUnusedImports', + 'onCommand:javascript.removeUnusedImports', + ], + configuration: [ + { + type: 'object', + title: 'TypeScript', + order: 20, + properties: { + 'typescript.tsdk': { + type: 'string', + markdownDescription: 'Specifies the folder path to the tsserver and `lib*.d.ts` files under a TypeScript install to use for IntelliSense, for example: `./node_modules/typescript/lib`.\n\n- When specified as a user setting, the TypeScript version from `typescript.tsdk` automatically replaces the built-in TypeScript version.\n- When specified as a workspace setting, `typescript.tsdk` allows you to switch to use that workspace version of TypeScript for IntelliSense with the `TypeScript: Select TypeScript version` command.\n\nSee the [TypeScript documentation](https://code.visualstudio.com/docs/typescript/typescript-compiling#_using-newer-typescript-versions) for more detail about managing TypeScript versions.', + scope: 'window', + }, + 'typescript.disableAutomaticTypeAcquisition': { + type: 'boolean', + default: false, + markdownDescription: 'Disables [automatic type acquisition](https://code.visualstudio.com/docs/nodejs/working-with-javascript#_typings-and-automatic-type-acquisition). Automatic type acquisition fetches `@types` packages from npm to improve IntelliSense for external libraries.', + scope: 'window', + tags: [ + 'usesOnlineServices', + ], + }, + 'typescript.enablePromptUseWorkspaceTsdk': { + type: 'boolean', + default: false, + description: 'Enables prompting of users to use the TypeScript version configured in the workspace for Intellisense.', + scope: 'window', + }, + 'typescript.npm': { + type: 'string', + markdownDescription: 'Specifies the path to the npm executable used for [Automatic Type Acquisition](https://code.visualstudio.com/docs/nodejs/working-with-javascript#_typings-and-automatic-type-acquisition).', + scope: 'machine', + }, + 'typescript.check.npmIsInstalled': { + type: 'boolean', + default: true, + markdownDescription: 'Check if npm is installed for [Automatic Type Acquisition](https://code.visualstudio.com/docs/nodejs/working-with-javascript#_typings-and-automatic-type-acquisition).', + scope: 'window', + }, + 'javascript.referencesCodeLens.enabled': { + type: 'boolean', + default: false, + description: 'Enable/disable references CodeLens in JavaScript files.', + scope: 'window', + }, + 'javascript.referencesCodeLens.showOnAllFunctions': { + type: 'boolean', + default: false, + description: 'Enable/disable references CodeLens on all functions in JavaScript files.', + scope: 'window', + }, + 'typescript.referencesCodeLens.enabled': { + type: 'boolean', + default: false, + description: 'Enable/disable references CodeLens in TypeScript files.', + scope: 'window', + }, + 'typescript.referencesCodeLens.showOnAllFunctions': { + type: 'boolean', + default: false, + description: 'Enable/disable references CodeLens on all functions in TypeScript files.', + scope: 'window', + }, + 'typescript.implementationsCodeLens.enabled': { + type: 'boolean', + default: false, + description: 'Enable/disable implementations CodeLens. This CodeLens shows the implementers of an interface.', + scope: 'window', + }, + 'typescript.tsserver.enableTracing': { + type: 'boolean', + default: false, + description: 'Enables tracing TS server performance to a directory. These trace files can be used to diagnose TS Server performance issues. The log may contain file paths, source code, and other potentially sensitive information from your project.', + scope: 'window', + }, + 'typescript.tsserver.log': { + type: 'string', + enum: [ + 'off', + 'terse', + 'normal', + 'verbose', + ], + default: 'off', + description: 'Enables logging of the TS server to a file. This log can be used to diagnose TS Server issues. The log may contain file paths, source code, and other potentially sensitive information from your project.', + scope: 'window', + }, + 'typescript.tsserver.pluginPaths': { + type: 'array', + items: { + type: 'string', + description: 'Either an absolute or relative path. Relative path will be resolved against workspace folder(s).', + }, + default: [ + ], + description: 'Additional paths to discover TypeScript Language Service plugins.', + scope: 'machine', + }, + 'typescript.tsserver.trace': { + type: 'string', + enum: [ + 'off', + 'messages', + 'verbose', + ], + default: 'off', + description: 'Enables tracing of messages sent to the TS server. This trace can be used to diagnose TS Server issues. The trace may contain file paths, source code, and other potentially sensitive information from your project.', + scope: 'window', + }, + 'javascript.suggest.completeFunctionCalls': { + type: 'boolean', + default: false, + description: 'Complete functions with their parameter signature.', + scope: 'resource', + }, + 'typescript.suggest.completeFunctionCalls': { + type: 'boolean', + default: false, + description: 'Complete functions with their parameter signature.', + scope: 'resource', + }, + 'javascript.suggest.includeAutomaticOptionalChainCompletions': { + type: 'boolean', + default: true, + description: 'Enable/disable showing completions on potentially undefined values that insert an optional chain call. Requires strict null checks to be enabled.', + scope: 'resource', + }, + 'typescript.suggest.includeAutomaticOptionalChainCompletions': { + type: 'boolean', + default: true, + description: 'Enable/disable showing completions on potentially undefined values that insert an optional chain call. Requires strict null checks to be enabled.', + scope: 'resource', + }, + 'typescript.inlayHints.parameterNames.enabled': { + type: 'string', + enum: [ + 'none', + 'literals', + 'all', + ], + enumDescriptions: [ + 'Disable parameter name hints.', + 'Enable parameter name hints only for literal arguments.', + 'Enable parameter name hints for literal and non-literal arguments.', + ], + default: 'none', + markdownDescription: "Enable/disable inlay hints for parameter names:\n```typescript\n\nparseInt(/* str: */ '123', /* radix: */ 8)\n \n```", + scope: 'resource', + }, + 'typescript.inlayHints.parameterNames.suppressWhenArgumentMatchesName': { + type: 'boolean', + default: true, + markdownDescription: 'Suppress parameter name hints on arguments whose text is identical to the parameter name.', + scope: 'resource', + }, + 'typescript.inlayHints.parameterTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: "Enable/disable inlay hints for implicit parameter types:\n```typescript\n\nel.addEventListener('click', e /* :MouseEvent */ => ...)\n \n```", + scope: 'resource', + }, + 'typescript.inlayHints.variableTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for implicit variable types:\n```typescript\n\nconst foo /* :number */ = Date.now();\n \n```', + scope: 'resource', + }, + 'typescript.inlayHints.variableTypes.suppressWhenTypeMatchesName': { + type: 'boolean', + default: true, + markdownDescription: 'Suppress type hints on variables whose name is identical to the type name. Requires using TypeScript 4.8+ in the workspace.', + scope: 'resource', + }, + 'typescript.inlayHints.propertyDeclarationTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for implicit types on property declarations:\n```typescript\n\nclass Foo {\n\tprop /* :number */ = Date.now();\n}\n \n```', + scope: 'resource', + }, + 'typescript.inlayHints.functionLikeReturnTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for implicit return types on function signatures:\n```typescript\n\nfunction foo() /* :number */ {\n\treturn Date.now();\n} \n \n```', + scope: 'resource', + }, + 'typescript.inlayHints.enumMemberValues.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for member values in enum declarations:\n```typescript\n\nenum MyValue {\n\tA /* = 0 */;\n\tB /* = 1 */;\n}\n \n```', + scope: 'resource', + }, + 'javascript.inlayHints.parameterNames.enabled': { + type: 'string', + enum: [ + 'none', + 'literals', + 'all', + ], + enumDescriptions: [ + 'Disable parameter name hints.', + 'Enable parameter name hints only for literal arguments.', + 'Enable parameter name hints for literal and non-literal arguments.', + ], + default: 'none', + markdownDescription: "Enable/disable inlay hints for parameter names:\n```typescript\n\nparseInt(/* str: */ '123', /* radix: */ 8)\n \n```", + scope: 'resource', + }, + 'javascript.inlayHints.parameterNames.suppressWhenArgumentMatchesName': { + type: 'boolean', + default: true, + markdownDescription: 'Suppress parameter name hints on arguments whose text is identical to the parameter name.', + scope: 'resource', + }, + 'javascript.inlayHints.parameterTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: "Enable/disable inlay hints for implicit parameter types:\n```typescript\n\nel.addEventListener('click', e /* :MouseEvent */ => ...)\n \n```", + scope: 'resource', + }, + 'javascript.inlayHints.variableTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for implicit variable types:\n```typescript\n\nconst foo /* :number */ = Date.now();\n \n```', + scope: 'resource', + }, + 'javascript.inlayHints.variableTypes.suppressWhenTypeMatchesName': { + type: 'boolean', + default: true, + markdownDescription: 'Suppress type hints on variables whose name is identical to the type name. Requires using TypeScript 4.8+ in the workspace.', + scope: 'resource', + }, + 'javascript.inlayHints.propertyDeclarationTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for implicit types on property declarations:\n```typescript\n\nclass Foo {\n\tprop /* :number */ = Date.now();\n}\n \n```', + scope: 'resource', + }, + 'javascript.inlayHints.functionLikeReturnTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for implicit return types on function signatures:\n```typescript\n\nfunction foo() /* :number */ {\n\treturn Date.now();\n} \n \n```', + scope: 'resource', + }, + 'javascript.inlayHints.enumMemberValues.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for member values in enum declarations:\n```typescript\n\nenum MyValue {\n\tA /* = 0 */;\n\tB /* = 1 */;\n}\n \n```', + scope: 'resource', + }, + 'javascript.suggest.includeCompletionsForImportStatements': { + type: 'boolean', + default: true, + description: 'Enable/disable auto-import-style completions on partially-typed import statements.', + scope: 'resource', + }, + 'typescript.suggest.includeCompletionsForImportStatements': { + type: 'boolean', + default: true, + description: 'Enable/disable auto-import-style completions on partially-typed import statements.', + scope: 'resource', + }, + 'typescript.reportStyleChecksAsWarnings': { + type: 'boolean', + default: true, + description: 'Report style checks as warnings.', + scope: 'window', + }, + 'typescript.validate.enable': { + type: 'boolean', + default: true, + description: 'Enable/disable TypeScript validation.', + scope: 'window', + }, + 'typescript.format.enable': { + type: 'boolean', + default: true, + description: 'Enable/disable default TypeScript formatter.', + scope: 'window', + }, + 'typescript.format.insertSpaceAfterCommaDelimiter': { + type: 'boolean', + default: true, + description: 'Defines space handling after a comma delimiter.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterConstructor': { + type: 'boolean', + default: false, + description: 'Defines space handling after the constructor keyword.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterSemicolonInForStatements': { + type: 'boolean', + default: true, + description: 'Defines space handling after a semicolon in a for statement.', + scope: 'resource', + }, + 'typescript.format.insertSpaceBeforeAndAfterBinaryOperators': { + type: 'boolean', + default: true, + description: 'Defines space handling after a binary operator.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterKeywordsInControlFlowStatements': { + type: 'boolean', + default: true, + description: 'Defines space handling after keywords in a control flow statement.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions': { + type: 'boolean', + default: true, + description: 'Defines space handling after function keyword for anonymous functions.', + scope: 'resource', + }, + 'typescript.format.insertSpaceBeforeFunctionParenthesis': { + type: 'boolean', + default: false, + description: 'Defines space handling before function argument parentheses.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing non-empty parenthesis.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing non-empty brackets.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces': { + type: 'boolean', + default: true, + description: 'Defines space handling after opening and before closing non-empty braces.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces': { + type: 'boolean', + default: true, + description: 'Defines space handling after opening and before closing empty braces.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing template string braces.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing JSX expression braces.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterTypeAssertion': { + type: 'boolean', + default: false, + description: 'Defines space handling after type assertions in TypeScript.', + scope: 'resource', + }, + 'typescript.format.placeOpenBraceOnNewLineForFunctions': { + type: 'boolean', + default: false, + description: 'Defines whether an open brace is put onto a new line for functions or not.', + scope: 'resource', + }, + 'typescript.format.placeOpenBraceOnNewLineForControlBlocks': { + type: 'boolean', + default: false, + description: 'Defines whether an open brace is put onto a new line for control blocks or not.', + scope: 'resource', + }, + 'typescript.format.semicolons': { + type: 'string', + default: 'ignore', + description: 'Defines handling of optional semicolons.', + scope: 'resource', + enum: [ + 'ignore', + 'insert', + 'remove', + ], + enumDescriptions: [ + "Don't insert or remove any semicolons.", + 'Insert semicolons at statement ends.', + 'Remove unnecessary semicolons.', + ], + }, + 'javascript.validate.enable': { + type: 'boolean', + default: true, + description: 'Enable/disable JavaScript validation.', + scope: 'window', + }, + 'javascript.format.enable': { + type: 'boolean', + default: true, + description: 'Enable/disable default JavaScript formatter.', + scope: 'window', + }, + 'javascript.format.insertSpaceAfterCommaDelimiter': { + type: 'boolean', + default: true, + description: 'Defines space handling after a comma delimiter.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterConstructor': { + type: 'boolean', + default: false, + description: 'Defines space handling after the constructor keyword.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterSemicolonInForStatements': { + type: 'boolean', + default: true, + description: 'Defines space handling after a semicolon in a for statement.', + scope: 'resource', + }, + 'javascript.format.insertSpaceBeforeAndAfterBinaryOperators': { + type: 'boolean', + default: true, + description: 'Defines space handling after a binary operator.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterKeywordsInControlFlowStatements': { + type: 'boolean', + default: true, + description: 'Defines space handling after keywords in a control flow statement.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions': { + type: 'boolean', + default: true, + description: 'Defines space handling after function keyword for anonymous functions.', + scope: 'resource', + }, + 'javascript.format.insertSpaceBeforeFunctionParenthesis': { + type: 'boolean', + default: false, + description: 'Defines space handling before function argument parentheses.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing non-empty parenthesis.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing non-empty brackets.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces': { + type: 'boolean', + default: true, + description: 'Defines space handling after opening and before closing non-empty braces.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces': { + type: 'boolean', + default: true, + description: 'Defines space handling after opening and before closing empty braces.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing template string braces.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing JSX expression braces.', + scope: 'resource', + }, + 'javascript.format.placeOpenBraceOnNewLineForFunctions': { + type: 'boolean', + default: false, + description: 'Defines whether an open brace is put onto a new line for functions or not.', + scope: 'resource', + }, + 'javascript.format.placeOpenBraceOnNewLineForControlBlocks': { + type: 'boolean', + default: false, + description: 'Defines whether an open brace is put onto a new line for control blocks or not.', + scope: 'resource', + }, + 'javascript.format.semicolons': { + type: 'string', + default: 'ignore', + description: 'Defines handling of optional semicolons.', + scope: 'resource', + enum: [ + 'ignore', + 'insert', + 'remove', + ], + enumDescriptions: [ + "Don't insert or remove any semicolons.", + 'Insert semicolons at statement ends.', + 'Remove unnecessary semicolons.', + ], + }, + 'js/ts.implicitProjectConfig.module': { + type: 'string', + markdownDescription: 'Sets the module system for the program. See more: https://www.typescriptlang.org/tsconfig#module.', + default: 'ESNext', + enum: [ + 'CommonJS', + 'AMD', + 'System', + 'UMD', + 'ES6', + 'ES2015', + 'ES2020', + 'ESNext', + 'None', + 'ES2022', + 'Node12', + 'NodeNext', + ], + scope: 'window', + }, + 'js/ts.implicitProjectConfig.target': { + type: 'string', + default: 'ES2020', + markdownDescription: 'Set target JavaScript language version for emitted JavaScript and include library declarations. See more: https://www.typescriptlang.org/tsconfig#target.', + enum: [ + 'ES3', + 'ES5', + 'ES6', + 'ES2015', + 'ES2016', + 'ES2017', + 'ES2018', + 'ES2019', + 'ES2020', + 'ES2021', + 'ES2022', + 'ESNext', + ], + scope: 'window', + }, + 'javascript.implicitProjectConfig.checkJs': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable semantic checking of JavaScript files. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', + markdownDeprecationMessage: 'This setting has been deprecated in favor of `js/ts.implicitProjectConfig.checkJs`.', + scope: 'window', + }, + 'js/ts.implicitProjectConfig.checkJs': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable semantic checking of JavaScript files. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', + scope: 'window', + }, + 'javascript.implicitProjectConfig.experimentalDecorators': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable `experimentalDecorators` in JavaScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', + markdownDeprecationMessage: 'This setting has been deprecated in favor of `js/ts.implicitProjectConfig.experimentalDecorators`.', + scope: 'window', + }, + 'js/ts.implicitProjectConfig.experimentalDecorators': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable `experimentalDecorators` in JavaScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', + scope: 'window', + }, + 'js/ts.implicitProjectConfig.strictNullChecks': { + type: 'boolean', + default: true, + markdownDescription: 'Enable/disable [strict null checks](https://www.typescriptlang.org/tsconfig#strictNullChecks) in JavaScript and TypeScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', + scope: 'window', + }, + 'js/ts.implicitProjectConfig.strictFunctionTypes': { + type: 'boolean', + default: true, + markdownDescription: 'Enable/disable [strict function types](https://www.typescriptlang.org/tsconfig#strictFunctionTypes) in JavaScript and TypeScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', + scope: 'window', + }, + 'javascript.suggest.names': { + type: 'boolean', + default: true, + markdownDescription: 'Enable/disable including unique names from the file in JavaScript suggestions. Note that name suggestions are always disabled in JavaScript code that is semantically checked using `@ts-check` or `checkJs`.', + scope: 'resource', + }, + 'typescript.tsc.autoDetect': { + type: 'string', + default: 'on', + enum: [ + 'on', + 'off', + 'build', + 'watch', + ], + markdownEnumDescriptions: [ + 'Create both build and watch tasks.', + 'Disable this feature.', + 'Only create single run compile tasks.', + 'Only create compile and watch tasks.', + ], + description: 'Controls auto detection of tsc tasks.', + scope: 'window', + }, + 'javascript.suggest.paths': { + type: 'boolean', + default: true, + description: 'Enable/disable suggestions for paths in import statements and require calls.', + scope: 'resource', + }, + 'typescript.suggest.paths': { + type: 'boolean', + default: true, + description: 'Enable/disable suggestions for paths in import statements and require calls.', + scope: 'resource', + }, + 'javascript.suggest.autoImports': { + type: 'boolean', + default: true, + description: 'Enable/disable auto import suggestions.', + scope: 'resource', + }, + 'typescript.suggest.autoImports': { + type: 'boolean', + default: true, + description: 'Enable/disable auto import suggestions.', + scope: 'resource', + }, + 'javascript.suggest.completeJSDocs': { + type: 'boolean', + default: true, + description: 'Enable/disable suggestion to complete JSDoc comments.', + scope: 'language-overridable', + }, + 'typescript.suggest.completeJSDocs': { + type: 'boolean', + default: true, + description: 'Enable/disable suggestion to complete JSDoc comments.', + scope: 'language-overridable', + }, + 'javascript.suggest.jsdoc.generateReturns': { + type: 'boolean', + default: true, + markdownDescription: 'Enable/disable generating `@returns` annotations for JSDoc templates.', + scope: 'language-overridable', + }, + 'typescript.suggest.jsdoc.generateReturns': { + type: 'boolean', + default: true, + markdownDescription: 'Enable/disable generating `@returns` annotations for JSDoc templates.', + scope: 'language-overridable', + }, + 'typescript.locale': { + type: 'string', + default: 'auto', + enum: [ + 'auto', + 'de', + 'es', + 'en', + 'fr', + 'it', + 'ja', + 'ko', + 'ru', + 'zh-CN', + 'zh-TW', + ], + markdownDescription: "Sets the locale used to report JavaScript and TypeScript errors. Defaults to use VS Code's locale.", + scope: 'window', + }, + 'javascript.suggestionActions.enabled': { + type: 'boolean', + default: true, + description: 'Enable/disable suggestion diagnostics for JavaScript files in the editor.', + scope: 'resource', + }, + 'typescript.suggestionActions.enabled': { + type: 'boolean', + default: true, + description: 'Enable/disable suggestion diagnostics for TypeScript files in the editor.', + scope: 'resource', + }, + 'javascript.preferences.quoteStyle': { + type: 'string', + enum: [ + 'auto', + 'single', + 'double', + ], + default: 'auto', + markdownDescription: 'Preferred quote style to use for Quick Fixes.', + markdownEnumDescriptions: [ + 'Infer quote type from existing code', + "Always use single quotes: `'`", + 'Always use double quotes: `"`', + ], + scope: 'language-overridable', + }, + 'typescript.preferences.quoteStyle': { + type: 'string', + enum: [ + 'auto', + 'single', + 'double', + ], + default: 'auto', + markdownDescription: 'Preferred quote style to use for Quick Fixes.', + markdownEnumDescriptions: [ + 'Infer quote type from existing code', + "Always use single quotes: `'`", + 'Always use double quotes: `"`', + ], + scope: 'language-overridable', + }, + 'javascript.preferences.importModuleSpecifier': { + type: 'string', + enum: [ + 'shortest', + 'relative', + 'non-relative', + 'project-relative', + ], + markdownEnumDescriptions: [ + 'Prefers a non-relative import only if one is available that has fewer path segments than a relative import.', + 'Prefers a relative path to the imported file location.', + 'Prefers a non-relative import based on the `baseUrl` or `paths` configured in your `jsconfig.json` / `tsconfig.json`.', + 'Prefers a non-relative import only if the relative import path would leave the package or project directory.', + ], + default: 'shortest', + description: 'Preferred path style for auto imports.', + scope: 'language-overridable', + }, + 'typescript.preferences.importModuleSpecifier': { + type: 'string', + enum: [ + 'shortest', + 'relative', + 'non-relative', + 'project-relative', + ], + markdownEnumDescriptions: [ + 'Prefers a non-relative import only if one is available that has fewer path segments than a relative import.', + 'Prefers a relative path to the imported file location.', + 'Prefers a non-relative import based on the `baseUrl` or `paths` configured in your `jsconfig.json` / `tsconfig.json`.', + 'Prefers a non-relative import only if the relative import path would leave the package or project directory.', + ], + default: 'shortest', + description: 'Preferred path style for auto imports.', + scope: 'language-overridable', + }, + 'javascript.preferences.importModuleSpecifierEnding': { + type: 'string', + enum: [ + 'auto', + 'minimal', + 'index', + 'js', + ], + markdownEnumDescriptions: [ + 'Use project settings to select a default.', + 'Shorten `./component/index.js` to `./component`.', + 'Shorten `./component/index.js` to `./component/index`.', + 'Do not shorten path endings; include the `.js` extension.', + ], + default: 'auto', + description: 'Preferred path ending for auto imports.', + scope: 'language-overridable', + }, + 'typescript.preferences.importModuleSpecifierEnding': { + type: 'string', + enum: [ + 'auto', + 'minimal', + 'index', + 'js', + ], + markdownEnumDescriptions: [ + 'Use project settings to select a default.', + 'Shorten `./component/index.js` to `./component`.', + 'Shorten `./component/index.js` to `./component/index`.', + 'Do not shorten path endings; include the `.js` extension.', + ], + default: 'auto', + description: 'Preferred path ending for auto imports.', + scope: 'language-overridable', + }, + 'javascript.preferences.jsxAttributeCompletionStyle': { + type: 'string', + enum: [ + 'auto', + 'braces', + 'none', + ], + markdownEnumDescriptions: [ + 'Insert `={}` or `=""` after attribute names based on the prop type. See `javascript.preferences.quoteStyle` to control the type of quotes used for string attributes.', + 'Insert `={}` after attribute names.', + 'Only insert attribute names.', + ], + default: 'auto', + description: 'Preferred style for JSX attribute completions.', + scope: 'language-overridable', + }, + 'typescript.preferences.jsxAttributeCompletionStyle': { + type: 'string', + enum: [ + 'auto', + 'braces', + 'none', + ], + markdownEnumDescriptions: [ + 'Insert `={}` or `=""` after attribute names based on the prop type. See `typescript.preferences.quoteStyle` to control the type of quotes used for string attributes.', + 'Insert `={}` after attribute names.', + 'Only insert attribute names.', + ], + default: 'auto', + description: 'Preferred style for JSX attribute completions.', + scope: 'language-overridable', + }, + 'typescript.preferences.includePackageJsonAutoImports': { + type: 'string', + enum: [ + 'auto', + 'on', + 'off', + ], + enumDescriptions: [ + 'Search dependencies based on estimated performance impact.', + 'Always search dependencies.', + 'Never search dependencies.', + ], + default: 'auto', + markdownDescription: 'Enable/disable searching `package.json` dependencies for available auto imports.', + scope: 'window', + }, + 'typescript.preferences.autoImportFileExcludePatterns': { + type: 'array', + items: { + type: 'string', + }, + markdownDescription: 'Specify glob patterns of files to exclude from auto imports. Requires using TypeScript 4.8 or newer in the workspace.', + scope: 'resource', + }, + 'javascript.preferences.autoImportFileExcludePatterns': { + type: 'array', + items: { + type: 'string', + }, + markdownDescription: 'Specify glob patterns of files to exclude from auto imports. Requires using TypeScript 4.8 or newer in the workspace.', + scope: 'resource', + }, + 'javascript.preferences.renameShorthandProperties': { + type: 'boolean', + default: true, + description: 'Enable/disable introducing aliases for object shorthand properties during renames.', + deprecationMessage: "The setting 'typescript.preferences.renameShorthandProperties' has been deprecated in favor of 'typescript.preferences.useAliasesForRenames'", + scope: 'language-overridable', + }, + 'typescript.preferences.renameShorthandProperties': { + type: 'boolean', + default: true, + description: 'Enable/disable introducing aliases for object shorthand properties during renames.', + deprecationMessage: "The setting 'typescript.preferences.renameShorthandProperties' has been deprecated in favor of 'typescript.preferences.useAliasesForRenames'", + scope: 'language-overridable', + }, + 'javascript.preferences.useAliasesForRenames': { + type: 'boolean', + default: true, + description: 'Enable/disable introducing aliases for object shorthand properties during renames.', + scope: 'language-overridable', + }, + 'typescript.preferences.useAliasesForRenames': { + type: 'boolean', + default: true, + description: 'Enable/disable introducing aliases for object shorthand properties during renames.', + scope: 'language-overridable', + }, + 'typescript.updateImportsOnFileMove.enabled': { + type: 'string', + enum: [ + 'prompt', + 'always', + 'never', + ], + markdownEnumDescriptions: [ + 'Prompt on each rename.', + 'Always update paths automatically.', + "Never rename paths and don't prompt.", + ], + default: 'prompt', + description: 'Enable/disable automatic updating of import paths when you rename or move a file in VS Code.', + scope: 'resource', + }, + 'javascript.updateImportsOnFileMove.enabled': { + type: 'string', + enum: [ + 'prompt', + 'always', + 'never', + ], + markdownEnumDescriptions: [ + 'Prompt on each rename.', + 'Always update paths automatically.', + "Never rename paths and don't prompt.", + ], + default: 'prompt', + description: 'Enable/disable automatic updating of import paths when you rename or move a file in VS Code.', + scope: 'resource', + }, + 'typescript.autoClosingTags': { + type: 'boolean', + default: true, + description: 'Enable/disable automatic closing of JSX tags.', + scope: 'language-overridable', + }, + 'javascript.autoClosingTags': { + type: 'boolean', + default: true, + description: 'Enable/disable automatic closing of JSX tags.', + scope: 'language-overridable', + }, + 'javascript.suggest.enabled': { + type: 'boolean', + default: true, + description: 'Enabled/disable autocomplete suggestions.', + scope: 'language-overridable', + }, + 'typescript.suggest.enabled': { + type: 'boolean', + default: true, + description: 'Enabled/disable autocomplete suggestions.', + scope: 'language-overridable', + }, + 'typescript.surveys.enabled': { + type: 'boolean', + default: true, + description: "Enabled/disable occasional surveys that help us improve VS Code's JavaScript and TypeScript support.", + scope: 'window', + }, + 'typescript.tsserver.useSeparateSyntaxServer': { + type: 'boolean', + default: true, + description: 'Enable/disable spawning a separate TypeScript server that can more quickly respond to syntax related operations, such as calculating folding or computing document symbols.', + markdownDeprecationMessage: 'This setting has been deprecated in favor of `typescript.tsserver.useSyntaxServer`.', + scope: 'window', + }, + 'typescript.tsserver.useSyntaxServer': { + type: 'string', + scope: 'window', + description: 'Controls if TypeScript launches a dedicated server to more quickly handle syntax related operations, such as computing code folding.', + default: 'auto', + enum: [ + 'always', + 'never', + 'auto', + ], + enumDescriptions: [ + 'Use a lighter weight syntax server to handle all IntelliSense operations. This syntax server can only provide IntelliSense for opened files.', + "Don't use a dedicated syntax server. Use a single server to handle all IntelliSense operations.", + 'Spawn both a full server and a lighter weight server dedicated to syntax operations. The syntax server is used to speed up syntax operations and provide IntelliSense while projects are loading.', + ], + }, + 'typescript.tsserver.maxTsServerMemory': { + type: 'number', + default: 3072, + description: 'The maximum amount of memory (in MB) to allocate to the TypeScript server process.', + scope: 'window', + }, + 'typescript.tsserver.experimental.enableProjectDiagnostics': { + type: 'boolean', + default: false, + description: '(Experimental) Enables project wide error reporting.', + scope: 'window', + tags: [ + 'experimental', + ], + }, + 'typescript.tsserver.watchOptions': { + type: 'object', + description: 'Configure which watching strategies should be used to keep track of files and directories.', + scope: 'window', + properties: { + watchFile: { + type: 'string', + description: 'Strategy for how individual files are watched.', + enum: [ + 'fixedChunkSizePolling', + 'fixedPollingInterval', + 'priorityPollingInterval', + 'dynamicPriorityPolling', + 'useFsEvents', + 'useFsEventsOnParentDirectory', + ], + enumDescriptions: [ + 'Polls files in chunks at regular interval.', + 'Check every file for changes several times a second at a fixed interval.', + 'Check every file for changes several times a second, but use heuristics to check certain types of files less frequently than others.', + 'Use a dynamic queue where less-frequently modified files will be checked less often.', + "Attempt to use the operating system/file system's native events for file changes.", + "Attempt to use the operating system/file system's native events to listen for changes on a file's containing directories. This can use fewer file watchers, but might be less accurate.", + ], + default: 'useFsEvents', + }, + watchDirectory: { + type: 'string', + description: 'Strategy for how entire directory trees are watched under systems that lack recursive file-watching functionality.', + enum: [ + 'fixedChunkSizePolling', + 'fixedPollingInterval', + 'dynamicPriorityPolling', + 'useFsEvents', + ], + enumDescriptions: [ + 'Polls directories in chunks at regular interval.', + 'Check every directory for changes several times a second at a fixed interval.', + 'Use a dynamic queue where less-frequently modified directories will be checked less often.', + "Attempt to use the operating system/file system's native events for directory changes.", + ], + default: 'useFsEvents', + }, + fallbackPolling: { + type: 'string', + description: "When using file system events, this option specifies the polling strategy that gets used when the system runs out of native file watchers and/or doesn't support native file watchers.", + enum: [ + 'fixedPollingInterval', + 'priorityPollingInterval', + 'dynamicPriorityPolling', + ], + enumDescriptions: [ + 'configuration.tsserver.watchOptions.fallbackPolling.fixedPollingInterval', + 'configuration.tsserver.watchOptions.fallbackPolling.priorityPollingInterval', + 'configuration.tsserver.watchOptions.fallbackPolling.dynamicPriorityPolling', + ], + }, + synchronousWatchDirectory: { + type: 'boolean', + description: 'Disable deferred watching on directories. Deferred watching is useful when lots of file changes might occur at once (e.g. a change in node_modules from running npm install), but you might want to disable it with this flag for some less-common setups.', + }, + }, + }, + 'typescript.workspaceSymbols.scope': { + type: 'string', + enum: [ + 'allOpenProjects', + 'currentProject', + ], + enumDescriptions: [ + 'Search all open JavaScript or TypeScript projects for symbols.', + 'Only search for symbols in the current JavaScript or TypeScript project.', + ], + default: 'allOpenProjects', + markdownDescription: 'Controls which files are searched by [Go to Symbol in Workspace](https://code.visualstudio.com/docs/editor/editingevolved#_open-symbol-by-name).', + scope: 'window', + }, + 'javascript.suggest.classMemberSnippets.enabled': { + type: 'boolean', + default: true, + description: 'Enable/disable snippet completions for class members.', + scope: 'resource', + }, + 'typescript.suggest.classMemberSnippets.enabled': { + type: 'boolean', + default: true, + description: 'Enable/disable snippet completions for class members.', + scope: 'resource', + }, + 'typescript.suggest.objectLiteralMethodSnippets.enabled': { + type: 'boolean', + default: true, + description: 'Enable/disable snippet completions for methods in object literals. Requires using TypeScript 4.7+ in the workspace.', + scope: 'resource', + }, + 'typescript.experimental.tsserver.web.enableProjectWideIntellisense': { + type: 'boolean', + default: false, + description: 'Enable/disable project-wide IntelliSense on web. Requires that VS Code is running in a trusted context.', + scope: 'window', + tags: [ + 'experimental', + ], + }, + }, + }, + ], + configurationDefaults: undefined, + commands: [ + { + command: 'typescript.reloadProjects', + title: 'Reload Project', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'javascript.reloadProjects', + title: 'Reload Project', + originalTitle: undefined, + category: 'JavaScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.selectTypeScriptVersion', + title: 'Select TypeScript Version...', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.goToProjectConfig', + title: 'Go to Project Configuration', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'javascript.goToProjectConfig', + title: 'Go to Project Configuration', + originalTitle: undefined, + category: 'JavaScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.openTsServerLog', + title: 'Open TS Server log', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.restartTsServer', + title: 'Restart TS Server', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.findAllFileReferences', + title: 'Find File References', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.goToSourceDefinition', + title: 'Go to Source Definition', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.sortImports', + title: 'Sort Imports', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'javascript.sortImports', + title: 'Sort Imports', + originalTitle: undefined, + category: 'JavaScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.removeUnusedImports', + title: 'Remove Unused Imports', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'javascript.removeUnusedImports', + title: 'Remove Unused Imports', + originalTitle: undefined, + category: 'JavaScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + ], + menus: { + commandPalette: [ + { + command: 'typescript.reloadProjects', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == typescript && typescript.isManagedFile', + }, + { + command: 'typescript.reloadProjects', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == typescriptreact && typescript.isManagedFile', + }, + { + command: 'javascript.reloadProjects', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == javascript && typescript.isManagedFile', + }, + { + command: 'javascript.reloadProjects', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == javascriptreact && typescript.isManagedFile', + }, + { + command: 'typescript.goToProjectConfig', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == typescript && typescript.isManagedFile', + }, + { + command: 'typescript.goToProjectConfig', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == typescriptreact', + }, + { + command: 'javascript.goToProjectConfig', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == javascript && typescript.isManagedFile', + }, + { + command: 'javascript.goToProjectConfig', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == javascriptreact && typescript.isManagedFile', + }, + { + command: 'typescript.selectTypeScriptVersion', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'typescript.isManagedFile', + }, + { + command: 'typescript.openTsServerLog', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'typescript.isManagedFile', + }, + { + command: 'typescript.restartTsServer', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'typescript.isManagedFile', + }, + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'tsSupportsFileReferences && typescript.isManagedFile', + }, + { + command: 'typescript.goToSourceDefinition', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'tsSupportsSourceDefinition && typescript.isManagedFile', + }, + { + command: 'typescript.sortImports', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'supportedCodeAction =~ /(\\s|^)source\\.sortImports\\b/ && editorLangId =~ /^typescript(react)?$/', + }, + { + command: 'javascript.sortImports', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'supportedCodeAction =~ /(\\s|^)source\\.sortImports\\b/ && editorLangId =~ /^javascript(react)?$/', + }, + { + command: 'typescript.removeUnusedImports', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'supportedCodeAction =~ /(\\s|^)source\\.removeUnusedImports\\b/ && editorLangId =~ /^typescript(react)?$/', + }, + { + command: 'javascript.removeUnusedImports', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'supportedCodeAction =~ /(\\s|^)source\\.removeUnusedImports\\b/ && editorLangId =~ /^javascript(react)?$/', + }, + ], + 'editor/context': [ + { + command: 'typescript.goToSourceDefinition', + submenu: undefined, + alt: undefined, + group: 'navigation@9', + when: 'tsSupportsSourceDefinition && resourceLangId == typescript', + }, + { + command: 'typescript.goToSourceDefinition', + submenu: undefined, + alt: undefined, + group: 'navigation@9', + when: 'tsSupportsSourceDefinition && resourceLangId == typescriptreact', + }, + { + command: 'typescript.goToSourceDefinition', + submenu: undefined, + alt: undefined, + group: 'navigation@9', + when: 'tsSupportsSourceDefinition && resourceLangId == javascript', + }, + { + command: 'typescript.goToSourceDefinition', + submenu: undefined, + alt: undefined, + group: 'navigation@9', + when: 'tsSupportsSourceDefinition && resourceLangId == javascriptreact', + }, + ], + 'explorer/context': [ + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: '4_search', + when: 'tsSupportsFileReferences && resourceLangId == typescript', + }, + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: '4_search', + when: 'tsSupportsFileReferences && resourceLangId == typescriptreact', + }, + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: '4_search', + when: 'tsSupportsFileReferences && resourceLangId == javascript', + }, + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: '4_search', + when: 'tsSupportsFileReferences && resourceLangId == javascriptreact', + }, + ], + 'editor/title/context': [ + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'tsSupportsFileReferences && resourceLangId == javascript', + }, + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'tsSupportsFileReferences && resourceLangId == javascriptreact', + }, + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'tsSupportsFileReferences && resourceLangId == typescript', + }, + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'tsSupportsFileReferences && resourceLangId == typescriptreact', + }, + ], + }, + taskDefinitions: [ + { + taskType: 'typescript', + source: 'typescript-language-features', + properties: { + required: [ + 'tsconfig', + ], + all: [ + 'tsconfig', + 'option', + ], + schema: { + type: 'object', + required: [ + 'tsconfig', + ], + properties: { + tsconfig: { + type: 'string', + description: 'The tsconfig file that defines the TS build.', + }, + option: { + type: 'string', + }, + type: { + type: 'string', + const: 'typescript', + }, + }, + when: 'shellExecutionSupported', + }, + }, + }, + ], + problemMatchers: [ + { + name: 'tsc', + label: 'TypeScript problems', + owner: 'typescript', + source: 'ts', + applyTo: 'closedDocuments', + fileLocation: [ + 'relative', + '${cwd}', + ], + pattern: '$tsc', + }, + { + name: 'tsc-watch', + label: 'TypeScript problems (watch mode)', + owner: 'typescript', + source: 'ts', + applyTo: 'closedDocuments', + fileLocation: [ + 'relative', + '${cwd}', + ], + pattern: '$tsc', + background: { + activeOnStart: true, + beginsPattern: { + regexp: '^\\s*(?:message TS6032:|\\[?\\D*.{1,2}[:.].{1,2}[:.].{1,2}\\D*(├\\D*\\d{1,2}\\D+┤)?(?:\\]| -)) (Starting compilation in watch mode|File change detected\\. Starting incremental compilation)\\.\\.\\.', + }, + endsPattern: { + regexp: '^\\s*(?:message TS6042:|\\[?\\D*.{1,2}[:.].{1,2}[:.].{1,2}\\D*(├\\D*\\d{1,2}\\D+┤)?(?:\\]| -)) (?:Compilation complete\\.|Found \\d+ errors?\\.) Watching for file changes\\.', + }, + }, + }, + ], + problemPatterns: [ + { + name: 'tsc', + regexp: '^([^\\s].*)[\\(:](\\d+)[,:](\\d+)(?:\\):\\s+|\\s+-\\s+)(error|warning|info)\\s+TS(\\d+)\\s*:\\s*(.*)$', + file: 1, + line: 2, + column: 3, + severity: 4, + code: 5, + message: 6, + }, + ], + resourceLabelFormatters: undefined, + authentication: undefined, + notebooks: undefined, + snippets: undefined, + themes: undefined, + iconThemes: undefined, + colors: undefined, + localizations: undefined, + terminalProfiles: undefined, }, - 'type': 0, - 'contributes': { - 'activationEvents': [ - '*' - ] - } }, { metadata: { host: 'main', - 'model': { - 'packagePath': '/Users/robertjandow/Documents/Development/theia/plugins/vscode.simple-browser/extension', // Deprecated - 'packageUri': 'file:///Users/robertjandow/Documents/Development/theia/plugins/vscode.simple-browser/extension', - 'id': 'vscode.simple-browser', - 'name': 'simple-browser', - 'publisher': 'vscode', - 'version': '1.88.1', - 'displayName': 'vscode.simple-browser', - 'description': '', - 'engine': { - 'type': 'vscode', - 'version': '^1.70.0' - }, - 'entryPoint': { - 'frontend': 'dist/browser/extension.js' - } + model: { + packagePath: '/home/user/theia/examples/browser-only/plugins/vscode.typescript/extension', + packageUri: 'file:///home/user/theia/examples/browser-only/plugins/vscode.typescript/extension', + id: 'vscode.typescript', + name: 'typescript', + publisher: 'vscode', + version: '1.95.3', + displayName: 'TypeScript Language Basics (built-in)', + description: 'Provides snippets, syntax highlighting, bracket matching and folding in TypeScript files.', + engine: { + type: 'vscode', + version: '*', + }, + entryPoint: { + backend: undefined, + }, + iconUrl: undefined, + l10n: undefined, + readmeUrl: 'hostedPlugin/vscode_typescript/.%2FREADME.md', + licenseUrl: 'hostedPlugin/vscode_typescript/.%2FLICENSE', }, - 'lifecycle': { - 'startMethod': 'activate', - 'stopMethod': 'deactivate', - 'frontendModuleName': 'vscode_simple_browser', - 'frontendInitPath': 'plugin-vscode-init-fe.js', - 'backendInitPath': '/Users/robertjandow/Documents/Development/theia/examples/browser/lib/backend/plugin-vscode-init' + lifecycle: { + startMethod: 'activate', + stopMethod: 'deactivate', + frontendModuleName: 'vscode_typescript', + frontendInitPath: 'plugin-vscode-init-fe.js', + backendInitPath: '/home/user/theia/examples/browser/lib/backend/plugin-vscode-init', }, - 'outOfSync': false, - 'isUnderDevelopment': false + outOfSync: false, + isUnderDevelopment: false, }, - 'type': 0, - "contributes": { - "activationEvents": [ - "onCommand:simpleBrowser.api.open", - "onOpenExternalUri:http", - "onOpenExternalUri:https", - "onWebviewPanel:simpleBrowser.view" + type: 0, + contributes: { + activationEvents: [ + 'onLanguage:typescript', + 'onLanguage:typescriptreact', + 'onLanguage:jsonc', + 'onLanguage:json', + ], + configurationDefaults: undefined, + languages: [ + { + id: 'typescript', + aliases: [ + 'TypeScript', + 'ts', + 'typescript', + ], + extensions: [ + '.ts', + '.cts', + '.mts', + ], + filenamePatterns: undefined, + filenames: undefined, + firstLine: undefined, + mimetypes: undefined, + configuration: { + brackets: [ + [ + '${', + '}', + ], + [ + '{', + '}', + ], + [ + '[', + ']', + ], + [ + '(', + ')', + ], + ], + comments: { + lineComment: '//', + blockComment: [ + '/*', + '*/', + ], + }, + folding: { + markers: { + start: '^\\s*//\\s*#?region\\b', + end: '^\\s*//\\s*#?endregion\\b', + }, + }, + wordPattern: { + pattern: "(-?\\d*\\.\\d\\w*)|([^\\`\\@\\~\\!\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>/\\?\\s]+)", + }, + autoClosingPairs: [ + { + open: '{', + close: '}', + notIn: undefined, + }, + { + open: '[', + close: ']', + notIn: undefined, + }, + { + open: '(', + close: ')', + notIn: undefined, + }, + { + open: "'", + close: "'", + notIn: [ + 'string', + 'comment', + ], + }, + { + open: '"', + close: '"', + notIn: [ + 'string', + ], + }, + { + open: '`', + close: '`', + notIn: [ + 'string', + 'comment', + ], + }, + { + open: '/**', + close: ' */', + notIn: [ + 'string', + ], + }, + ], + indentationRules: { + decreaseIndentPattern: { + pattern: '^((?!.*?/\\*).*\\*/)?\\s*[\\}\\]].*$', + }, + increaseIndentPattern: { + pattern: "^((?!//).)*(\\{([^}\"'`/]*|(\\t|[ ])*//.*)|\\([^)\"'`/]*|\\[[^\\]\"'`/]*)$", + }, + unIndentedLinePattern: { + pattern: '^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$', + }, + }, + surroundingPairs: [ + { + open: '{', + close: '}', + }, + { + open: '[', + close: ']', + }, + { + open: '(', + close: ')', + }, + { + open: "'", + close: "'", + }, + { + open: '"', + close: '"', + }, + { + open: '`', + close: '`', + }, + { + open: '<', + close: '>', + }, + ], + onEnterRules: [ + { + beforeText: { + pattern: '^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$', + }, + afterText: { + pattern: '^\\s*\\*/$', + }, + action: { + indent: 'indentOutdent', + appendText: ' * ', + }, + }, + { + beforeText: { + pattern: '^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$', + }, + action: { + indent: 'none', + appendText: ' * ', + }, + }, + { + beforeText: { + pattern: '^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$', + }, + previousLineText: { + pattern: '(?=^(\\s*(/\\*\\*|\\*)).*)(?=(?!(\\s*\\*/)))', + }, + action: { + indent: 'none', + appendText: '* ', + }, + }, + { + beforeText: { + pattern: '^(\\t|[ ])*[ ]\\*/\\s*$', + }, + action: { + indent: 'none', + removeText: 1, + }, + }, + { + beforeText: { + pattern: '^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$', + }, + action: { + indent: 'none', + removeText: 1, + }, + }, + { + beforeText: { + pattern: '^\\s*(\\bcase\\s.+:|\\bdefault:)$', + }, + afterText: { + pattern: '^(?!\\s*(\\bcase\\b|\\bdefault\\b))', + }, + action: { + indent: 'indent', + }, + }, + ], + }, + }, + { + id: 'typescriptreact', + aliases: [ + 'TypeScript JSX', + 'TypeScript React', + 'tsx', + ], + extensions: [ + '.tsx', + ], + filenamePatterns: undefined, + filenames: undefined, + firstLine: undefined, + mimetypes: undefined, + configuration: { + brackets: [ + [ + '${', + '}', + ], + [ + '{', + '}', + ], + [ + '[', + ']', + ], + [ + '(', + ')', + ], + ], + comments: { + lineComment: '//', + blockComment: [ + '/*', + '*/', + ], + }, + folding: { + markers: { + start: '^\\s*//\\s*#?region\\b', + end: '^\\s*//\\s*#?endregion\\b', + }, + }, + wordPattern: { + pattern: "(-?\\d*\\.\\d\\w*)|([^\\`\\@\\~\\!\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>/\\?\\s]+)", + }, + autoClosingPairs: [ + { + open: '{', + close: '}', + notIn: undefined, + }, + { + open: '[', + close: ']', + notIn: undefined, + }, + { + open: '(', + close: ')', + notIn: undefined, + }, + { + open: "'", + close: "'", + notIn: [ + 'string', + 'comment', + ], + }, + { + open: '"', + close: '"', + notIn: [ + 'string', + ], + }, + { + open: '`', + close: '`', + notIn: [ + 'string', + 'comment', + ], + }, + { + open: '/**', + close: ' */', + notIn: [ + 'string', + ], + }, + ], + indentationRules: { + decreaseIndentPattern: { + pattern: '^((?!.*?/\\*).*\\*/)?\\s*[\\}\\]].*$', + }, + increaseIndentPattern: { + pattern: "^((?!//).)*(\\{([^}\"'`/]*|(\\t|[ ])*//.*)|\\([^)\"'`/]*|\\[[^\\]\"'`/]*)$", + }, + unIndentedLinePattern: { + pattern: '^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$', + }, + }, + surroundingPairs: [ + { + open: '{', + close: '}', + }, + { + open: '[', + close: ']', + }, + { + open: '(', + close: ')', + }, + { + open: "'", + close: "'", + }, + { + open: '"', + close: '"', + }, + { + open: '`', + close: '`', + }, + { + open: '<', + close: '>', + }, + ], + onEnterRules: [ + { + beforeText: { + pattern: '^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$', + }, + afterText: { + pattern: '^\\s*\\*/$', + }, + action: { + indent: 'indentOutdent', + appendText: ' * ', + }, + }, + { + beforeText: { + pattern: '^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$', + }, + action: { + indent: 'none', + appendText: ' * ', + }, + }, + { + beforeText: { + pattern: '^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$', + }, + previousLineText: { + pattern: '(?=^(\\s*(/\\*\\*|\\*)).*)(?=(?!(\\s*\\*/)))', + }, + action: { + indent: 'none', + appendText: '* ', + }, + }, + { + beforeText: { + pattern: '^(\\t|[ ])*[ ]\\*/\\s*$', + }, + action: { + indent: 'none', + removeText: 1, + }, + }, + { + beforeText: { + pattern: '^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$', + }, + action: { + indent: 'none', + removeText: 1, + }, + }, + { + beforeText: { + pattern: '^\\s*(\\bcase\\s.+:|\\bdefault:)$', + }, + afterText: { + pattern: '^(?!\\s*(\\bcase\\b|\\bdefault\\b))', + }, + action: { + indent: 'indent', + }, + }, + ], + }, + }, + { + id: 'jsonc', + aliases: undefined, + extensions: undefined, + filenamePatterns: [ + 'tsconfig.*.json', + 'jsconfig.*.json', + 'tsconfig-*.json', + 'jsconfig-*.json', + ], + filenames: [ + 'tsconfig.json', + 'jsconfig.json', + ], + firstLine: undefined, + mimetypes: undefined, + }, + { + id: 'json', + aliases: undefined, + extensions: undefined, + filenamePatterns: undefined, + filenames: [ + 'tsconfig.tsbuildinfo', + ], + firstLine: undefined, + mimetypes: undefined, + }, ], - "commands": [ + grammars: [ + { + language: 'typescript', + scope: 'source.ts', + format: 'json', + grammar: { + information_for_contributors: [ + 'This file has been converted from https://github.com/microsoft/TypeScript-TmLanguage/blob/master/TypeScript.tmLanguage', + 'If you want to provide a fix or improvement, please create a pull request against the original repository.', + 'Once accepted there, we are happy to receive an update request.', + ], + version: 'https://github.com/microsoft/TypeScript-TmLanguage/commit/0d73d1117e0a9b1d6635ebbe9aa37d615171b02d', + name: 'TypeScript', + scopeName: 'source.ts', + patterns: [ + { + include: '#directives', + }, + { + include: '#statements', + }, + { + include: '#shebang', + }, + ], + repository: { + shebang: { + name: 'comment.line.shebang.ts', + match: '\\A(#!).*(?=$)', + captures: { + '1': { + name: 'punctuation.definition.comment.ts', + }, + }, + }, + statements: { + patterns: [ + { + include: '#declaration', + }, + { + include: '#control-statement', + }, + { + include: '#after-operator-block-as-object-literal', + }, + { + include: '#decl-block', + }, + { + include: '#label', + }, + { + include: '#expression', + }, + { + include: '#punctuation-semicolon', + }, + { + include: '#string', + }, + { + include: '#comment', + }, + ], + }, + declaration: { + patterns: [ + { + include: '#decorator', + }, + { + include: '#var-expr', + }, + { + include: '#function-declaration', + }, + { + include: '#class-declaration', + }, + { + include: '#interface-declaration', + }, + { + include: '#enum-declaration', + }, + { + include: '#namespace-declaration', + }, + { + include: '#type-alias-declaration', + }, + { + include: '#import-equals-declaration', + }, + { + include: '#import-declaration', + }, + { + include: '#export-declaration', + }, + { + name: 'storage.modifier.ts', + match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + beginCaptures: { + '1': { + name: 'meta.definition.variable.ts entity.name.function.ts', + }, + '2': { + name: 'keyword.operator.definiteassignment.ts', + }, + }, + end: '(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + beginCaptures: { + '1': { + name: 'meta.definition.variable.ts variable.other.constant.ts entity.name.function.ts', + }, + }, + end: '(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '1': { + name: 'storage.modifier.ts', + }, + '2': { + name: 'keyword.operator.rest.ts', + }, + '3': { + name: 'entity.name.function.ts variable.language.this.ts', + }, + '4': { + name: 'entity.name.function.ts', + }, + '5': { + name: 'keyword.operator.optional.ts', + }, + }, + }, + { + match: '(?x)(?:(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '1': { + name: 'meta.definition.property.ts entity.name.function.ts', + }, + '2': { + name: 'keyword.operator.optional.ts', + }, + '3': { + name: 'keyword.operator.definiteassignment.ts', + }, + }, + }, + { + name: 'meta.definition.property.ts variable.object.property.ts', + match: '\\#?[_$[:alpha:]][_$[:alnum:]]*', + }, + { + name: 'keyword.operator.optional.ts', + match: '\\?', + }, + { + name: 'keyword.operator.definiteassignment.ts', + match: '\\!', + }, + ], + }, + 'variable-initializer': { + patterns: [ + { + begin: '(?\\s*$)', + beginCaptures: { + '1': { + name: 'keyword.operator.assignment.ts', + }, + }, + end: '(?=$|^|[,);}\\]]|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])', + beginCaptures: { + '1': { + name: 'storage.modifier.ts', + }, + '2': { + name: 'storage.modifier.ts', + }, + '3': { + name: 'storage.modifier.ts', + }, + '4': { + name: 'storage.modifier.async.ts', + }, + '5': { + name: 'keyword.operator.new.ts', + }, + '6': { + name: 'keyword.generator.asterisk.ts', + }, + }, + end: '(?=\\}|;|,|$)|(?<=\\})', + patterns: [ + { + include: '#method-declaration-name', + }, + { + include: '#function-body', + }, + ], + }, + { + name: 'meta.method.declaration.ts', + begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + beginCaptures: { + '1': { + name: 'storage.modifier.ts', + }, + '2': { + name: 'storage.modifier.ts', + }, + '3': { + name: 'storage.modifier.ts', + }, + '4': { + name: 'storage.modifier.async.ts', + }, + '5': { + name: 'storage.type.property.ts', + }, + '6': { + name: 'keyword.generator.asterisk.ts', + }, + }, + end: '(?=\\}|;|,|$)|(?<=\\})', + patterns: [ + { + include: '#method-declaration-name', + }, + { + include: '#function-body', + }, + ], + }, + ], + }, + 'object-literal-method-declaration': { + name: 'meta.method.declaration.ts', + begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + '2': { + name: 'storage.type.property.ts', + }, + '3': { + name: 'keyword.generator.asterisk.ts', + }, + }, + end: '(?=\\}|;|,)|(?<=\\})', + patterns: [ + { + include: '#method-declaration-name', + }, + { + include: '#function-body', + }, + { + begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + '2': { + name: 'storage.type.property.ts', + }, + '3': { + name: 'keyword.generator.asterisk.ts', + }, + }, + end: '(?=\\(|\\<)', + patterns: [ + { + include: '#method-declaration-name', + }, + ], + }, + ], + }, + 'method-declaration-name': { + begin: "(?x)(?=((\\b(?)', + captures: { + '1': { + name: 'storage.modifier.async.ts', + }, + '2': { + name: 'variable.parameter.ts', + }, + }, + }, + { + name: 'meta.arrow.ts', + begin: "(?x) (?:\n (? is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n )\n)", + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + }, + end: '(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', + patterns: [ + { + include: '#comment', + }, + { + include: '#type-parameters', + }, + { + include: '#function-parameters', + }, + { + include: '#arrow-return-type', + }, + { + include: '#possibly-arrow-return-type', + }, + ], + }, + { + name: 'meta.arrow.ts', + begin: '=>', + beginCaptures: { + '0': { + name: 'storage.type.function.arrow.ts', + }, + }, + end: '((?<=\\}|\\S)(?)|((?!\\{)(?=\\S)))(?!\\/[\\/\\*])', + patterns: [ + { + include: '#single-line-comment-consuming-line-ending', + }, + { + include: '#decl-block', + }, + { + include: '#expression', + }, + ], + }, + ], + }, + 'indexer-declaration': { + name: 'meta.indexer.declaration.ts', + begin: '(?:(?]|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^yield|[^\\._$[:alnum:]]yield|^throw|[^\\._$[:alnum:]]throw|^in|[^\\._$[:alnum:]]in|^of|[^\\._$[:alnum:]]of|^typeof|[^\\._$[:alnum:]]typeof|&&|\\|\\||\\*)\\s*(\\{)', + beginCaptures: { + '1': { + name: 'punctuation.definition.block.ts', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.block.ts', + }, + }, + patterns: [ + { + include: '#object-member', + }, + ], + }, + 'object-literal': { + name: 'meta.objectliteral.ts', + begin: '\\{', + beginCaptures: { + '0': { + name: 'punctuation.definition.block.ts', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.block.ts', + }, + }, + patterns: [ + { + include: '#object-member', + }, + ], + }, + 'object-member': { + patterns: [ + { + include: '#comment', + }, + { + include: '#object-literal-method-declaration', + }, + { + name: 'meta.object.member.ts meta.object-literal.key.ts', + begin: '(?=\\[)', + end: '(?=:)|((?<=[\\]])(?=\\s*[\\(\\<]))', + patterns: [ + { + include: '#comment', + }, + { + include: '#array-literal', + }, + ], + }, + { + name: 'meta.object.member.ts meta.object-literal.key.ts', + begin: "(?=[\\'\\\"\\`])", + end: "(?=:)|((?<=[\\'\\\"\\`])(?=((\\s*[\\(\\<,}])|(\\s+(as|satisifies)\\s+))))", + patterns: [ + { + include: '#comment', + }, + { + include: '#string', + }, + ], + }, + { + name: 'meta.object.member.ts meta.object-literal.key.ts', + begin: '(?x)(?=(\\b(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '0': { + name: 'meta.object-literal.key.ts', + }, + '1': { + name: 'entity.name.function.ts', + }, + }, + }, + { + name: 'meta.object.member.ts', + match: '(?:[_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:)', + captures: { + '0': { + name: 'meta.object-literal.key.ts', + }, + }, + }, + { + name: 'meta.object.member.ts', + begin: '\\.\\.\\.', + beginCaptures: { + '0': { + name: 'keyword.operator.spread.ts', + }, + }, + end: '(?=,|\\})', + patterns: [ + { + include: '#expression', + }, + ], + }, + { + name: 'meta.object.member.ts', + match: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=,|\\}|$|\\/\\/|\\/\\*)', + captures: { + '1': { + name: 'variable.other.readwrite.ts', + }, + }, + }, + { + name: 'meta.object.member.ts', + match: '(?]|\\|\\||\\&\\&|\\!\\=\\=|$|^|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + }, + end: '(?<=\\))', + patterns: [ + { + include: '#type-parameters', + }, + { + begin: '\\(', + beginCaptures: { + '0': { + name: 'meta.brace.round.ts', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.ts', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + ], + }, + { + begin: '(?<=:)\\s*(async)?\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + '2': { + name: 'meta.brace.round.ts', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.ts', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + { + begin: '(?<=:)\\s*(async)?\\s*(?=\\<\\s*$)', + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + }, + end: '(?<=\\>)', + patterns: [ + { + include: '#type-parameters', + }, + ], + }, + { + begin: '(?<=\\>)\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'meta.brace.round.ts', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.ts', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + { + include: '#possibly-arrow-return-type', + }, + { + include: '#expression', + }, + ], + }, + { + include: '#punctuation-comma', + }, + { + include: '#decl-block', + }, + ], + }, + 'ternary-expression': { + begin: '(?!\\?\\.\\s*[^[:digit:]])(\\?)(?!\\?)', + beginCaptures: { + '1': { + name: 'keyword.operator.ternary.ts', + }, + }, + end: '\\s*(:)', + endCaptures: { + '1': { + name: 'keyword.operator.ternary.ts', + }, + }, + patterns: [ + { + include: '#expression', + }, + ], + }, + 'function-call': { + patterns: [ + { + begin: "(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", + end: "(?<=\\))(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", + patterns: [ + { + name: 'meta.function-call.ts', + begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))', + end: "(?=\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", + patterns: [ + { + include: '#function-call-target', + }, + ], + }, + { + include: '#comment', + }, + { + include: '#function-call-optionals', + }, + { + include: '#type-arguments', + }, + { + include: '#paren-expression', + }, + ], + }, + { + begin: '(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))(<\\s*[\\{\\[\\(]\\s*$))', + end: '(?<=\\>)(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))(<\\s*[\\{\\[\\(]\\s*$))', + patterns: [ + { + name: 'meta.function-call.ts', + begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))', + end: '(?=(<\\s*[\\{\\[\\(]\\s*$))', + patterns: [ + { + include: '#function-call-target', + }, + ], + }, + { + include: '#comment', + }, + { + include: '#function-call-optionals', + }, + { + include: '#type-arguments', + }, + ], + }, + ], + }, + 'function-call-target': { + patterns: [ + { + include: '#support-function-call-identifiers', + }, + { + name: 'entity.name.function.ts', + match: '(\\#?[_$[:alpha:]][_$[:alnum:]]*)', + }, + ], + }, + 'function-call-optionals': { + patterns: [ + { + name: 'meta.function-call.ts punctuation.accessor.optional.ts', + match: '\\?\\.', + }, + { + name: 'meta.function-call.ts keyword.operator.definiteassignment.ts', + match: '\\!', + }, + ], + }, + 'support-function-call-identifiers': { + patterns: [ + { + include: '#literal', + }, + { + include: '#support-objects', + }, + { + include: '#object-identifiers', + }, + { + include: '#punctuation-accessor', + }, + { + name: 'keyword.operator.expression.import.ts', + match: "(?:(?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|(===|!==|==|!=)|(([\\&\\~\\^\\|]\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s+instanceof(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + }, + end: '(?<=\\))', + patterns: [ + { + include: '#paren-expression-possibly-arrow-with-typeparameters', + }, + ], + }, + { + begin: '(?<=[(=,]|=>|^return|[^\\._$[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\()|(<)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)))\\s*$)', + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + }, + end: '(?<=\\))', + patterns: [ + { + include: '#paren-expression-possibly-arrow-with-typeparameters', + }, + ], + }, + { + include: '#possibly-arrow-return-type', + }, + ], + }, + 'paren-expression-possibly-arrow-with-typeparameters': { + patterns: [ + { + include: '#type-parameters', + }, + { + begin: '\\(', + beginCaptures: { + '0': { + name: 'meta.brace.round.ts', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.ts', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + ], + }, + 'expression-inside-possibly-arrow-parens': { + patterns: [ + { + include: '#expressionWithoutIdentifiers', + }, + { + include: '#comment', + }, + { + include: '#string', + }, + { + include: '#decorator', + }, + { + include: '#destructuring-parameter', + }, + { + match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '1': { + name: 'storage.modifier.ts', + }, + '2': { + name: 'keyword.operator.rest.ts', + }, + '3': { + name: 'entity.name.function.ts variable.language.this.ts', + }, + '4': { + name: 'entity.name.function.ts', + }, + '5': { + name: 'keyword.operator.optional.ts', + }, + }, + }, + { + match: '(?x)(?:(?)', + captures: { + '1': { + name: 'meta.brace.angle.ts', + }, + '2': { + name: 'storage.modifier.ts', + }, + '3': { + name: 'meta.brace.angle.ts', + }, + }, + }, + { + name: 'cast.expr.ts', + begin: '(?:(?*?\\&\\|\\^]|[^_$[:alnum:]](?:\\+\\+|\\-\\-)|[^\\+]\\+|[^\\-]\\-))\\s*(<)(?!)', + endCaptures: { + '1': { + name: 'meta.brace.angle.ts', + }, + }, + patterns: [ + { + include: '#type', + }, + ], + }, + { + name: 'cast.expr.ts', + begin: '(?:(?<=^))\\s*(<)(?=[_$[:alpha:]][_$[:alnum:]]*\\s*>)', + beginCaptures: { + '1': { + name: 'meta.brace.angle.ts', + }, + }, + end: '(\\>)', + endCaptures: { + '1': { + name: 'meta.brace.angle.ts', + }, + }, + patterns: [ + { + include: '#type', + }, + ], + }, + ], + }, + 'expression-operators': { + patterns: [ + { + name: 'keyword.control.flow.ts', + match: '(?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?>=|>>>=|\\|=', + }, + { + name: 'keyword.operator.bitwise.shift.ts', + match: '<<|>>>|>>', + }, + { + name: 'keyword.operator.comparison.ts', + match: '===|!==|==|!=', + }, + { + name: 'keyword.operator.relational.ts', + match: '<=|>=|<>|<|>', + }, + { + match: '(?<=[_$[:alnum:]])(\\!)\\s*(?:(/=)|(?:(/)(?![/*])))', + captures: { + '1': { + name: 'keyword.operator.logical.ts', + }, + '2': { + name: 'keyword.operator.assignment.compound.ts', + }, + '3': { + name: 'keyword.operator.arithmetic.ts', + }, + }, + }, + { + name: 'keyword.operator.logical.ts', + match: '\\!|&&|\\|\\||\\?\\?', + }, + { + name: 'keyword.operator.bitwise.ts', + match: '\\&|~|\\^|\\|', + }, + { + name: 'keyword.operator.assignment.ts', + match: '\\=', + }, + { + name: 'keyword.operator.decrement.ts', + match: '--', + }, + { + name: 'keyword.operator.increment.ts', + match: '\\+\\+', + }, + { + name: 'keyword.operator.arithmetic.ts', + match: '%|\\*|/|-|\\+', + }, + { + begin: '(?<=[_$[:alnum:])\\]])\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)+(?:(/=)|(?:(/)(?![/*]))))', + end: '(?:(/=)|(?:(/)(?!\\*([^\\*]|(\\*[^\\/]))*\\*\\/)))', + endCaptures: { + '1': { + name: 'keyword.operator.assignment.compound.ts', + }, + '2': { + name: 'keyword.operator.arithmetic.ts', + }, + }, + patterns: [ + { + include: '#comment', + }, + ], + }, + { + match: '(?<=[_$[:alnum:])\\]])\\s*(?:(/=)|(?:(/)(?![/*])))', + captures: { + '1': { + name: 'keyword.operator.assignment.compound.ts', + }, + '2': { + name: 'keyword.operator.arithmetic.ts', + }, + }, + }, + ], + }, + 'typeof-operator': { + begin: '(?:&|{\\?]|(extends\\s+)|$|;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))', + patterns: [ + { + include: '#type-arguments', + }, + { + include: '#expression', + }, + ], + }, + literal: { + patterns: [ + { + include: '#numeric-literal', + }, + { + include: '#boolean-literal', + }, + { + include: '#null-literal', + }, + { + include: '#undefined-literal', + }, + { + include: '#numericConstant-literal', + }, + { + include: '#array-literal', + }, + { + include: '#this-literal', + }, + { + include: '#super-literal', + }, + ], + }, + 'array-literal': { + name: 'meta.array.literal.ts', + begin: '\\s*(\\[)', + beginCaptures: { + '1': { + name: 'meta.brace.square.ts', + }, + }, + end: '\\]', + endCaptures: { + '0': { + name: 'meta.brace.square.ts', + }, + }, + patterns: [ + { + include: '#expression', + }, + { + include: '#punctuation-comma', + }, + ], + }, + 'numeric-literal': { + patterns: [ + { + name: 'constant.numeric.hex.ts', + match: '\\b(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\\())\n |\n (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$)))', + captures: { + '1': { + name: 'punctuation.accessor.ts', + }, + '2': { + name: 'punctuation.accessor.optional.ts', + }, + '3': { + name: 'support.variable.property.ts', + }, + '4': { + name: 'support.constant.ts', + }, + }, + }, + { + match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n))", + captures: { + '1': { + name: 'punctuation.accessor.ts', + }, + '2': { + name: 'punctuation.accessor.optional.ts', + }, + '3': { + name: 'entity.name.function.ts', + }, + }, + }, + { + match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])', + captures: { + '1': { + name: 'punctuation.accessor.ts', + }, + '2': { + name: 'punctuation.accessor.optional.ts', + }, + '3': { + name: 'variable.other.constant.property.ts', + }, + }, + }, + { + match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*)', + captures: { + '1': { + name: 'punctuation.accessor.ts', + }, + '2': { + name: 'punctuation.accessor.optional.ts', + }, + '3': { + name: 'variable.other.property.ts', + }, + }, + }, + { + name: 'variable.other.constant.ts', + match: '([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])', + }, + { + name: 'variable.other.readwrite.ts', + match: '[_$[:alpha:]][_$[:alnum:]]*', + }, + ], + }, + 'object-identifiers': { + patterns: [ + { + name: 'support.class.ts', + match: '([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\??\\.\\s*prototype\\b(?!\\$))', + }, + { + match: '(?x)(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n (\\#?[[:upper:]][_$[:digit:][:upper:]]*) |\n (\\#?[_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)', + captures: { + '1': { + name: 'punctuation.accessor.ts', + }, + '2': { + name: 'punctuation.accessor.optional.ts', + }, + '3': { + name: 'variable.other.constant.object.property.ts', + }, + '4': { + name: 'variable.other.object.property.ts', + }, + }, + }, + { + match: '(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)', + captures: { + '1': { + name: 'variable.other.constant.object.ts', + }, + '2': { + name: 'variable.other.object.ts', + }, + }, + }, + ], + }, + 'type-annotation': { + patterns: [ + { + name: 'meta.type.annotation.ts', + begin: '(:)(?=\\s*\\S)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.ts', + }, + }, + end: '(?])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))', + patterns: [ + { + include: '#type', + }, + ], + }, + { + name: 'meta.type.annotation.ts', + begin: '(:)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.ts', + }, + }, + end: '(?])|(?=^\\s*$)|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))', + patterns: [ + { + include: '#type', + }, + ], + }, + ], + }, + 'parameter-type-annotation': { + patterns: [ + { + name: 'meta.type.annotation.ts', + begin: '(:)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.ts', + }, + }, + end: '(?=[,)])|(?==[^>])', + patterns: [ + { + include: '#type', + }, + ], + }, + ], + }, + 'return-type': { + patterns: [ + { + name: 'meta.return.type.ts', + begin: '(?<=\\))\\s*(:)(?=\\s*\\S)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.ts', + }, + }, + end: '(?|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', + patterns: [ + { + include: '#arrow-return-type-body', + }, + ], + }, + 'possibly-arrow-return-type': { + begin: '(?<=\\)|^)\\s*(:)(?=\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*=>)', + beginCaptures: { + '1': { + name: 'meta.arrow.ts meta.return.type.arrow.ts keyword.operator.type.annotation.ts', + }, + }, + end: '(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', + contentName: 'meta.arrow.ts meta.return.type.arrow.ts', + patterns: [ + { + include: '#arrow-return-type-body', + }, + ], + }, + 'arrow-return-type-body': { + patterns: [ + { + begin: '(?<=[:])(?=\\s*\\{)', + end: '(?<=\\})', + patterns: [ + { + include: '#type-object', + }, + ], + }, + { + include: '#type-predicate-operator', + }, + { + include: '#type', + }, + ], + }, + 'type-parameters': { + name: 'meta.type.parameters.ts', + begin: '(<)', + beginCaptures: { + '1': { + name: 'punctuation.definition.typeparameters.begin.ts', + }, + }, + end: '(>)', + endCaptures: { + '1': { + name: 'punctuation.definition.typeparameters.end.ts', + }, + }, + patterns: [ + { + include: '#comment', + }, + { + name: 'storage.modifier.ts', + match: '(?)', + }, + ], + }, + 'type-arguments': { + name: 'meta.type.parameters.ts', + begin: '\\<', + beginCaptures: { + '0': { + name: 'punctuation.definition.typeparameters.begin.ts', + }, + }, + end: '\\>', + endCaptures: { + '0': { + name: 'punctuation.definition.typeparameters.end.ts', + }, + }, + patterns: [ + { + include: '#type-arguments-body', + }, + ], + }, + 'type-arguments-body': { + patterns: [ + { + match: '(?)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))))', + captures: { + '1': { + name: 'storage.modifier.ts', + }, + '2': { + name: 'keyword.operator.rest.ts', + }, + '3': { + name: 'entity.name.function.ts variable.language.this.ts', + }, + '4': { + name: 'entity.name.function.ts', + }, + '5': { + name: 'keyword.operator.optional.ts', + }, + }, + }, + { + match: '(?x)(?:(?)', + patterns: [ + { + include: '#comment', + }, + { + include: '#type-parameters', + }, + ], + }, + { + name: 'meta.type.constructor.ts', + begin: '(?)\n ))\n )\n )\n)', + end: '(?<=\\))', + patterns: [ + { + include: '#function-parameters', + }, + ], + }, + ], + }, + 'type-function-return-type': { + patterns: [ + { + name: 'meta.type.function.return.ts', + begin: '(=>)(?=\\s*\\S)', + beginCaptures: { + '1': { + name: 'storage.type.function.arrow.ts', + }, + }, + end: '(?)(?:\\?]|//|$)', + patterns: [ + { + include: '#type-function-return-type-core', + }, + ], + }, + { + name: 'meta.type.function.return.ts', + begin: '=>', + beginCaptures: { + '0': { + name: 'storage.type.function.arrow.ts', + }, + }, + end: '(?)(?]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))', + patterns: [ + { + include: '#type-function-return-type-core', + }, + ], + }, + ], + }, + 'type-function-return-type-core': { + patterns: [ + { + include: '#comment', + }, + { + begin: '(?<==>)(?=\\s*\\{)', + end: '(?<=\\})', + patterns: [ + { + include: '#type-object', + }, + ], + }, + { + include: '#type-predicate-operator', + }, + { + include: '#type', + }, + ], + }, + 'type-operators': { + patterns: [ + { + include: '#typeof-operator', + }, + { + include: '#type-infer', + }, + { + begin: '([&|])(?=\\s*\\{)', + beginCaptures: { + '0': { + name: 'keyword.operator.type.ts', + }, + }, + end: '(?<=\\})', + patterns: [ + { + include: '#type-object', + }, + ], + }, + { + begin: '[&|]', + beginCaptures: { + '0': { + name: 'keyword.operator.type.ts', + }, + }, + end: '(?=\\S)', + }, + { + name: 'keyword.operator.expression.keyof.ts', + match: '(?)', + endCaptures: { + '1': { + name: 'meta.type.parameters.ts punctuation.definition.typeparameters.end.ts', + }, + }, + contentName: 'meta.type.parameters.ts', + patterns: [ + { + include: '#type-arguments-body', + }, + ], + }, + { + begin: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(<)', + beginCaptures: { + '1': { + name: 'entity.name.type.ts', + }, + '2': { + name: 'meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts', + }, + }, + end: '(>)', + endCaptures: { + '1': { + name: 'meta.type.parameters.ts punctuation.definition.typeparameters.end.ts', + }, + }, + contentName: 'meta.type.parameters.ts', + patterns: [ + { + include: '#type-arguments-body', + }, + ], + }, + { + match: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))', + captures: { + '1': { + name: 'entity.name.type.module.ts', + }, + '2': { + name: 'punctuation.accessor.ts', + }, + '3': { + name: 'punctuation.accessor.optional.ts', + }, + }, + }, + { + name: 'entity.name.type.ts', + match: '[_$[:alpha:]][_$[:alnum:]]*', + }, + ], + }, + 'punctuation-comma': { + name: 'punctuation.separator.comma.ts', + match: ',', + }, + 'punctuation-semicolon': { + name: 'punctuation.terminator.statement.ts', + match: ';', + }, + 'punctuation-accessor': { + match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))', + captures: { + '1': { + name: 'punctuation.accessor.ts', + }, + '2': { + name: 'punctuation.accessor.optional.ts', + }, + }, + }, + string: { + patterns: [ + { + include: '#qstring-single', + }, + { + include: '#qstring-double', + }, + { + include: '#template', + }, + ], + }, + 'qstring-double': { + name: 'string.quoted.double.ts', + begin: '"', + beginCaptures: { + '0': { + name: 'punctuation.definition.string.begin.ts', + }, + }, + end: '(")|((?:[^\\\\\\n])$)', + endCaptures: { + '1': { + name: 'punctuation.definition.string.end.ts', + }, + '2': { + name: 'invalid.illegal.newline.ts', + }, + }, + patterns: [ + { + include: '#string-character-escape', + }, + ], + }, + 'qstring-single': { + name: 'string.quoted.single.ts', + begin: "'", + beginCaptures: { + '0': { + name: 'punctuation.definition.string.begin.ts', + }, + }, + end: "(\\')|((?:[^\\\\\\n])$)", + endCaptures: { + '1': { + name: 'punctuation.definition.string.end.ts', + }, + '2': { + name: 'invalid.illegal.newline.ts', + }, + }, + patterns: [ + { + include: '#string-character-escape', + }, + ], + }, + 'string-character-escape': { + name: 'constant.character.escape.ts', + match: '\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\\{[0-9A-Fa-f]+\\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)', + }, + template: { + patterns: [ + { + include: '#template-call', + }, + { + contentName: 'string.template.ts', + begin: '([_$[:alpha:]][_$[:alnum:]]*)?(`)', + beginCaptures: { + '1': { + name: 'entity.name.function.tagged-template.ts', + }, + '2': { + name: 'string.template.ts punctuation.definition.string.template.begin.ts', + }, + }, + end: '`', + endCaptures: { + '0': { + name: 'string.template.ts punctuation.definition.string.template.end.ts', + }, + }, + patterns: [ + { + include: '#template-substitution-element', + }, + { + include: '#string-character-escape', + }, + ], + }, + ], + }, + 'template-call': { + patterns: [ + { + begin: "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)", + end: '(?=`)', + patterns: [ + { + begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))', + end: "(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)", + patterns: [ + { + include: '#support-function-call-identifiers', + }, + { + name: 'entity.name.function.tagged-template.ts', + match: '([_$[:alpha:]][_$[:alnum:]]*)', + }, + ], + }, + { + include: '#type-arguments', + }, + ], + }, + { + begin: "([_$[:alpha:]][_$[:alnum:]]*)?\\s*(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)`)", + beginCaptures: { + '1': { + name: 'entity.name.function.tagged-template.ts', + }, + }, + end: '(?=`)', + patterns: [ + { + include: '#type-arguments', + }, + ], + }, + ], + }, + 'template-substitution-element': { + name: 'meta.template.expression.ts', + begin: '\\$\\{', + beginCaptures: { + '0': { + name: 'punctuation.definition.template-expression.begin.ts', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.template-expression.end.ts', + }, + }, + patterns: [ + { + include: '#expression', + }, + ], + contentName: 'meta.embedded.line.ts', + }, + 'type-string': { + patterns: [ + { + include: '#qstring-single', + }, + { + include: '#qstring-double', + }, + { + include: '#template-type', + }, + ], + }, + 'template-type': { + patterns: [ + { + include: '#template-call', + }, + { + contentName: 'string.template.ts', + begin: '([_$[:alpha:]][_$[:alnum:]]*)?(`)', + beginCaptures: { + '1': { + name: 'entity.name.function.tagged-template.ts', + }, + '2': { + name: 'string.template.ts punctuation.definition.string.template.begin.ts', + }, + }, + end: '`', + endCaptures: { + '0': { + name: 'string.template.ts punctuation.definition.string.template.end.ts', + }, + }, + patterns: [ + { + include: '#template-type-substitution-element', + }, + { + include: '#string-character-escape', + }, + ], + }, + ], + }, + 'template-type-substitution-element': { + name: 'meta.template.expression.ts', + begin: '\\$\\{', + beginCaptures: { + '0': { + name: 'punctuation.definition.template-expression.begin.ts', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.template-expression.end.ts', + }, + }, + patterns: [ + { + include: '#type', + }, + ], + contentName: 'meta.embedded.line.ts', + }, + regex: { + patterns: [ + { + name: 'string.regexp.ts', + begin: '(?|&&|\\|\\||\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[\\()]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\]|\\(([^\\)\\\\]|\\\\.)+\\))+\\/([dgimsuy]+|(?![\\/\\*])|(?=\\/\\*))(?!\\s*[a-zA-Z0-9_$]))', + beginCaptures: { + '1': { + name: 'punctuation.definition.string.begin.ts', + }, + }, + end: '(/)([dgimsuy]*)', + endCaptures: { + '1': { + name: 'punctuation.definition.string.end.ts', + }, + '2': { + name: 'keyword.other.ts', + }, + }, + patterns: [ + { + include: '#regexp', + }, + ], + }, + { + name: 'string.regexp.ts', + begin: '((?', + captures: { + '0': { + name: 'keyword.other.back-reference.regexp', + }, + '1': { + name: 'variable.other.regexp', + }, + }, + }, + { + name: 'keyword.operator.quantifier.regexp', + match: '[?+*]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??', + }, + { + name: 'keyword.operator.or.regexp', + match: '\\|', + }, + { + name: 'meta.group.assertion.regexp', + begin: '(\\()((\\?=)|(\\?!)|(\\?<=)|(\\?))?', + beginCaptures: { + '0': { + name: 'punctuation.definition.group.regexp', + }, + '1': { + name: 'punctuation.definition.group.no-capture.regexp', + }, + '2': { + name: 'variable.other.regexp', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'punctuation.definition.group.regexp', + }, + }, + patterns: [ + { + include: '#regexp', + }, + ], + }, + { + name: 'constant.other.character-class.set.regexp', + begin: '(\\[)(\\^)?', + beginCaptures: { + '1': { + name: 'punctuation.definition.character-class.regexp', + }, + '2': { + name: 'keyword.operator.negation.regexp', + }, + }, + end: '(\\])', + endCaptures: { + '1': { + name: 'punctuation.definition.character-class.regexp', + }, + }, + patterns: [ + { + name: 'constant.other.character-class.range.regexp', + match: '(?:.|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))\\-(?:[^\\]\\\\]|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))', + captures: { + '1': { + name: 'constant.character.numeric.regexp', + }, + '2': { + name: 'constant.character.control.regexp', + }, + '3': { + name: 'constant.character.escape.backslash.regexp', + }, + '4': { + name: 'constant.character.numeric.regexp', + }, + '5': { + name: 'constant.character.control.regexp', + }, + '6': { + name: 'constant.character.escape.backslash.regexp', + }, + }, + }, + { + include: '#regex-character-class', + }, + ], + }, + { + include: '#regex-character-class', + }, + ], + }, + 'regex-character-class': { + patterns: [ + { + name: 'constant.other.character-class.regexp', + match: '\\\\[wWsSdDtrnvf]|\\.', + }, + { + name: 'constant.character.numeric.regexp', + match: '\\\\([0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4})', + }, + { + name: 'constant.character.control.regexp', + match: '\\\\c[A-Z]', + }, + { + name: 'constant.character.escape.backslash.regexp', + match: '\\\\.', + }, + ], + }, + comment: { + patterns: [ + { + name: 'comment.block.documentation.ts', + begin: '/\\*\\*(?!/)', + beginCaptures: { + '0': { + name: 'punctuation.definition.comment.ts', + }, + }, + end: '\\*/', + endCaptures: { + '0': { + name: 'punctuation.definition.comment.ts', + }, + }, + patterns: [ + { + include: '#docblock', + }, + ], + }, + { + name: 'comment.block.ts', + begin: '(/\\*)(?:\\s*((@)internal)(?=\\s|(\\*/)))?', + beginCaptures: { + '1': { + name: 'punctuation.definition.comment.ts', + }, + '2': { + name: 'storage.type.internaldeclaration.ts', + }, + '3': { + name: 'punctuation.decorator.internaldeclaration.ts', + }, + }, + end: '\\*/', + endCaptures: { + '0': { + name: 'punctuation.definition.comment.ts', + }, + }, + }, + { + begin: '(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)', + beginCaptures: { + '1': { + name: 'punctuation.whitespace.comment.leading.ts', + }, + '2': { + name: 'comment.line.double-slash.ts', + }, + '3': { + name: 'punctuation.definition.comment.ts', + }, + '4': { + name: 'storage.type.internaldeclaration.ts', + }, + '5': { + name: 'punctuation.decorator.internaldeclaration.ts', + }, + }, + end: '(?=$)', + contentName: 'comment.line.double-slash.ts', + }, + ], + }, + 'single-line-comment-consuming-line-ending': { + begin: '(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)', + beginCaptures: { + '1': { + name: 'punctuation.whitespace.comment.leading.ts', + }, + '2': { + name: 'comment.line.double-slash.ts', + }, + '3': { + name: 'punctuation.definition.comment.ts', + }, + '4': { + name: 'storage.type.internaldeclaration.ts', + }, + '5': { + name: 'punctuation.decorator.internaldeclaration.ts', + }, + }, + end: '(?=^)', + contentName: 'comment.line.double-slash.ts', + }, + directives: { + name: 'comment.line.triple-slash.directive.ts', + begin: "^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|lib|name|resolution-mode)\\s*=\\s*((\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)))+\\s*/>\\s*$)", + beginCaptures: { + '1': { + name: 'punctuation.definition.comment.ts', + }, + }, + end: '(?=$)', + patterns: [ + { + name: 'meta.tag.ts', + begin: '(<)(reference|amd-dependency|amd-module)', + beginCaptures: { + '1': { + name: 'punctuation.definition.tag.directive.ts', + }, + '2': { + name: 'entity.name.tag.directive.ts', + }, + }, + end: '/>', + endCaptures: { + '0': { + name: 'punctuation.definition.tag.directive.ts', + }, + }, + patterns: [ + { + name: 'entity.other.attribute-name.directive.ts', + match: 'path|types|no-default-lib|lib|name|resolution-mode', + }, + { + name: 'keyword.operator.assignment.ts', + match: '=', + }, + { + include: '#string', + }, + ], + }, + ], + }, + docblock: { + patterns: [ + { + match: '(?x)\n((@)(?:access|api))\n\\s+\n(private|protected|public)\n\\b', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'constant.language.access-type.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)author)\n\\s+\n(\n [^@\\s<>*/]\n (?:[^@<>*/]|\\*[^/])*\n)\n(?:\n \\s*\n (<)\n ([^>\\s]+)\n (>)\n)?', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'entity.name.type.instance.jsdoc', + }, + '4': { + name: 'punctuation.definition.bracket.angle.begin.jsdoc', + }, + '5': { + name: 'constant.other.email.link.underline.jsdoc', + }, + '6': { + name: 'punctuation.definition.bracket.angle.end.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)borrows) \\s+\n((?:[^@\\s*/]|\\*[^/])+) # \n\\s+ (as) \\s+ # as\n((?:[^@\\s*/]|\\*[^/])+) # ', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'entity.name.type.instance.jsdoc', + }, + '4': { + name: 'keyword.operator.control.jsdoc', + }, + '5': { + name: 'entity.name.type.instance.jsdoc', + }, + }, + }, + { + name: 'meta.example.jsdoc', + begin: '((@)example)\\s+', + end: '(?=@|\\*/)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + patterns: [ + { + match: '^\\s\\*\\s+', + }, + { + contentName: 'constant.other.description.jsdoc', + begin: '\\G(<)caption(>)', + beginCaptures: { + '0': { + name: 'entity.name.tag.inline.jsdoc', + }, + '1': { + name: 'punctuation.definition.bracket.angle.begin.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.angle.end.jsdoc', + }, + }, + end: '()|(?=\\*/)', + endCaptures: { + '0': { + name: 'entity.name.tag.inline.jsdoc', + }, + '1': { + name: 'punctuation.definition.bracket.angle.begin.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.angle.end.jsdoc', + }, + }, + }, + { + match: '[^\\s@*](?:[^*]|\\*[^/])*', + captures: { + '0': { + name: 'source.embedded.ts', + }, + }, + }, + ], + }, + { + match: '(?x) ((@)kind) \\s+ (class|constant|event|external|file|function|member|mixin|module|namespace|typedef) \\b', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'constant.language.symbol-type.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)see)\n\\s+\n(?:\n # URL\n (\n (?=https?://)\n (?:[^\\s*]|\\*[^/])+\n )\n |\n # JSDoc namepath\n (\n (?!\n # Avoid matching bare URIs (also acceptable as links)\n https?://\n |\n # Avoid matching {@inline tags}; we match those below\n (?:\\[[^\\[\\]]*\\])? # Possible description [preceding]{@tag}\n {@(?:link|linkcode|linkplain|tutorial)\\b\n )\n # Matched namepath\n (?:[^@\\s*/]|\\*[^/])+\n )\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.link.underline.jsdoc', + }, + '4': { + name: 'entity.name.type.instance.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)template)\n\\s+\n# One or more valid identifiers\n(\n [A-Za-z_$] # First character: non-numeric word character\n [\\w$.\\[\\]]* # Rest of identifier\n (?: # Possible list of additional identifiers\n \\s* , \\s*\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n )*\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + }, + }, + { + begin: '(?x)((@)template)\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + { + name: 'variable.other.jsdoc', + match: '([A-Za-z_$][\\w$.\\[\\]]*)', + }, + ], + }, + { + match: '(?x)\n(\n (@)\n (?:arg|argument|const|constant|member|namespace|param|var)\n)\n\\s+\n(\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + }, + }, + { + begin: '((@)typedef)\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + { + name: 'entity.name.type.instance.jsdoc', + match: '(?:[^@\\s*/]|\\*[^/])+', + }, + ], + }, + { + begin: '((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + { + name: 'variable.other.jsdoc', + match: '([A-Za-z_$][\\w$.\\[\\]]*)', + }, + { + name: 'variable.other.jsdoc', + match: "(?x)\n(\\[)\\s*\n[\\w$]+\n(?:\n (?:\\[\\])? # Foo[ ].bar properties within an array\n \\. # Foo.Bar namespaced parameter\n [\\w$]+\n)*\n(?:\n \\s*\n (=) # [foo=bar] Default parameter value\n \\s*\n (\n # The inner regexes are to stop the match early at */ and to not stop at escaped quotes\n (?>\n \"(?:(?:\\*(?!/))|(?:\\\\(?!\"))|[^*\\\\])*?\" | # [foo=\"bar\"] Double-quoted\n '(?:(?:\\*(?!/))|(?:\\\\(?!'))|[^*\\\\])*?' | # [foo='bar'] Single-quoted\n \\[ (?:(?:\\*(?!/))|[^*])*? \\] | # [foo=[1,2]] Array literal\n (?:(?:\\*(?!/))|\\s(?!\\s*\\])|\\[.*?(?:\\]|(?=\\*/))|[^*\\s\\[\\]])* # Everything else\n )*\n )\n)?\n\\s*(?:(\\])((?:[^*\\s]|\\*[^\\s/])+)?|(?=\\*/))", + captures: { + '1': { + name: 'punctuation.definition.optional-value.begin.bracket.square.jsdoc', + }, + '2': { + name: 'keyword.operator.assignment.jsdoc', + }, + '3': { + name: 'source.embedded.ts', + }, + '4': { + name: 'punctuation.definition.optional-value.end.bracket.square.jsdoc', + }, + '5': { + name: 'invalid.illegal.syntax.jsdoc', + }, + }, + }, + ], + }, + { + begin: '(?x)\n(\n (@)\n (?:define|enum|exception|export|extends|lends|implements|modifies\n |namespace|private|protected|returns?|satisfies|suppress|this|throws|type\n |yields?)\n)\n\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + ], + }, + { + match: '(?x)\n(\n (@)\n (?:alias|augments|callback|constructs|emits|event|fires|exports?\n |extends|external|function|func|host|lends|listens|interface|memberof!?\n |method|module|mixes|mixin|name|requires|see|this|typedef|uses)\n)\n\\s+\n(\n (?:\n [^{}@\\s*] | \\*[^/]\n )+\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'entity.name.type.instance.jsdoc', + }, + }, + }, + { + contentName: 'variable.other.jsdoc', + begin: "((@)(?:default(?:value)?|license|version))\\s+(([''\"]))", + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + '4': { + name: 'punctuation.definition.string.begin.jsdoc', + }, + }, + end: '(\\3)|(?=$|\\*/)', + endCaptures: { + '0': { + name: 'variable.other.jsdoc', + }, + '1': { + name: 'punctuation.definition.string.end.jsdoc', + }, + }, + }, + { + match: '((@)(?:default(?:value)?|license|tutorial|variation|version))\\s+([^\\s*]+)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + }, + }, + { + name: 'storage.type.class.jsdoc', + match: '(?x) (@) (?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles |callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright |default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception |exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func |function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc |inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method |mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects |override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected |public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary |suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation |version|virtual|writeOnce|yields?) \\b', + captures: { + '1': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + }, + { + include: '#inline-tags', + }, + { + match: '((@)(?:[_$[:alpha:]][_$[:alnum:]]*))(?=\\s+)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + }, + ], + }, + brackets: { + patterns: [ + { + begin: '{', + end: '}|(?=\\*/)', + patterns: [ + { + include: '#brackets', + }, + ], + }, + { + begin: '\\[', + end: '\\]|(?=\\*/)', + patterns: [ + { + include: '#brackets', + }, + ], + }, + ], + }, + 'inline-tags': { + patterns: [ + { + name: 'constant.other.description.jsdoc', + match: '(\\[)[^\\]]+(\\])(?={@(?:link|linkcode|linkplain|tutorial))', + captures: { + '1': { + name: 'punctuation.definition.bracket.square.begin.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.square.end.jsdoc', + }, + }, + }, + { + name: 'entity.name.type.instance.jsdoc', + begin: '({)((@)(?:link(?:code|plain)?|tutorial))\\s*', + beginCaptures: { + '1': { + name: 'punctuation.definition.bracket.curly.begin.jsdoc', + }, + '2': { + name: 'storage.type.class.jsdoc', + }, + '3': { + name: 'punctuation.definition.inline.tag.jsdoc', + }, + }, + end: '}|(?=\\*/)', + endCaptures: { + '0': { + name: 'punctuation.definition.bracket.curly.end.jsdoc', + }, + }, + patterns: [ + { + match: '\\G((?=https?://)(?:[^|}\\s*]|\\*[/])+)(\\|)?', + captures: { + '1': { + name: 'variable.other.link.underline.jsdoc', + }, + '2': { + name: 'punctuation.separator.pipe.jsdoc', + }, + }, + }, + { + match: '\\G((?:[^{}@\\s|*]|\\*[^/])+)(\\|)?', + captures: { + '1': { + name: 'variable.other.description.jsdoc', + }, + '2': { + name: 'punctuation.separator.pipe.jsdoc', + }, + }, + }, + ], + }, + ], + }, + jsdoctype: { + patterns: [ + { + contentName: 'entity.name.type.instance.jsdoc', + begin: '\\G({)', + beginCaptures: { + '0': { + name: 'entity.name.type.instance.jsdoc', + }, + '1': { + name: 'punctuation.definition.bracket.curly.begin.jsdoc', + }, + }, + end: '((}))\\s*|(?=\\*/)', + endCaptures: { + '1': { + name: 'entity.name.type.instance.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.curly.end.jsdoc', + }, + }, + patterns: [ + { + include: '#brackets', + }, + ], + }, + ], + }, + }, + }, + grammarLocation: './syntaxes/TypeScript.tmLanguage.json', + injectTo: undefined, + embeddedLanguages: undefined, + tokenTypes: { + 'meta.template.expression': 'other', + 'meta.template.expression string': 'string', + 'meta.template.expression comment': 'comment', + 'entity.name.type.instance.jsdoc': 'other', + 'entity.name.function.tagged-template': 'other', + 'meta.import string.quoted': 'other', + 'variable.other.jsdoc': 'other', + }, + }, + { + language: 'typescriptreact', + scope: 'source.tsx', + format: 'json', + grammar: { + information_for_contributors: [ + 'This file has been converted from https://github.com/microsoft/TypeScript-TmLanguage/blob/master/TypeScriptReact.tmLanguage', + 'If you want to provide a fix or improvement, please create a pull request against the original repository.', + 'Once accepted there, we are happy to receive an update request.', + ], + version: 'https://github.com/microsoft/TypeScript-TmLanguage/commit/0d73d1117e0a9b1d6635ebbe9aa37d615171b02d', + name: 'TypeScriptReact', + scopeName: 'source.tsx', + patterns: [ + { + include: '#directives', + }, + { + include: '#statements', + }, + { + include: '#shebang', + }, + ], + repository: { + shebang: { + name: 'comment.line.shebang.tsx', + match: '\\A(#!).*(?=$)', + captures: { + '1': { + name: 'punctuation.definition.comment.tsx', + }, + }, + }, + statements: { + patterns: [ + { + include: '#declaration', + }, + { + include: '#control-statement', + }, + { + include: '#after-operator-block-as-object-literal', + }, + { + include: '#decl-block', + }, + { + include: '#label', + }, + { + include: '#expression', + }, + { + include: '#punctuation-semicolon', + }, + { + include: '#string', + }, + { + include: '#comment', + }, + ], + }, + declaration: { + patterns: [ + { + include: '#decorator', + }, + { + include: '#var-expr', + }, + { + include: '#function-declaration', + }, + { + include: '#class-declaration', + }, + { + include: '#interface-declaration', + }, + { + include: '#enum-declaration', + }, + { + include: '#namespace-declaration', + }, + { + include: '#type-alias-declaration', + }, + { + include: '#import-equals-declaration', + }, + { + include: '#import-declaration', + }, + { + include: '#export-declaration', + }, + { + name: 'storage.modifier.tsx', + match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + beginCaptures: { + '1': { + name: 'meta.definition.variable.tsx entity.name.function.tsx', + }, + '2': { + name: 'keyword.operator.definiteassignment.tsx', + }, + }, + end: '(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + beginCaptures: { + '1': { + name: 'meta.definition.variable.tsx variable.other.constant.tsx entity.name.function.tsx', + }, + }, + end: '(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '1': { + name: 'storage.modifier.tsx', + }, + '2': { + name: 'keyword.operator.rest.tsx', + }, + '3': { + name: 'entity.name.function.tsx variable.language.this.tsx', + }, + '4': { + name: 'entity.name.function.tsx', + }, + '5': { + name: 'keyword.operator.optional.tsx', + }, + }, + }, + { + match: '(?x)(?:(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '1': { + name: 'meta.definition.property.tsx entity.name.function.tsx', + }, + '2': { + name: 'keyword.operator.optional.tsx', + }, + '3': { + name: 'keyword.operator.definiteassignment.tsx', + }, + }, + }, + { + name: 'meta.definition.property.tsx variable.object.property.tsx', + match: '\\#?[_$[:alpha:]][_$[:alnum:]]*', + }, + { + name: 'keyword.operator.optional.tsx', + match: '\\?', + }, + { + name: 'keyword.operator.definiteassignment.tsx', + match: '\\!', + }, + ], + }, + 'variable-initializer': { + patterns: [ + { + begin: '(?\\s*$)', + beginCaptures: { + '1': { + name: 'keyword.operator.assignment.tsx', + }, + }, + end: '(?=$|^|[,);}\\]]|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])', + beginCaptures: { + '1': { + name: 'storage.modifier.tsx', + }, + '2': { + name: 'storage.modifier.tsx', + }, + '3': { + name: 'storage.modifier.tsx', + }, + '4': { + name: 'storage.modifier.async.tsx', + }, + '5': { + name: 'keyword.operator.new.tsx', + }, + '6': { + name: 'keyword.generator.asterisk.tsx', + }, + }, + end: '(?=\\}|;|,|$)|(?<=\\})', + patterns: [ + { + include: '#method-declaration-name', + }, + { + include: '#function-body', + }, + ], + }, + { + name: 'meta.method.declaration.tsx', + begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + beginCaptures: { + '1': { + name: 'storage.modifier.tsx', + }, + '2': { + name: 'storage.modifier.tsx', + }, + '3': { + name: 'storage.modifier.tsx', + }, + '4': { + name: 'storage.modifier.async.tsx', + }, + '5': { + name: 'storage.type.property.tsx', + }, + '6': { + name: 'keyword.generator.asterisk.tsx', + }, + }, + end: '(?=\\}|;|,|$)|(?<=\\})', + patterns: [ + { + include: '#method-declaration-name', + }, + { + include: '#function-body', + }, + ], + }, + ], + }, + 'object-literal-method-declaration': { + name: 'meta.method.declaration.tsx', + begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + '2': { + name: 'storage.type.property.tsx', + }, + '3': { + name: 'keyword.generator.asterisk.tsx', + }, + }, + end: '(?=\\}|;|,)|(?<=\\})', + patterns: [ + { + include: '#method-declaration-name', + }, + { + include: '#function-body', + }, + { + begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + '2': { + name: 'storage.type.property.tsx', + }, + '3': { + name: 'keyword.generator.asterisk.tsx', + }, + }, + end: '(?=\\(|\\<)', + patterns: [ + { + include: '#method-declaration-name', + }, + ], + }, + ], + }, + 'method-declaration-name': { + begin: "(?x)(?=((\\b(?)', + captures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + '2': { + name: 'variable.parameter.tsx', + }, + }, + }, + { + name: 'meta.arrow.tsx', + begin: "(?x) (?:\n (? is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n )\n)", + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + }, + end: '(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', + patterns: [ + { + include: '#comment', + }, + { + include: '#type-parameters', + }, + { + include: '#function-parameters', + }, + { + include: '#arrow-return-type', + }, + { + include: '#possibly-arrow-return-type', + }, + ], + }, + { + name: 'meta.arrow.tsx', + begin: '=>', + beginCaptures: { + '0': { + name: 'storage.type.function.arrow.tsx', + }, + }, + end: '((?<=\\}|\\S)(?)|((?!\\{)(?=\\S)))(?!\\/[\\/\\*])', + patterns: [ + { + include: '#single-line-comment-consuming-line-ending', + }, + { + include: '#decl-block', + }, + { + include: '#expression', + }, + ], + }, + ], + }, + 'indexer-declaration': { + name: 'meta.indexer.declaration.tsx', + begin: '(?:(?]|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^yield|[^\\._$[:alnum:]]yield|^throw|[^\\._$[:alnum:]]throw|^in|[^\\._$[:alnum:]]in|^of|[^\\._$[:alnum:]]of|^typeof|[^\\._$[:alnum:]]typeof|&&|\\|\\||\\*)\\s*(\\{)', + beginCaptures: { + '1': { + name: 'punctuation.definition.block.tsx', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.block.tsx', + }, + }, + patterns: [ + { + include: '#object-member', + }, + ], + }, + 'object-literal': { + name: 'meta.objectliteral.tsx', + begin: '\\{', + beginCaptures: { + '0': { + name: 'punctuation.definition.block.tsx', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.block.tsx', + }, + }, + patterns: [ + { + include: '#object-member', + }, + ], + }, + 'object-member': { + patterns: [ + { + include: '#comment', + }, + { + include: '#object-literal-method-declaration', + }, + { + name: 'meta.object.member.tsx meta.object-literal.key.tsx', + begin: '(?=\\[)', + end: '(?=:)|((?<=[\\]])(?=\\s*[\\(\\<]))', + patterns: [ + { + include: '#comment', + }, + { + include: '#array-literal', + }, + ], + }, + { + name: 'meta.object.member.tsx meta.object-literal.key.tsx', + begin: "(?=[\\'\\\"\\`])", + end: "(?=:)|((?<=[\\'\\\"\\`])(?=((\\s*[\\(\\<,}])|(\\s+(as|satisifies)\\s+))))", + patterns: [ + { + include: '#comment', + }, + { + include: '#string', + }, + ], + }, + { + name: 'meta.object.member.tsx meta.object-literal.key.tsx', + begin: '(?x)(?=(\\b(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '0': { + name: 'meta.object-literal.key.tsx', + }, + '1': { + name: 'entity.name.function.tsx', + }, + }, + }, + { + name: 'meta.object.member.tsx', + match: '(?:[_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:)', + captures: { + '0': { + name: 'meta.object-literal.key.tsx', + }, + }, + }, + { + name: 'meta.object.member.tsx', + begin: '\\.\\.\\.', + beginCaptures: { + '0': { + name: 'keyword.operator.spread.tsx', + }, + }, + end: '(?=,|\\})', + patterns: [ + { + include: '#expression', + }, + ], + }, + { + name: 'meta.object.member.tsx', + match: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=,|\\}|$|\\/\\/|\\/\\*)', + captures: { + '1': { + name: 'variable.other.readwrite.tsx', + }, + }, + }, + { + name: 'meta.object.member.tsx', + match: '(?]|\\|\\||\\&\\&|\\!\\=\\=|$|^|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + }, + end: '(?<=\\))', + patterns: [ + { + include: '#type-parameters', + }, + { + begin: '\\(', + beginCaptures: { + '0': { + name: 'meta.brace.round.tsx', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.tsx', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + ], + }, + { + begin: '(?<=:)\\s*(async)?\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + '2': { + name: 'meta.brace.round.tsx', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.tsx', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + { + begin: '(?<=:)\\s*(async)?\\s*(?=\\<\\s*$)', + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + }, + end: '(?<=\\>)', + patterns: [ + { + include: '#type-parameters', + }, + ], + }, + { + begin: '(?<=\\>)\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'meta.brace.round.tsx', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.tsx', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + { + include: '#possibly-arrow-return-type', + }, + { + include: '#expression', + }, + ], + }, + { + include: '#punctuation-comma', + }, + { + include: '#decl-block', + }, + ], + }, + 'ternary-expression': { + begin: '(?!\\?\\.\\s*[^[:digit:]])(\\?)(?!\\?)', + beginCaptures: { + '1': { + name: 'keyword.operator.ternary.tsx', + }, + }, + end: '\\s*(:)', + endCaptures: { + '1': { + name: 'keyword.operator.ternary.tsx', + }, + }, + patterns: [ + { + include: '#expression', + }, + ], + }, + 'function-call': { + patterns: [ + { + begin: "(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", + end: "(?<=\\))(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", + patterns: [ + { + name: 'meta.function-call.tsx', + begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))', + end: "(?=\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", + patterns: [ + { + include: '#function-call-target', + }, + ], + }, + { + include: '#comment', + }, + { + include: '#function-call-optionals', + }, + { + include: '#type-arguments', + }, + { + include: '#paren-expression', + }, + ], + }, + { + begin: '(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))(<\\s*[\\{\\[\\(]\\s*$))', + end: '(?<=\\>)(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))(<\\s*[\\{\\[\\(]\\s*$))', + patterns: [ + { + name: 'meta.function-call.tsx', + begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))', + end: '(?=(<\\s*[\\{\\[\\(]\\s*$))', + patterns: [ + { + include: '#function-call-target', + }, + ], + }, + { + include: '#comment', + }, + { + include: '#function-call-optionals', + }, + { + include: '#type-arguments', + }, + ], + }, + ], + }, + 'function-call-target': { + patterns: [ + { + include: '#support-function-call-identifiers', + }, + { + name: 'entity.name.function.tsx', + match: '(\\#?[_$[:alpha:]][_$[:alnum:]]*)', + }, + ], + }, + 'function-call-optionals': { + patterns: [ + { + name: 'meta.function-call.tsx punctuation.accessor.optional.tsx', + match: '\\?\\.', + }, + { + name: 'meta.function-call.tsx keyword.operator.definiteassignment.tsx', + match: '\\!', + }, + ], + }, + 'support-function-call-identifiers': { + patterns: [ + { + include: '#literal', + }, + { + include: '#support-objects', + }, + { + include: '#object-identifiers', + }, + { + include: '#punctuation-accessor', + }, + { + name: 'keyword.operator.expression.import.tsx', + match: "(?:(?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|(===|!==|==|!=)|(([\\&\\~\\^\\|]\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s+instanceof(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + }, + end: '(?<=\\))', + patterns: [ + { + include: '#paren-expression-possibly-arrow-with-typeparameters', + }, + ], + }, + { + begin: '(?<=[(=,]|=>|^return|[^\\._$[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\()|(<)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)))\\s*$)', + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + }, + end: '(?<=\\))', + patterns: [ + { + include: '#paren-expression-possibly-arrow-with-typeparameters', + }, + ], + }, + { + include: '#possibly-arrow-return-type', + }, + ], + }, + 'paren-expression-possibly-arrow-with-typeparameters': { + patterns: [ + { + include: '#type-parameters', + }, + { + begin: '\\(', + beginCaptures: { + '0': { + name: 'meta.brace.round.tsx', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.tsx', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + ], + }, + 'expression-inside-possibly-arrow-parens': { + patterns: [ + { + include: '#expressionWithoutIdentifiers', + }, + { + include: '#comment', + }, + { + include: '#string', + }, + { + include: '#decorator', + }, + { + include: '#destructuring-parameter', + }, + { + match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '1': { + name: 'storage.modifier.tsx', + }, + '2': { + name: 'keyword.operator.rest.tsx', + }, + '3': { + name: 'entity.name.function.tsx variable.language.this.tsx', + }, + '4': { + name: 'entity.name.function.tsx', + }, + '5': { + name: 'keyword.operator.optional.tsx', + }, + }, + }, + { + match: '(?x)(?:(?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?>=|>>>=|\\|=', + }, + { + name: 'keyword.operator.bitwise.shift.tsx', + match: '<<|>>>|>>', + }, + { + name: 'keyword.operator.comparison.tsx', + match: '===|!==|==|!=', + }, + { + name: 'keyword.operator.relational.tsx', + match: '<=|>=|<>|<|>', + }, + { + match: '(?<=[_$[:alnum:]])(\\!)\\s*(?:(/=)|(?:(/)(?![/*])))', + captures: { + '1': { + name: 'keyword.operator.logical.tsx', + }, + '2': { + name: 'keyword.operator.assignment.compound.tsx', + }, + '3': { + name: 'keyword.operator.arithmetic.tsx', + }, + }, + }, + { + name: 'keyword.operator.logical.tsx', + match: '\\!|&&|\\|\\||\\?\\?', + }, + { + name: 'keyword.operator.bitwise.tsx', + match: '\\&|~|\\^|\\|', + }, + { + name: 'keyword.operator.assignment.tsx', + match: '\\=', + }, + { + name: 'keyword.operator.decrement.tsx', + match: '--', + }, + { + name: 'keyword.operator.increment.tsx', + match: '\\+\\+', + }, + { + name: 'keyword.operator.arithmetic.tsx', + match: '%|\\*|/|-|\\+', + }, + { + begin: '(?<=[_$[:alnum:])\\]])\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)+(?:(/=)|(?:(/)(?![/*]))))', + end: '(?:(/=)|(?:(/)(?!\\*([^\\*]|(\\*[^\\/]))*\\*\\/)))', + endCaptures: { + '1': { + name: 'keyword.operator.assignment.compound.tsx', + }, + '2': { + name: 'keyword.operator.arithmetic.tsx', + }, + }, + patterns: [ + { + include: '#comment', + }, + ], + }, + { + match: '(?<=[_$[:alnum:])\\]])\\s*(?:(/=)|(?:(/)(?![/*])))', + captures: { + '1': { + name: 'keyword.operator.assignment.compound.tsx', + }, + '2': { + name: 'keyword.operator.arithmetic.tsx', + }, + }, + }, + ], + }, + 'typeof-operator': { + begin: '(?:&|{\\?]|(extends\\s+)|$|;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))', + patterns: [ + { + include: '#type-arguments', + }, + { + include: '#expression', + }, + ], + }, + literal: { + patterns: [ + { + include: '#numeric-literal', + }, + { + include: '#boolean-literal', + }, + { + include: '#null-literal', + }, + { + include: '#undefined-literal', + }, + { + include: '#numericConstant-literal', + }, + { + include: '#array-literal', + }, + { + include: '#this-literal', + }, + { + include: '#super-literal', + }, + ], + }, + 'array-literal': { + name: 'meta.array.literal.tsx', + begin: '\\s*(\\[)', + beginCaptures: { + '1': { + name: 'meta.brace.square.tsx', + }, + }, + end: '\\]', + endCaptures: { + '0': { + name: 'meta.brace.square.tsx', + }, + }, + patterns: [ + { + include: '#expression', + }, + { + include: '#punctuation-comma', + }, + ], + }, + 'numeric-literal': { + patterns: [ + { + name: 'constant.numeric.hex.tsx', + match: '\\b(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\\())\n |\n (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$)))', + captures: { + '1': { + name: 'punctuation.accessor.tsx', + }, + '2': { + name: 'punctuation.accessor.optional.tsx', + }, + '3': { + name: 'support.variable.property.tsx', + }, + '4': { + name: 'support.constant.tsx', + }, + }, + }, + { + match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n))", + captures: { + '1': { + name: 'punctuation.accessor.tsx', + }, + '2': { + name: 'punctuation.accessor.optional.tsx', + }, + '3': { + name: 'entity.name.function.tsx', + }, + }, + }, + { + match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])', + captures: { + '1': { + name: 'punctuation.accessor.tsx', + }, + '2': { + name: 'punctuation.accessor.optional.tsx', + }, + '3': { + name: 'variable.other.constant.property.tsx', + }, + }, + }, + { + match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*)', + captures: { + '1': { + name: 'punctuation.accessor.tsx', + }, + '2': { + name: 'punctuation.accessor.optional.tsx', + }, + '3': { + name: 'variable.other.property.tsx', + }, + }, + }, + { + name: 'variable.other.constant.tsx', + match: '([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])', + }, + { + name: 'variable.other.readwrite.tsx', + match: '[_$[:alpha:]][_$[:alnum:]]*', + }, + ], + }, + 'object-identifiers': { + patterns: [ + { + name: 'support.class.tsx', + match: '([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\??\\.\\s*prototype\\b(?!\\$))', + }, + { + match: '(?x)(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n (\\#?[[:upper:]][_$[:digit:][:upper:]]*) |\n (\\#?[_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)', + captures: { + '1': { + name: 'punctuation.accessor.tsx', + }, + '2': { + name: 'punctuation.accessor.optional.tsx', + }, + '3': { + name: 'variable.other.constant.object.property.tsx', + }, + '4': { + name: 'variable.other.object.property.tsx', + }, + }, + }, + { + match: '(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)', + captures: { + '1': { + name: 'variable.other.constant.object.tsx', + }, + '2': { + name: 'variable.other.object.tsx', + }, + }, + }, + ], + }, + 'type-annotation': { + patterns: [ + { + name: 'meta.type.annotation.tsx', + begin: '(:)(?=\\s*\\S)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.tsx', + }, + }, + end: '(?])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))', + patterns: [ + { + include: '#type', + }, + ], + }, + { + name: 'meta.type.annotation.tsx', + begin: '(:)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.tsx', + }, + }, + end: '(?])|(?=^\\s*$)|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))', + patterns: [ + { + include: '#type', + }, + ], + }, + ], + }, + 'parameter-type-annotation': { + patterns: [ + { + name: 'meta.type.annotation.tsx', + begin: '(:)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.tsx', + }, + }, + end: '(?=[,)])|(?==[^>])', + patterns: [ + { + include: '#type', + }, + ], + }, + ], + }, + 'return-type': { + patterns: [ + { + name: 'meta.return.type.tsx', + begin: '(?<=\\))\\s*(:)(?=\\s*\\S)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.tsx', + }, + }, + end: '(?|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', + patterns: [ + { + include: '#arrow-return-type-body', + }, + ], + }, + 'possibly-arrow-return-type': { + begin: '(?<=\\)|^)\\s*(:)(?=\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*=>)', + beginCaptures: { + '1': { + name: 'meta.arrow.tsx meta.return.type.arrow.tsx keyword.operator.type.annotation.tsx', + }, + }, + end: '(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', + contentName: 'meta.arrow.tsx meta.return.type.arrow.tsx', + patterns: [ + { + include: '#arrow-return-type-body', + }, + ], + }, + 'arrow-return-type-body': { + patterns: [ + { + begin: '(?<=[:])(?=\\s*\\{)', + end: '(?<=\\})', + patterns: [ + { + include: '#type-object', + }, + ], + }, + { + include: '#type-predicate-operator', + }, + { + include: '#type', + }, + ], + }, + 'type-parameters': { + name: 'meta.type.parameters.tsx', + begin: '(<)', + beginCaptures: { + '1': { + name: 'punctuation.definition.typeparameters.begin.tsx', + }, + }, + end: '(>)', + endCaptures: { + '1': { + name: 'punctuation.definition.typeparameters.end.tsx', + }, + }, + patterns: [ + { + include: '#comment', + }, + { + name: 'storage.modifier.tsx', + match: '(?)', + }, + ], + }, + 'type-arguments': { + name: 'meta.type.parameters.tsx', + begin: '\\<', + beginCaptures: { + '0': { + name: 'punctuation.definition.typeparameters.begin.tsx', + }, + }, + end: '\\>', + endCaptures: { + '0': { + name: 'punctuation.definition.typeparameters.end.tsx', + }, + }, + patterns: [ + { + include: '#type-arguments-body', + }, + ], + }, + 'type-arguments-body': { + patterns: [ + { + match: '(?)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))))', + captures: { + '1': { + name: 'storage.modifier.tsx', + }, + '2': { + name: 'keyword.operator.rest.tsx', + }, + '3': { + name: 'entity.name.function.tsx variable.language.this.tsx', + }, + '4': { + name: 'entity.name.function.tsx', + }, + '5': { + name: 'keyword.operator.optional.tsx', + }, + }, + }, + { + match: '(?x)(?:(?)', + patterns: [ + { + include: '#comment', + }, + { + include: '#type-parameters', + }, + ], + }, + { + name: 'meta.type.constructor.tsx', + begin: '(?)\n ))\n )\n )\n)', + end: '(?<=\\))', + patterns: [ + { + include: '#function-parameters', + }, + ], + }, + ], + }, + 'type-function-return-type': { + patterns: [ + { + name: 'meta.type.function.return.tsx', + begin: '(=>)(?=\\s*\\S)', + beginCaptures: { + '1': { + name: 'storage.type.function.arrow.tsx', + }, + }, + end: '(?)(?:\\?]|//|$)', + patterns: [ + { + include: '#type-function-return-type-core', + }, + ], + }, + { + name: 'meta.type.function.return.tsx', + begin: '=>', + beginCaptures: { + '0': { + name: 'storage.type.function.arrow.tsx', + }, + }, + end: '(?)(?]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))', + patterns: [ + { + include: '#type-function-return-type-core', + }, + ], + }, + ], + }, + 'type-function-return-type-core': { + patterns: [ + { + include: '#comment', + }, + { + begin: '(?<==>)(?=\\s*\\{)', + end: '(?<=\\})', + patterns: [ + { + include: '#type-object', + }, + ], + }, + { + include: '#type-predicate-operator', + }, + { + include: '#type', + }, + ], + }, + 'type-operators': { + patterns: [ + { + include: '#typeof-operator', + }, + { + include: '#type-infer', + }, + { + begin: '([&|])(?=\\s*\\{)', + beginCaptures: { + '0': { + name: 'keyword.operator.type.tsx', + }, + }, + end: '(?<=\\})', + patterns: [ + { + include: '#type-object', + }, + ], + }, + { + begin: '[&|]', + beginCaptures: { + '0': { + name: 'keyword.operator.type.tsx', + }, + }, + end: '(?=\\S)', + }, + { + name: 'keyword.operator.expression.keyof.tsx', + match: '(?)', + endCaptures: { + '1': { + name: 'meta.type.parameters.tsx punctuation.definition.typeparameters.end.tsx', + }, + }, + contentName: 'meta.type.parameters.tsx', + patterns: [ + { + include: '#type-arguments-body', + }, + ], + }, + { + begin: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(<)', + beginCaptures: { + '1': { + name: 'entity.name.type.tsx', + }, + '2': { + name: 'meta.type.parameters.tsx punctuation.definition.typeparameters.begin.tsx', + }, + }, + end: '(>)', + endCaptures: { + '1': { + name: 'meta.type.parameters.tsx punctuation.definition.typeparameters.end.tsx', + }, + }, + contentName: 'meta.type.parameters.tsx', + patterns: [ + { + include: '#type-arguments-body', + }, + ], + }, + { + match: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))', + captures: { + '1': { + name: 'entity.name.type.module.tsx', + }, + '2': { + name: 'punctuation.accessor.tsx', + }, + '3': { + name: 'punctuation.accessor.optional.tsx', + }, + }, + }, + { + name: 'entity.name.type.tsx', + match: '[_$[:alpha:]][_$[:alnum:]]*', + }, + ], + }, + 'punctuation-comma': { + name: 'punctuation.separator.comma.tsx', + match: ',', + }, + 'punctuation-semicolon': { + name: 'punctuation.terminator.statement.tsx', + match: ';', + }, + 'punctuation-accessor': { + match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))', + captures: { + '1': { + name: 'punctuation.accessor.tsx', + }, + '2': { + name: 'punctuation.accessor.optional.tsx', + }, + }, + }, + string: { + patterns: [ + { + include: '#qstring-single', + }, + { + include: '#qstring-double', + }, + { + include: '#template', + }, + ], + }, + 'qstring-double': { + name: 'string.quoted.double.tsx', + begin: '"', + beginCaptures: { + '0': { + name: 'punctuation.definition.string.begin.tsx', + }, + }, + end: '(")|((?:[^\\\\\\n])$)', + endCaptures: { + '1': { + name: 'punctuation.definition.string.end.tsx', + }, + '2': { + name: 'invalid.illegal.newline.tsx', + }, + }, + patterns: [ + { + include: '#string-character-escape', + }, + ], + }, + 'qstring-single': { + name: 'string.quoted.single.tsx', + begin: "'", + beginCaptures: { + '0': { + name: 'punctuation.definition.string.begin.tsx', + }, + }, + end: "(\\')|((?:[^\\\\\\n])$)", + endCaptures: { + '1': { + name: 'punctuation.definition.string.end.tsx', + }, + '2': { + name: 'invalid.illegal.newline.tsx', + }, + }, + patterns: [ + { + include: '#string-character-escape', + }, + ], + }, + 'string-character-escape': { + name: 'constant.character.escape.tsx', + match: '\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\\{[0-9A-Fa-f]+\\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)', + }, + template: { + patterns: [ + { + include: '#template-call', + }, + { + contentName: 'string.template.tsx', + begin: '([_$[:alpha:]][_$[:alnum:]]*)?(`)', + beginCaptures: { + '1': { + name: 'entity.name.function.tagged-template.tsx', + }, + '2': { + name: 'string.template.tsx punctuation.definition.string.template.begin.tsx', + }, + }, + end: '`', + endCaptures: { + '0': { + name: 'string.template.tsx punctuation.definition.string.template.end.tsx', + }, + }, + patterns: [ + { + include: '#template-substitution-element', + }, + { + include: '#string-character-escape', + }, + ], + }, + ], + }, + 'template-call': { + patterns: [ + { + begin: "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)", + end: '(?=`)', + patterns: [ + { + begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))', + end: "(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)", + patterns: [ + { + include: '#support-function-call-identifiers', + }, + { + name: 'entity.name.function.tagged-template.tsx', + match: '([_$[:alpha:]][_$[:alnum:]]*)', + }, + ], + }, + { + include: '#type-arguments', + }, + ], + }, + { + begin: "([_$[:alpha:]][_$[:alnum:]]*)?\\s*(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)`)", + beginCaptures: { + '1': { + name: 'entity.name.function.tagged-template.tsx', + }, + }, + end: '(?=`)', + patterns: [ + { + include: '#type-arguments', + }, + ], + }, + ], + }, + 'template-substitution-element': { + name: 'meta.template.expression.tsx', + begin: '\\$\\{', + beginCaptures: { + '0': { + name: 'punctuation.definition.template-expression.begin.tsx', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.template-expression.end.tsx', + }, + }, + patterns: [ + { + include: '#expression', + }, + ], + contentName: 'meta.embedded.line.tsx', + }, + 'type-string': { + patterns: [ + { + include: '#qstring-single', + }, + { + include: '#qstring-double', + }, + { + include: '#template-type', + }, + ], + }, + 'template-type': { + patterns: [ + { + include: '#template-call', + }, + { + contentName: 'string.template.tsx', + begin: '([_$[:alpha:]][_$[:alnum:]]*)?(`)', + beginCaptures: { + '1': { + name: 'entity.name.function.tagged-template.tsx', + }, + '2': { + name: 'string.template.tsx punctuation.definition.string.template.begin.tsx', + }, + }, + end: '`', + endCaptures: { + '0': { + name: 'string.template.tsx punctuation.definition.string.template.end.tsx', + }, + }, + patterns: [ + { + include: '#template-type-substitution-element', + }, + { + include: '#string-character-escape', + }, + ], + }, + ], + }, + 'template-type-substitution-element': { + name: 'meta.template.expression.tsx', + begin: '\\$\\{', + beginCaptures: { + '0': { + name: 'punctuation.definition.template-expression.begin.tsx', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.template-expression.end.tsx', + }, + }, + patterns: [ + { + include: '#type', + }, + ], + contentName: 'meta.embedded.line.tsx', + }, + regex: { + patterns: [ + { + name: 'string.regexp.tsx', + begin: '(?|&&|\\|\\||\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[\\()]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\]|\\(([^\\)\\\\]|\\\\.)+\\))+\\/([dgimsuy]+|(?![\\/\\*])|(?=\\/\\*))(?!\\s*[a-zA-Z0-9_$]))', + beginCaptures: { + '1': { + name: 'punctuation.definition.string.begin.tsx', + }, + }, + end: '(/)([dgimsuy]*)', + endCaptures: { + '1': { + name: 'punctuation.definition.string.end.tsx', + }, + '2': { + name: 'keyword.other.tsx', + }, + }, + patterns: [ + { + include: '#regexp', + }, + ], + }, + { + name: 'string.regexp.tsx', + begin: '((?', + captures: { + '0': { + name: 'keyword.other.back-reference.regexp', + }, + '1': { + name: 'variable.other.regexp', + }, + }, + }, + { + name: 'keyword.operator.quantifier.regexp', + match: '[?+*]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??', + }, + { + name: 'keyword.operator.or.regexp', + match: '\\|', + }, + { + name: 'meta.group.assertion.regexp', + begin: '(\\()((\\?=)|(\\?!)|(\\?<=)|(\\?))?', + beginCaptures: { + '0': { + name: 'punctuation.definition.group.regexp', + }, + '1': { + name: 'punctuation.definition.group.no-capture.regexp', + }, + '2': { + name: 'variable.other.regexp', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'punctuation.definition.group.regexp', + }, + }, + patterns: [ + { + include: '#regexp', + }, + ], + }, + { + name: 'constant.other.character-class.set.regexp', + begin: '(\\[)(\\^)?', + beginCaptures: { + '1': { + name: 'punctuation.definition.character-class.regexp', + }, + '2': { + name: 'keyword.operator.negation.regexp', + }, + }, + end: '(\\])', + endCaptures: { + '1': { + name: 'punctuation.definition.character-class.regexp', + }, + }, + patterns: [ + { + name: 'constant.other.character-class.range.regexp', + match: '(?:.|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))\\-(?:[^\\]\\\\]|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))', + captures: { + '1': { + name: 'constant.character.numeric.regexp', + }, + '2': { + name: 'constant.character.control.regexp', + }, + '3': { + name: 'constant.character.escape.backslash.regexp', + }, + '4': { + name: 'constant.character.numeric.regexp', + }, + '5': { + name: 'constant.character.control.regexp', + }, + '6': { + name: 'constant.character.escape.backslash.regexp', + }, + }, + }, + { + include: '#regex-character-class', + }, + ], + }, + { + include: '#regex-character-class', + }, + ], + }, + 'regex-character-class': { + patterns: [ + { + name: 'constant.other.character-class.regexp', + match: '\\\\[wWsSdDtrnvf]|\\.', + }, + { + name: 'constant.character.numeric.regexp', + match: '\\\\([0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4})', + }, + { + name: 'constant.character.control.regexp', + match: '\\\\c[A-Z]', + }, + { + name: 'constant.character.escape.backslash.regexp', + match: '\\\\.', + }, + ], + }, + comment: { + patterns: [ + { + name: 'comment.block.documentation.tsx', + begin: '/\\*\\*(?!/)', + beginCaptures: { + '0': { + name: 'punctuation.definition.comment.tsx', + }, + }, + end: '\\*/', + endCaptures: { + '0': { + name: 'punctuation.definition.comment.tsx', + }, + }, + patterns: [ + { + include: '#docblock', + }, + ], + }, + { + name: 'comment.block.tsx', + begin: '(/\\*)(?:\\s*((@)internal)(?=\\s|(\\*/)))?', + beginCaptures: { + '1': { + name: 'punctuation.definition.comment.tsx', + }, + '2': { + name: 'storage.type.internaldeclaration.tsx', + }, + '3': { + name: 'punctuation.decorator.internaldeclaration.tsx', + }, + }, + end: '\\*/', + endCaptures: { + '0': { + name: 'punctuation.definition.comment.tsx', + }, + }, + }, + { + begin: '(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)', + beginCaptures: { + '1': { + name: 'punctuation.whitespace.comment.leading.tsx', + }, + '2': { + name: 'comment.line.double-slash.tsx', + }, + '3': { + name: 'punctuation.definition.comment.tsx', + }, + '4': { + name: 'storage.type.internaldeclaration.tsx', + }, + '5': { + name: 'punctuation.decorator.internaldeclaration.tsx', + }, + }, + end: '(?=$)', + contentName: 'comment.line.double-slash.tsx', + }, + ], + }, + 'single-line-comment-consuming-line-ending': { + begin: '(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)', + beginCaptures: { + '1': { + name: 'punctuation.whitespace.comment.leading.tsx', + }, + '2': { + name: 'comment.line.double-slash.tsx', + }, + '3': { + name: 'punctuation.definition.comment.tsx', + }, + '4': { + name: 'storage.type.internaldeclaration.tsx', + }, + '5': { + name: 'punctuation.decorator.internaldeclaration.tsx', + }, + }, + end: '(?=^)', + contentName: 'comment.line.double-slash.tsx', + }, + directives: { + name: 'comment.line.triple-slash.directive.tsx', + begin: "^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|lib|name|resolution-mode)\\s*=\\s*((\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)))+\\s*/>\\s*$)", + beginCaptures: { + '1': { + name: 'punctuation.definition.comment.tsx', + }, + }, + end: '(?=$)', + patterns: [ + { + name: 'meta.tag.tsx', + begin: '(<)(reference|amd-dependency|amd-module)', + beginCaptures: { + '1': { + name: 'punctuation.definition.tag.directive.tsx', + }, + '2': { + name: 'entity.name.tag.directive.tsx', + }, + }, + end: '/>', + endCaptures: { + '0': { + name: 'punctuation.definition.tag.directive.tsx', + }, + }, + patterns: [ + { + name: 'entity.other.attribute-name.directive.tsx', + match: 'path|types|no-default-lib|lib|name|resolution-mode', + }, + { + name: 'keyword.operator.assignment.tsx', + match: '=', + }, + { + include: '#string', + }, + ], + }, + ], + }, + docblock: { + patterns: [ + { + match: '(?x)\n((@)(?:access|api))\n\\s+\n(private|protected|public)\n\\b', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'constant.language.access-type.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)author)\n\\s+\n(\n [^@\\s<>*/]\n (?:[^@<>*/]|\\*[^/])*\n)\n(?:\n \\s*\n (<)\n ([^>\\s]+)\n (>)\n)?', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'entity.name.type.instance.jsdoc', + }, + '4': { + name: 'punctuation.definition.bracket.angle.begin.jsdoc', + }, + '5': { + name: 'constant.other.email.link.underline.jsdoc', + }, + '6': { + name: 'punctuation.definition.bracket.angle.end.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)borrows) \\s+\n((?:[^@\\s*/]|\\*[^/])+) # \n\\s+ (as) \\s+ # as\n((?:[^@\\s*/]|\\*[^/])+) # ', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'entity.name.type.instance.jsdoc', + }, + '4': { + name: 'keyword.operator.control.jsdoc', + }, + '5': { + name: 'entity.name.type.instance.jsdoc', + }, + }, + }, + { + name: 'meta.example.jsdoc', + begin: '((@)example)\\s+', + end: '(?=@|\\*/)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + patterns: [ + { + match: '^\\s\\*\\s+', + }, + { + contentName: 'constant.other.description.jsdoc', + begin: '\\G(<)caption(>)', + beginCaptures: { + '0': { + name: 'entity.name.tag.inline.jsdoc', + }, + '1': { + name: 'punctuation.definition.bracket.angle.begin.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.angle.end.jsdoc', + }, + }, + end: '()|(?=\\*/)', + endCaptures: { + '0': { + name: 'entity.name.tag.inline.jsdoc', + }, + '1': { + name: 'punctuation.definition.bracket.angle.begin.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.angle.end.jsdoc', + }, + }, + }, + { + match: '[^\\s@*](?:[^*]|\\*[^/])*', + captures: { + '0': { + name: 'source.embedded.tsx', + }, + }, + }, + ], + }, + { + match: '(?x) ((@)kind) \\s+ (class|constant|event|external|file|function|member|mixin|module|namespace|typedef) \\b', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'constant.language.symbol-type.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)see)\n\\s+\n(?:\n # URL\n (\n (?=https?://)\n (?:[^\\s*]|\\*[^/])+\n )\n |\n # JSDoc namepath\n (\n (?!\n # Avoid matching bare URIs (also acceptable as links)\n https?://\n |\n # Avoid matching {@inline tags}; we match those below\n (?:\\[[^\\[\\]]*\\])? # Possible description [preceding]{@tag}\n {@(?:link|linkcode|linkplain|tutorial)\\b\n )\n # Matched namepath\n (?:[^@\\s*/]|\\*[^/])+\n )\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.link.underline.jsdoc', + }, + '4': { + name: 'entity.name.type.instance.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)template)\n\\s+\n# One or more valid identifiers\n(\n [A-Za-z_$] # First character: non-numeric word character\n [\\w$.\\[\\]]* # Rest of identifier\n (?: # Possible list of additional identifiers\n \\s* , \\s*\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n )*\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + }, + }, + { + begin: '(?x)((@)template)\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + { + name: 'variable.other.jsdoc', + match: '([A-Za-z_$][\\w$.\\[\\]]*)', + }, + ], + }, + { + match: '(?x)\n(\n (@)\n (?:arg|argument|const|constant|member|namespace|param|var)\n)\n\\s+\n(\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + }, + }, + { + begin: '((@)typedef)\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + { + name: 'entity.name.type.instance.jsdoc', + match: '(?:[^@\\s*/]|\\*[^/])+', + }, + ], + }, + { + begin: '((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + { + name: 'variable.other.jsdoc', + match: '([A-Za-z_$][\\w$.\\[\\]]*)', + }, + { + name: 'variable.other.jsdoc', + match: "(?x)\n(\\[)\\s*\n[\\w$]+\n(?:\n (?:\\[\\])? # Foo[ ].bar properties within an array\n \\. # Foo.Bar namespaced parameter\n [\\w$]+\n)*\n(?:\n \\s*\n (=) # [foo=bar] Default parameter value\n \\s*\n (\n # The inner regexes are to stop the match early at */ and to not stop at escaped quotes\n (?>\n \"(?:(?:\\*(?!/))|(?:\\\\(?!\"))|[^*\\\\])*?\" | # [foo=\"bar\"] Double-quoted\n '(?:(?:\\*(?!/))|(?:\\\\(?!'))|[^*\\\\])*?' | # [foo='bar'] Single-quoted\n \\[ (?:(?:\\*(?!/))|[^*])*? \\] | # [foo=[1,2]] Array literal\n (?:(?:\\*(?!/))|\\s(?!\\s*\\])|\\[.*?(?:\\]|(?=\\*/))|[^*\\s\\[\\]])* # Everything else\n )*\n )\n)?\n\\s*(?:(\\])((?:[^*\\s]|\\*[^\\s/])+)?|(?=\\*/))", + captures: { + '1': { + name: 'punctuation.definition.optional-value.begin.bracket.square.jsdoc', + }, + '2': { + name: 'keyword.operator.assignment.jsdoc', + }, + '3': { + name: 'source.embedded.tsx', + }, + '4': { + name: 'punctuation.definition.optional-value.end.bracket.square.jsdoc', + }, + '5': { + name: 'invalid.illegal.syntax.jsdoc', + }, + }, + }, + ], + }, + { + begin: '(?x)\n(\n (@)\n (?:define|enum|exception|export|extends|lends|implements|modifies\n |namespace|private|protected|returns?|satisfies|suppress|this|throws|type\n |yields?)\n)\n\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + ], + }, + { + match: '(?x)\n(\n (@)\n (?:alias|augments|callback|constructs|emits|event|fires|exports?\n |extends|external|function|func|host|lends|listens|interface|memberof!?\n |method|module|mixes|mixin|name|requires|see|this|typedef|uses)\n)\n\\s+\n(\n (?:\n [^{}@\\s*] | \\*[^/]\n )+\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'entity.name.type.instance.jsdoc', + }, + }, + }, + { + contentName: 'variable.other.jsdoc', + begin: "((@)(?:default(?:value)?|license|version))\\s+(([''\"]))", + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + '4': { + name: 'punctuation.definition.string.begin.jsdoc', + }, + }, + end: '(\\3)|(?=$|\\*/)', + endCaptures: { + '0': { + name: 'variable.other.jsdoc', + }, + '1': { + name: 'punctuation.definition.string.end.jsdoc', + }, + }, + }, + { + match: '((@)(?:default(?:value)?|license|tutorial|variation|version))\\s+([^\\s*]+)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + }, + }, + { + name: 'storage.type.class.jsdoc', + match: '(?x) (@) (?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles |callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright |default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception |exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func |function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc |inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method |mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects |override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected |public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary |suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation |version|virtual|writeOnce|yields?) \\b', + captures: { + '1': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + }, + { + include: '#inline-tags', + }, + { + match: '((@)(?:[_$[:alpha:]][_$[:alnum:]]*))(?=\\s+)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + }, + ], + }, + brackets: { + patterns: [ + { + begin: '{', + end: '}|(?=\\*/)', + patterns: [ + { + include: '#brackets', + }, + ], + }, + { + begin: '\\[', + end: '\\]|(?=\\*/)', + patterns: [ + { + include: '#brackets', + }, + ], + }, + ], + }, + 'inline-tags': { + patterns: [ + { + name: 'constant.other.description.jsdoc', + match: '(\\[)[^\\]]+(\\])(?={@(?:link|linkcode|linkplain|tutorial))', + captures: { + '1': { + name: 'punctuation.definition.bracket.square.begin.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.square.end.jsdoc', + }, + }, + }, + { + name: 'entity.name.type.instance.jsdoc', + begin: '({)((@)(?:link(?:code|plain)?|tutorial))\\s*', + beginCaptures: { + '1': { + name: 'punctuation.definition.bracket.curly.begin.jsdoc', + }, + '2': { + name: 'storage.type.class.jsdoc', + }, + '3': { + name: 'punctuation.definition.inline.tag.jsdoc', + }, + }, + end: '}|(?=\\*/)', + endCaptures: { + '0': { + name: 'punctuation.definition.bracket.curly.end.jsdoc', + }, + }, + patterns: [ + { + match: '\\G((?=https?://)(?:[^|}\\s*]|\\*[/])+)(\\|)?', + captures: { + '1': { + name: 'variable.other.link.underline.jsdoc', + }, + '2': { + name: 'punctuation.separator.pipe.jsdoc', + }, + }, + }, + { + match: '\\G((?:[^{}@\\s|*]|\\*[^/])+)(\\|)?', + captures: { + '1': { + name: 'variable.other.description.jsdoc', + }, + '2': { + name: 'punctuation.separator.pipe.jsdoc', + }, + }, + }, + ], + }, + ], + }, + jsdoctype: { + patterns: [ + { + contentName: 'entity.name.type.instance.jsdoc', + begin: '\\G({)', + beginCaptures: { + '0': { + name: 'entity.name.type.instance.jsdoc', + }, + '1': { + name: 'punctuation.definition.bracket.curly.begin.jsdoc', + }, + }, + end: '((}))\\s*|(?=\\*/)', + endCaptures: { + '1': { + name: 'entity.name.type.instance.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.curly.end.jsdoc', + }, + }, + patterns: [ + { + include: '#brackets', + }, + ], + }, + ], + }, + jsx: { + patterns: [ + { + include: '#jsx-tag-without-attributes-in-expression', + }, + { + include: '#jsx-tag-in-expression', + }, + ], + }, + 'jsx-tag-without-attributes-in-expression': { + begin: '(?:*]|&&|\\|\\||\\?|\\*\\/|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^default|[^\\._$[:alnum:]]default|^yield|[^\\._$[:alnum:]]yield|^)\\s*(?=(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))', + end: '(?!(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))', + patterns: [ + { + include: '#jsx-tag-without-attributes', + }, + ], + }, + 'jsx-tag-without-attributes': { + name: 'meta.tag.without-attributes.tsx', + begin: '(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?)', + end: '()', + beginCaptures: { + '1': { + name: 'punctuation.definition.tag.begin.tsx', + }, + '2': { + name: 'entity.name.tag.namespace.tsx', + }, + '3': { + name: 'punctuation.separator.namespace.tsx', + }, + '4': { + name: 'entity.name.tag.tsx', + }, + '5': { + name: 'support.class.component.tsx', + }, + '6': { + name: 'punctuation.definition.tag.end.tsx', + }, + }, + endCaptures: { + '1': { + name: 'punctuation.definition.tag.begin.tsx', + }, + '2': { + name: 'entity.name.tag.namespace.tsx', + }, + '3': { + name: 'punctuation.separator.namespace.tsx', + }, + '4': { + name: 'entity.name.tag.tsx', + }, + '5': { + name: 'support.class.component.tsx', + }, + '6': { + name: 'punctuation.definition.tag.end.tsx', + }, + }, + contentName: 'meta.jsx.children.tsx', + patterns: [ + { + include: '#jsx-children', + }, + ], + }, + 'jsx-tag-in-expression': { + begin: '(?x)\n (?:*]|&&|\\|\\||\\?|\\*\\/|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^default|[^\\._$[:alnum:]]default|^yield|[^\\._$[:alnum:]]yield|^)\\s*\n (?!<\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s+[^=>])|,)) # look ahead is not type parameter of arrow\n (?=(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))', + end: '(?!(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))', + patterns: [ + { + include: '#jsx-tag', + }, + ], + }, + 'jsx-tag': { + name: 'meta.tag.tsx', + begin: '(?=(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))', + end: '(/>)|(?:())', + endCaptures: { + '1': { + name: 'punctuation.definition.tag.end.tsx', + }, + '2': { + name: 'punctuation.definition.tag.begin.tsx', + }, + '3': { + name: 'entity.name.tag.namespace.tsx', + }, + '4': { + name: 'punctuation.separator.namespace.tsx', + }, + '5': { + name: 'entity.name.tag.tsx', + }, + '6': { + name: 'support.class.component.tsx', + }, + '7': { + name: 'punctuation.definition.tag.end.tsx', + }, + }, + patterns: [ + { + begin: '(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?)', + beginCaptures: { + '1': { + name: 'punctuation.definition.tag.begin.tsx', + }, + '2': { + name: 'entity.name.tag.namespace.tsx', + }, + '3': { + name: 'punctuation.separator.namespace.tsx', + }, + '4': { + name: 'entity.name.tag.tsx', + }, + '5': { + name: 'support.class.component.tsx', + }, + }, + end: '(?=[/]?>)', + patterns: [ + { + include: '#comment', + }, + { + include: '#type-arguments', + }, + { + include: '#jsx-tag-attributes', + }, + ], + }, + { + begin: '(>)', + beginCaptures: { + '1': { + name: 'punctuation.definition.tag.end.tsx', + }, + }, + end: '(?=)', + patterns: [ + { + include: '#comment', + }, + { + include: '#jsx-tag-attribute-name', + }, + { + include: '#jsx-tag-attribute-assignment', + }, + { + include: '#jsx-string-double-quoted', + }, + { + include: '#jsx-string-single-quoted', + }, + { + include: '#jsx-evaluated-code', + }, + { + include: '#jsx-tag-attributes-illegal', + }, + ], + }, + 'jsx-tag-attribute-name': { + match: '(?x)\n \\s*\n (?:([_$[:alpha:]][-_$[:alnum:].]*)(:))?\n ([_$[:alpha:]][-_$[:alnum:]]*)\n (?=\\s|=|/?>|/\\*|//)', + captures: { + '1': { + name: 'entity.other.attribute-name.namespace.tsx', + }, + '2': { + name: 'punctuation.separator.namespace.tsx', + }, + '3': { + name: 'entity.other.attribute-name.tsx', + }, + }, + }, + 'jsx-tag-attribute-assignment': { + name: 'keyword.operator.assignment.tsx', + match: "=(?=\\s*(?:'|\"|{|/\\*|//|\\n))", + }, + 'jsx-string-double-quoted': { + name: 'string.quoted.double.tsx', + begin: '"', + end: '"', + beginCaptures: { + '0': { + name: 'punctuation.definition.string.begin.tsx', + }, + }, + endCaptures: { + '0': { + name: 'punctuation.definition.string.end.tsx', + }, + }, + patterns: [ + { + include: '#jsx-entities', + }, + ], + }, + 'jsx-string-single-quoted': { + name: 'string.quoted.single.tsx', + begin: "'", + end: "'", + beginCaptures: { + '0': { + name: 'punctuation.definition.string.begin.tsx', + }, + }, + endCaptures: { + '0': { + name: 'punctuation.definition.string.end.tsx', + }, + }, + patterns: [ + { + include: '#jsx-entities', + }, + ], + }, + 'jsx-tag-attributes-illegal': { + name: 'invalid.illegal.attribute.tsx', + match: '\\S+', + }, + }, + }, + grammarLocation: './syntaxes/TypeScriptReact.tmLanguage.json', + injectTo: undefined, + embeddedLanguages: { + 'meta.tag.tsx': 'jsx-tags', + 'meta.tag.without-attributes.tsx': 'jsx-tags', + 'meta.tag.attributes.tsx': 'typescriptreact', + 'meta.embedded.expression.tsx': 'typescriptreact', + }, + tokenTypes: { + 'meta.template.expression': 'other', + 'meta.template.expression string': 'string', + 'meta.template.expression comment': 'comment', + 'entity.name.type.instance.jsdoc': 'other', + 'entity.name.function.tagged-template': 'other', + 'meta.import string.quoted': 'other', + 'variable.other.jsdoc': 'other', + }, + }, { - "command": "simpleBrowser.show", - "title": "Show", - "category": "Simple Browser" - } + language: undefined, + scope: 'documentation.injection.ts', + format: 'json', + grammar: { + injectionSelector: 'L:comment.block.documentation', + patterns: [ + { + include: '#jsdocbody', + }, + ], + repository: { + jsdocbody: { + begin: '(?<=/\\*\\*)([^*]|\\*(?!/))*$', + while: '(^|\\G)\\s*\\*(?!/)(?=([^*]|[*](?!/))*$)', + patterns: [ + { + include: 'source.ts#docblock', + }, + ], + }, + }, + scopeName: 'documentation.injection.ts', + }, + grammarLocation: './syntaxes/jsdoc.ts.injection.tmLanguage.json', + injectTo: [ + 'source.ts', + 'source.tsx', + ], + embeddedLanguages: undefined, + tokenTypes: undefined, + }, + { + language: undefined, + scope: 'documentation.injection.js.jsx', + format: 'json', + grammar: { + injectionSelector: 'L:comment.block.documentation', + patterns: [ + { + include: '#jsdocbody', + }, + ], + repository: { + jsdocbody: { + begin: '(?<=/\\*\\*)([^*]|\\*(?!/))*$', + while: '(^|\\G)\\s*\\*(?!/)(?=([^*]|[*](?!/))*$)', + patterns: [ + { + include: 'source.ts#docblock', + }, + ], + }, + }, + scopeName: 'documentation.injection.js.jsx', + }, + grammarLocation: './syntaxes/jsdoc.js.injection.tmLanguage.json', + injectTo: [ + 'source.js', + 'source.js.jsx', + ], + embeddedLanguages: undefined, + tokenTypes: undefined, + }, + ], + problemMatchers: undefined, + problemPatterns: undefined, + resourceLabelFormatters: undefined, + authentication: undefined, + notebooks: undefined, + snippets: [ + { + language: 'typescript', + source: 'TypeScript Language Basics (built-in)', + uri: 'file:///home/user/theia/theia/plugins/ts-base/extension/snippets/typescript.code-snippets', + }, + { + language: 'typescriptreact', + source: 'TypeScript Language Basics (built-in)', + uri: 'file:///home/user/theia/theia/plugins/ts-base/extension/snippets/typescript.code-snippets', + }, ], - "configuration": [ - { - "title": "Simple Browser", - "properties": { - "simpleBrowser.focusLockIndicator.enabled": { - "type": "boolean", - "default": true, - "title": "Focus Lock Indicator Enabled", - "description": "%configuration.focusLockIndicator.enabled.description%" - } - } - } - ] + themes: undefined, + iconThemes: undefined, + colors: undefined, + localizations: undefined, + terminalProfiles: undefined, }, }, ]; diff --git a/examples/browser-only/package.json b/examples/browser-only/package.json index 4decd9691fd0f..02e92a459cb83 100644 --- a/examples/browser-only/package.json +++ b/examples/browser-only/package.json @@ -15,7 +15,10 @@ } }, "theiaPluginsDir": "plugins", - "theiaPlugins": {}, + "theiaPlugins": { + "vscode.typescript": "https://open-vsx.org/api/vscode/typescript/1.95.3/file/vscode.typescript-1.95.3.vsix", + "vscode.typescript-language-features": "https://open-vsx.org/api/vscode/typescript-language-features/1.95.3/file/vscode.typescript-language-features-1.95.3.vsix" + }, "dependencies": { "@theia/ai-chat": "1.54.0", "@theia/ai-chat-ui": "1.54.0", From a46f21415a3da1f76240043f7bf3895a9c61ce5f Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Mon, 27 Jan 2025 13:20:06 +0100 Subject: [PATCH 24/36] Update commands in ADOPTING.md and package.json to use npm --- ADOPTING.md | 4 ++-- examples/browser-only/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ADOPTING.md b/ADOPTING.md index 1aa0be19969e0..3ba72ebc8d7bb 100644 --- a/ADOPTING.md +++ b/ADOPTING.md @@ -11,9 +11,9 @@ When it comes to extension support, there are some restrictions to consider: There are two ways to retrieve extensions: 1. VSIX packages: Copy the `.vsix` files to the directory specified in the `package.json` file by the `theiaPluginsDir` property. (e.g. `"theiaPluginsDir": "plugins"`) 2. Open VSX Link: Specify a list of `id:link` mappings in the `package.json` file by the `theiaPlugins` property (e.g. `"theiaPlugins": { "vscodevim.vim": "https://open-vsx.org/api/vscodevim/vim/1.29.0/file/vscodevim.vim-1.29.0.vsix" }`). Extensions can be found on the [Open VSX Registry](https://open-vsx.org/) by searching for the extension and copying the link linked to the Download button. -When using the command `yarn download:plugins`, Theia will download the `.vsix` files from the specified links and install them in the directory specified by the `theiaPluginsDir` property. +When using the command `npm run download:plugins`, Theia will download the `.vsix` files from the specified links and install them in the directory specified by the `theiaPluginsDir` property. -After the extensions are downloaded, they need be packaged into the Theia Browser-Only application. To do this, run the command `yarn package:plugins` which in turn will run the [script](examples/browser-only/prepare-plugins.js) to unpack the `.vsix` files and copy the contents to the `lib/frontend/hostedPlugin` directory. +After the extensions are downloaded, they need be packaged into the Theia Browser-Only application. To do this, run the command `npm run package:plugins` which in turn will run the [script](examples/browser-only/prepare-plugins.js) to unpack the `.vsix` files and copy the contents to the `lib/frontend/hostedPlugin` directory. As Theia need to know which extensions are available, the `pluginMetadata` inside the `PluginLocalOptions` needs to be updated with the metadata of the extensions. This can be achieved by specifying the metadata and binding it to `PluginLocalOptions` (see this [example initialization](examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts)). diff --git a/examples/browser-only/package.json b/examples/browser-only/package.json index aeff7b09a3dea..1418f1c223b54 100644 --- a/examples/browser-only/package.json +++ b/examples/browser-only/package.json @@ -77,7 +77,7 @@ "scripts": { "prepare:no-native": "lerna run prepare --scope=\"@theia/re-exports\" && lerna run generate-theia-re-exports --scope=\"@theia/core\"", "clean": "theia clean", - "build": "theiaext build && yarn package:plugins && npm run -s bundle", + "build": "theiaext build && npm run package:plugins && npm run -s bundle", "bundle": "theia build --mode development", "download:plugins": "theia download:plugins", "package:plugins": "node ./prepare-plugins.js", From 26837bfa82f5ef6fbc34c225b5b9df5fa3b22d41 Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Mon, 27 Jan 2025 13:24:00 +0100 Subject: [PATCH 25/36] Code cleanup --- .../filesystem/src/browser-only/opfs-filesystem-provider.ts | 4 ++++ .../src/hosted/browser-only/frontend-hosted-plugin-server.ts | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/filesystem/src/browser-only/opfs-filesystem-provider.ts b/packages/filesystem/src/browser-only/opfs-filesystem-provider.ts index 7005c2092f287..51556154e53a5 100644 --- a/packages/filesystem/src/browser-only/opfs-filesystem-provider.ts +++ b/packages/filesystem/src/browser-only/opfs-filesystem-provider.ts @@ -143,6 +143,7 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri throw toFileSystemProviderError(error, true); } } + async delete(resource: URI, _opts: FileDeleteOptions): Promise { await this.initialized; try { @@ -159,6 +160,7 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri this.onDidChangeFileEmitter.fire([{ resource, type: FileChangeType.DELETED }]); } } + async rename(from: URI, to: URI, opts: FileOverwriteOptions): Promise { await this.initialized; @@ -184,6 +186,7 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri throw toFileSystemProviderError(error); } } + async readFile(resource: URI): Promise { await this.initialized; @@ -201,6 +204,7 @@ export class OPFSFileSystemProvider implements FileSystemProviderWithFileReadWri throw toFileSystemProviderError(error, false); } } + async writeFile(resource: URI, content: Uint8Array, opts: FileWriteOptions): Promise { await this.initialized; let writeableHandle: FileSystemWritableFileStream | undefined = undefined; diff --git a/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts b/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts index 7e4ef5ef180a6..5299ea8f4aaf4 100644 --- a/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts +++ b/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts @@ -32,7 +32,6 @@ export class FrontendHostedPluginServer implements HostedPluginServer, RpcConnec protected readonly options: PluginLocalOptions; async getDeployedPluginIds(): Promise { - console.log('getDeployedPluginIds'); // Use the plugin metadata to build the correct plugin id return this.options.pluginMetadata.map(p => PluginIdentifiers.componentsToVersionedId(p.metadata.model)); } @@ -41,7 +40,6 @@ export class FrontendHostedPluginServer implements HostedPluginServer, RpcConnec } async getDeployedPlugins(params: GetDeployedPluginsParams): Promise { - console.log('getDeployedPlugins'); return this.options.pluginMetadata.filter(p => params.pluginIds.includes(PluginIdentifiers.componentsToVersionedId(p.metadata.model))); } From 3394ee32dcbdfc341206fee4ca804693b8aee2d5 Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Mon, 27 Jan 2025 14:54:20 +0100 Subject: [PATCH 26/36] Fix linting error --- .../src/browser-only/terminal-frontend-only-contribution.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/terminal/src/browser-only/terminal-frontend-only-contribution.ts b/packages/terminal/src/browser-only/terminal-frontend-only-contribution.ts index 8726ff29b4328..54c4a3de6a5db 100644 --- a/packages/terminal/src/browser-only/terminal-frontend-only-contribution.ts +++ b/packages/terminal/src/browser-only/terminal-frontend-only-contribution.ts @@ -17,7 +17,7 @@ import { injectable } from '@theia/core/shared/inversify'; import { TerminalService } from '../browser/base/terminal-service'; import { Event, Emitter } from '@theia/core'; -import { WidgetOpenerOptions } from '@theia/core/src/browser'; +import { WidgetOpenerOptions } from '@theia/core/lib/browser'; import { TerminalWidgetOptions, TerminalWidget } from '../browser/base/terminal-widget'; @injectable() @@ -52,11 +52,11 @@ export class TerminalFrontendOnlyContribution implements TerminalService { } getById(id: string): TerminalWidget | undefined { - return undefined + return undefined; } getByTerminalId(terminalId: number): TerminalWidget | undefined { - return undefined + return undefined; } async getDefaultShell(): Promise { From 6cacac481e428d7281ed98f1d5d6cf3bb08698f5 Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Mon, 27 Jan 2025 15:20:37 +0100 Subject: [PATCH 27/36] More linting fixes --- examples/api-samples/.eslintrc.js | 3 +++ .../example-plugin-initialization.ts | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/examples/api-samples/.eslintrc.js b/examples/api-samples/.eslintrc.js index 13089943582b6..3483c3f33c01e 100644 --- a/examples/api-samples/.eslintrc.js +++ b/examples/api-samples/.eslintrc.js @@ -3,6 +3,9 @@ module.exports = { extends: [ '../../configs/build.eslintrc.json' ], + ignores: [ + "./src/browser-only/plugin-sample/example-static-plugin-metadata.ts" // Ignoring this file as it only contains static metadata + ], parserOptions: { tsconfigRootDir: __dirname, project: 'tsconfig.json' diff --git a/examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts b/examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts index f2238d8de85d3..7b67bd5b0fb8c 100644 --- a/examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts +++ b/examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts @@ -1,8 +1,23 @@ +// ***************************************************************************** +// Copyright (C) 2023 EclipseSource and others. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// **************************************************************************** + import { interfaces } from '@theia/core/shared/inversify'; import { PluginLocalOptions } from '@theia/plugin-ext/lib/hosted/browser-only/frontend-hosted-plugin-server'; import { staticMetadata } from './example-static-plugin-metadata'; - export const bindPluginInitialization = (bind: interfaces.Bind, rebind: interfaces.Rebind): void => { const pluginLocalOptions = { pluginMetadata: staticMetadata, From 42be38e8631353d1fdd10ba3eb8d1d0ad710cf1d Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Mon, 27 Jan 2025 16:50:53 +0100 Subject: [PATCH 28/36] Ignore metadata file for linting --- examples/api-samples/.eslintrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/api-samples/.eslintrc.js b/examples/api-samples/.eslintrc.js index 3483c3f33c01e..8e04303b17de1 100644 --- a/examples/api-samples/.eslintrc.js +++ b/examples/api-samples/.eslintrc.js @@ -3,7 +3,7 @@ module.exports = { extends: [ '../../configs/build.eslintrc.json' ], - ignores: [ + ignorePatterns: [ "./src/browser-only/plugin-sample/example-static-plugin-metadata.ts" // Ignoring this file as it only contains static metadata ], parserOptions: { From d4b40fb5c6e49b1d46085721b8aee67c569afa3f Mon Sep 17 00:00:00 2001 From: Robert Jandow <38583713+robertjndw@users.noreply.github.com> Date: Fri, 31 Jan 2025 14:15:22 +0100 Subject: [PATCH 29/36] Apply suggestions to ADOPTING.md from review Co-authored-by: Stefan Dirix --- ADOPTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ADOPTING.md b/ADOPTING.md index 3ba72ebc8d7bb..0ffc0c49fd800 100644 --- a/ADOPTING.md +++ b/ADOPTING.md @@ -11,9 +11,9 @@ When it comes to extension support, there are some restrictions to consider: There are two ways to retrieve extensions: 1. VSIX packages: Copy the `.vsix` files to the directory specified in the `package.json` file by the `theiaPluginsDir` property. (e.g. `"theiaPluginsDir": "plugins"`) 2. Open VSX Link: Specify a list of `id:link` mappings in the `package.json` file by the `theiaPlugins` property (e.g. `"theiaPlugins": { "vscodevim.vim": "https://open-vsx.org/api/vscodevim/vim/1.29.0/file/vscodevim.vim-1.29.0.vsix" }`). Extensions can be found on the [Open VSX Registry](https://open-vsx.org/) by searching for the extension and copying the link linked to the Download button. -When using the command `npm run download:plugins`, Theia will download the `.vsix` files from the specified links and install them in the directory specified by the `theiaPluginsDir` property. +When using the Theia CLI command `theia download:plugins`, the Theia CLI will download the `.vsix` files from the specified links and install them in the directory specified by the `theiaPluginsDir` property. -After the extensions are downloaded, they need be packaged into the Theia Browser-Only application. To do this, run the command `npm run package:plugins` which in turn will run the [script](examples/browser-only/prepare-plugins.js) to unpack the `.vsix` files and copy the contents to the `lib/frontend/hostedPlugin` directory. +After the extensions are downloaded, they need to be packaged into the Theia Browser-Only application. To do this, run the command `npm run package:plugins` which in turn will run the [script](examples/browser-only/prepare-plugins.js) to unpack the `.vsix` files and copy the contents to the `lib/frontend/hostedPlugin` directory. As Theia need to know which extensions are available, the `pluginMetadata` inside the `PluginLocalOptions` needs to be updated with the metadata of the extensions. This can be achieved by specifying the metadata and binding it to `PluginLocalOptions` (see this [example initialization](examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts)). From fff759b80063db4e5a91d975009c6716061bb8ae Mon Sep 17 00:00:00 2001 From: Robert Jandow <38583713+robertjndw@users.noreply.github.com> Date: Fri, 31 Jan 2025 14:21:52 +0100 Subject: [PATCH 30/36] Update packages/terminal/src/browser-only/terminal-frontend-only-module.ts to remove unnecessary imports Co-authored-by: Stefan Dirix --- .../terminal/src/browser-only/terminal-frontend-only-module.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/terminal/src/browser-only/terminal-frontend-only-module.ts b/packages/terminal/src/browser-only/terminal-frontend-only-module.ts index 0f817358971d9..095b6810bc310 100644 --- a/packages/terminal/src/browser-only/terminal-frontend-only-module.ts +++ b/packages/terminal/src/browser-only/terminal-frontend-only-module.ts @@ -14,8 +14,6 @@ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 // ***************************************************************************** -import '../../src/browser/style/terminal.css'; -import 'xterm/css/xterm.css'; import { ContainerModule } from '@theia/core/shared/inversify'; import { TerminalFrontendOnlyContribution } from './terminal-frontend-only-contribution'; From ec01e70d87ce863dc861c3c9dd4ba71a5b2c9230 Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Fri, 31 Jan 2025 14:25:26 +0100 Subject: [PATCH 31/36] Update copyright information --- examples/browser-only/prepare-plugins.js | 16 ++++++++++++++++ .../terminal-frontend-only-contribution.ts | 2 +- .../terminal-frontend-only-module.ts | 3 +-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/examples/browser-only/prepare-plugins.js b/examples/browser-only/prepare-plugins.js index 7a9dc2d561142..666cc28249a3b 100644 --- a/examples/browser-only/prepare-plugins.js +++ b/examples/browser-only/prepare-plugins.js @@ -1,3 +1,19 @@ +// ***************************************************************************** +// Copyright (C) 2024 robertjndw +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// ***************************************************************************** + const { promisify } = require('util'); const glob = promisify(require('glob')); const fs = require('fs').promises; diff --git a/packages/terminal/src/browser-only/terminal-frontend-only-contribution.ts b/packages/terminal/src/browser-only/terminal-frontend-only-contribution.ts index 54c4a3de6a5db..637978392af77 100644 --- a/packages/terminal/src/browser-only/terminal-frontend-only-contribution.ts +++ b/packages/terminal/src/browser-only/terminal-frontend-only-contribution.ts @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright (C) 2017 TypeFox and others. +// Copyright (C) 2024 robertjndw // // This program and the accompanying materials are made available under the // terms of the Eclipse Public License v. 2.0 which is available at diff --git a/packages/terminal/src/browser-only/terminal-frontend-only-module.ts b/packages/terminal/src/browser-only/terminal-frontend-only-module.ts index 095b6810bc310..1cca0d9148a55 100644 --- a/packages/terminal/src/browser-only/terminal-frontend-only-module.ts +++ b/packages/terminal/src/browser-only/terminal-frontend-only-module.ts @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright (C) 2017 TypeFox and others. +// Copyright (C) 2024 robertjndw // // This program and the accompanying materials are made available under the // terms of the Eclipse Public License v. 2.0 which is available at @@ -14,7 +14,6 @@ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 // ***************************************************************************** - import { ContainerModule } from '@theia/core/shared/inversify'; import { TerminalFrontendOnlyContribution } from './terminal-frontend-only-contribution'; import { TerminalService } from '../browser/base/terminal-service'; From 0b004542d06911734d78004e825395df175b2a2d Mon Sep 17 00:00:00 2001 From: Robert Jandow <38583713+robertjndw@users.noreply.github.com> Date: Fri, 31 Jan 2025 14:36:49 +0100 Subject: [PATCH 32/36] Remove backendinit from example-static-plugin-metadata.ts --- .../plugin-sample/example-static-plugin-metadata.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/api-samples/src/browser-only/plugin-sample/example-static-plugin-metadata.ts b/examples/api-samples/src/browser-only/plugin-sample/example-static-plugin-metadata.ts index c0a4b654e5746..62242fd4a227c 100644 --- a/examples/api-samples/src/browser-only/plugin-sample/example-static-plugin-metadata.ts +++ b/examples/api-samples/src/browser-only/plugin-sample/example-static-plugin-metadata.ts @@ -44,7 +44,6 @@ export const staticMetadata: any[] = [ stopMethod: 'deactivate', frontendModuleName: 'vscode_typescript_language_features', frontendInitPath: 'plugin-vscode-init-fe.js', - backendInitPath: '/home/user/theia/examples/browser/lib/backend/plugin-vscode-init', }, outOfSync: false, isUnderDevelopment: false, @@ -1622,7 +1621,6 @@ export const staticMetadata: any[] = [ stopMethod: 'deactivate', frontendModuleName: 'vscode_typescript', frontendInitPath: 'plugin-vscode-init-fe.js', - backendInitPath: '/home/user/theia/examples/browser/lib/backend/plugin-vscode-init', }, outOfSync: false, isUnderDevelopment: false, From e35cbc97e24e76d6a71890b8da35f927c7103525 Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Fri, 31 Jan 2025 14:37:53 +0100 Subject: [PATCH 33/36] Remove backendInitPath from ADOPTING.md --- ADOPTING.md | 1 - 1 file changed, 1 deletion(-) diff --git a/ADOPTING.md b/ADOPTING.md index 0ffc0c49fd800..edc724874a463 100644 --- a/ADOPTING.md +++ b/ADOPTING.md @@ -66,7 +66,6 @@ metadata: { 'stopMethod': 'deactivate', // the method to call when the extension is deactivated; typically 'deactivate' for VS Code extensions and 'stop' for Theia plugins 'frontendModuleName': 'theia_helloworld_web_sample', // the id specified above but with underscores instead of dots and dashes similar to iconUrl, readmeUrl, and licenseUrl 'frontendInitPath': 'plugin-vscode-init-fe.js', // the path to the frontend initialization script; only required for VS Code extensions - 'backendInitPath': '/Users/user/theia/examples/browser/lib/backend/plugin-vscode-init' // the path to the backend initialization script; for Theia plugins, this path ends with 'backend-init-theia' }, 'outOfSync': false, // should always be set to false 'isUnderDevelopment': false // should always be set to false From 358f37ac197a153daaa428017d9816e44213f30b Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Fri, 31 Jan 2025 18:41:13 +0100 Subject: [PATCH 34/36] Clarify the process for unpacking and installing extensions in ADOPTING.md --- ADOPTING.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ADOPTING.md b/ADOPTING.md index edc724874a463..32ec973c4c8ed 100644 --- a/ADOPTING.md +++ b/ADOPTING.md @@ -13,7 +13,13 @@ There are two ways to retrieve extensions: 2. Open VSX Link: Specify a list of `id:link` mappings in the `package.json` file by the `theiaPlugins` property (e.g. `"theiaPlugins": { "vscodevim.vim": "https://open-vsx.org/api/vscodevim/vim/1.29.0/file/vscodevim.vim-1.29.0.vsix" }`). Extensions can be found on the [Open VSX Registry](https://open-vsx.org/) by searching for the extension and copying the link linked to the Download button. When using the Theia CLI command `theia download:plugins`, the Theia CLI will download the `.vsix` files from the specified links and install them in the directory specified by the `theiaPluginsDir` property. -After the extensions are downloaded, they need to be packaged into the Theia Browser-Only application. To do this, run the command `npm run package:plugins` which in turn will run the [script](examples/browser-only/prepare-plugins.js) to unpack the `.vsix` files and copy the contents to the `lib/frontend/hostedPlugin` directory. +After the extensions are downloaded, they need to be unpacked and placed in the **`lib/frontend/hostedPlugin`** directory so that they can be used by Theia Browser-Only. + +To achieve this, the `.vsix` files must be extracted, and their contents copied into the correct directory structure. This process involves: +1. Unpacking the `.vsix` files. +2. Copying the extracted contents into the **`lib/frontend/hostedPlugin`** directory. Make sure to copy the `extension` folder from the VSIX file and name it according to the extension's id (typically the publisher name and the extension name separated by a dot). + +This process can be automated using a script. For an example implementation, you can refer to the [prepare-plugins.js script](examples/browser-only/prepare-plugins.js), which demonstrates how to extract and place the `.vsix` files in the appropriate location. As Theia need to know which extensions are available, the `pluginMetadata` inside the `PluginLocalOptions` needs to be updated with the metadata of the extensions. This can be achieved by specifying the metadata and binding it to `PluginLocalOptions` (see this [example initialization](examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts)). From 17f38719e5b64ef45f406fef72d834447197c82d Mon Sep 17 00:00:00 2001 From: Robert Jandow Date: Fri, 31 Jan 2025 18:41:19 +0100 Subject: [PATCH 35/36] Add check to skip existing plugin directories in prepare-plugins.js --- examples/browser-only/prepare-plugins.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/browser-only/prepare-plugins.js b/examples/browser-only/prepare-plugins.js index 666cc28249a3b..e24720a307e53 100644 --- a/examples/browser-only/prepare-plugins.js +++ b/examples/browser-only/prepare-plugins.js @@ -34,7 +34,12 @@ async function run() { const pluginName = path.basename(path.dirname(pluginExtensionPath)).replace(/[.\-]/g, '_'); const targetDir = path.join('lib', 'frontend', 'hostedPlugin', pluginName); - // Ensure the target directory exists. + // When the directory exists, skip it + if (fs.existsSync(targetDir)) { + console.log(`Plugin ${pluginName} already prepared. Skipping.`); + continue; + } + // Ensure the target directory exists when not already present. await fs.mkdir(targetDir, { recursive: true }); // Copy the content of the `extension` folder to the target directory. From 4c9fe81611cf7cb82413b594e6324aecf28deef8 Mon Sep 17 00:00:00 2001 From: Robert Jandow <38583713+robertjndw@users.noreply.github.com> Date: Sat, 1 Feb 2025 00:52:30 +0100 Subject: [PATCH 36/36] Fix prepare-plugins.js --- examples/browser-only/prepare-plugins.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/browser-only/prepare-plugins.js b/examples/browser-only/prepare-plugins.js index e24720a307e53..ee30df0f35441 100644 --- a/examples/browser-only/prepare-plugins.js +++ b/examples/browser-only/prepare-plugins.js @@ -16,12 +16,13 @@ const { promisify } = require('util'); const glob = promisify(require('glob')); -const fs = require('fs').promises; +const fs = require('fs'); +const fsp = require('fs').promises; const path = require('path'); async function run() { // Resolve the `package.json` at the current working directory. - const pck = JSON.parse(await fs.readFile(path.resolve('package.json'), 'utf8')); + const pck = JSON.parse(await fsp.readFile(path.resolve('package.json'), 'utf8')); // Resolve the directory for which to download the plugins. const pluginsDir = pck.theiaPluginsDir || 'extension'; @@ -40,7 +41,7 @@ async function run() { continue; } // Ensure the target directory exists when not already present. - await fs.mkdir(targetDir, { recursive: true }); + await fsp.mkdir(targetDir, { recursive: true }); // Copy the content of the `extension` folder to the target directory. const files = await glob(`${pluginExtensionPath}/**/*`, { nodir: true }); @@ -49,10 +50,10 @@ async function run() { const target = path.join(targetDir, relativePath); // Ensure the target directory structure exists. - await fs.mkdir(path.dirname(target), { recursive: true }); + await fsp.mkdir(path.dirname(target), { recursive: true }); // Copy the file. - await fs.copyFile(file, target); + await fsp.copyFile(file, target); } } }