diff --git a/browser/src/UI/components/WindowTitle.tsx b/browser/src/UI/components/WindowTitle.tsx
index bd5b8c2c2a..824bfaaa40 100644
--- a/browser/src/UI/components/WindowTitle.tsx
+++ b/browser/src/UI/components/WindowTitle.tsx
@@ -24,7 +24,7 @@ export class WindowTitleView extends React.PureComponent
{
const loadInitVim = this._configuration.getValue("oni.loadInitVim")
if (typeof loadInitVim === "string") {
return this.open(loadInitVim)
} else {
- // Use path from: https://github.com/neovim/neovim/wiki/FAQ
- const rootFolder = Platform.isWindows()
- ? path.join(process.env["LOCALAPPDATA"], "nvim") // tslint:disable-line no-string-literal
- : path.join(Platform.getUserHome(), ".config", "nvim")
-
+ const initVimPath = this.getInitVimPath()
+ const rootFolder = path.dirname(initVimPath)
mkdirp.sync(rootFolder)
- const initVimPath = path.join(rootFolder, "init.vim")
return this.open(initVimPath)
}
@@ -986,7 +1012,7 @@ export class NeovimInstance extends EventEmitter implements INeovimInstance {
shouldExtTabs: boolean,
shouldExtPopups: boolean,
) {
- if (major >= 0 && minor >= 2 && patch >= 1) {
+ if (major > 0 || minor > 2 || (minor === 2 && patch >= 1)) {
const useExtCmdLine = this._configuration.getValue("commandline.mode")
const useExtWildMenu = this._configuration.getValue("wildmenu.mode")
return {
diff --git a/browser/src/neovim/Screen.ts b/browser/src/neovim/Screen.ts
index ff434c4955..7fe7642741 100644
--- a/browser/src/neovim/Screen.ts
+++ b/browser/src/neovim/Screen.ts
@@ -149,7 +149,7 @@ export class NeovimScreen implements IScreen {
return this._currentHighlight.backgroundColor || this._backgroundColor
}
- public getCell(x: number, y: number): ICell {
+ public getCell = (x: number, y: number) => {
const cell = this._grid.getCell(x, y)
if (cell) {
diff --git a/browser/test/Services/Explorer/ExplorerFileSystemTests.ts b/browser/test/Services/Explorer/ExplorerFileSystemTests.ts
new file mode 100644
index 0000000000..15daaa1cd7
--- /dev/null
+++ b/browser/test/Services/Explorer/ExplorerFileSystemTests.ts
@@ -0,0 +1,102 @@
+import * as assert from "assert"
+import { emptyDir, mkdirp, pathExists, remove, stat, writeFile } from "fs-extra"
+import * as os from "os"
+import * as path from "path"
+
+import { FileSystem, OniFileSystem } from "./../../../src/Services/Explorer/ExplorerFileSystem"
+
+describe("File System tests", async () => {
+ let rootPath: string
+ let filePath: string
+ let secondPath: string
+ let fileSystem: FileSystem
+
+ before(async () => {
+ rootPath = path.normalize(path.join(os.tmpdir(), "a", "test", "dir"))
+ filePath = path.join(rootPath, "file.txt")
+ secondPath = path.join(rootPath, "file1.txt")
+ await mkdirp(rootPath)
+ fileSystem = OniFileSystem
+ })
+
+ beforeEach(async () => {
+ await Promise.all([
+ emptyDir(fileSystem.backupDir),
+ writeFile(filePath, "hello world"),
+ writeFile(secondPath, "file1.txt"),
+ ])
+ })
+
+ after(async () => {
+ await remove(rootPath)
+ })
+
+ it("Should return false is the file is too big to persist", async () => {
+ const canPersist = await fileSystem.canPersistNode(filePath, 1)
+ assert.ok(!canPersist)
+ })
+ it("Should return true is the file can be persisted", async () => {
+ const canPersist = await fileSystem.canPersistNode(filePath, 1000)
+ assert.ok(canPersist)
+ })
+ it("Should delete the file", async () => {
+ await fileSystem.deleteNode(secondPath)
+ try {
+ await stat(secondPath)
+ } catch (e) {
+ assert.ok(e.message.includes("ENOENT"))
+ }
+ })
+
+ it("Should persist the file", async () => {
+ await fileSystem.persistNode(secondPath)
+ const stats = await stat(path.join(fileSystem.backupDir, "file1.txt"))
+ assert.ok(stats.isFile())
+ })
+
+ it("Should move a collection of files to the correct directory", async () => {
+ const locationOne = path.join(fileSystem.backupDir, "file.txt")
+ const locationTwo = path.join(fileSystem.backupDir, "file1.txt")
+ const nodes = [
+ { source: locationOne, destination: filePath },
+ { source: locationTwo, destination: secondPath },
+ ]
+ await fileSystem.moveNodesBack(nodes)
+ const firstStats = await stat(locationOne)
+ const secondStats = await stat(locationTwo)
+ assert.ok(firstStats.isFile())
+ assert.ok(secondStats.isFile())
+ })
+
+ it("Should create a new file", async () => {
+ const newPath = path.join(rootPath, "created.txt")
+ await fileSystem.writeFile(newPath)
+ const created = await pathExists(newPath)
+ assert.ok(created)
+ })
+
+ it("Should throw an error if the filepath already exists", async () => {
+ try {
+ await fileSystem.writeFile(filePath)
+ } catch (e) {
+ assert.ok(!!e)
+ assert.ok(e.message === "This path already exists")
+ }
+ })
+
+ it("Should create a new folder", async () => {
+ const newPath = path.join(rootPath, "new_dir")
+ await fileSystem.writeFile(newPath)
+ const created = await pathExists(newPath)
+ assert.ok(created)
+ })
+
+ it("Should throw an error if the folderpath already exists", async () => {
+ try {
+ await fileSystem.mkdir(rootPath)
+ } catch (e) {
+ assert.ok(!!e)
+ assert.ok(e.message === "This path already exists")
+ }
+ })
+})
diff --git a/browser/test/Services/Explorer/ExplorerStoreTests.ts b/browser/test/Services/Explorer/ExplorerStoreTests.ts
index 8f78a83bf7..42efa76420 100644
--- a/browser/test/Services/Explorer/ExplorerStoreTests.ts
+++ b/browser/test/Services/Explorer/ExplorerStoreTests.ts
@@ -6,28 +6,127 @@ import * as assert from "assert"
import * as path from "path"
import { Store } from "redux"
+import { MockStoreCreator } from "redux-mock-store"
+import { ActionsObservable, combineEpics, createEpicMiddleware } from "redux-observable"
import * as ExplorerFileSystem from "./../../../src/Services/Explorer/ExplorerFileSystem"
+import { ExplorerNode } from "./../../../src/Services/Explorer/ExplorerSelectors"
import * as ExplorerState from "./../../../src/Services/Explorer/ExplorerStore"
+import { Notifications } from "./../../../src/Services/Notifications/Notifications"
+import * as clone from "lodash/clone"
+import * as head from "lodash/head"
import * as TestHelpers from "./../../TestHelpers"
+const configureMockStore = require("redux-mock-store") // tslint:disable-line
+
+export class MockedFileSystem implements ExplorerFileSystem.IFileSystem {
+ public promises: Array>
+
+ constructor(private _inner: ExplorerFileSystem.IFileSystem) {
+ this.promises = []
+ }
+
+ public readdir(directoryPath: string): Promise {
+ const promise = this._inner.readdir(directoryPath)
+ this.promises.push(promise)
+ return promise
+ }
+
+ public exists(fullPath: string): Promise {
+ const promise = this._inner.exists(fullPath)
+ this.promises.push(promise)
+ return promise
+ }
+
+ public async canPersistNode() {
+ return true
+ }
+
+ // tslint:disable
+ public async restoreNode() {}
+ public async persistNode() {}
+ public async moveNodesBack(): Promise {}
+ public async deleteNode(): Promise {}
+ public async move(source: string, destination: string): Promise {}
+ public async writeFile(name: string): Promise {}
+ public async mkdir(name: string): Promise {}
+ // tslint:enable
+}
+
+const rootEpic = combineEpics(ExplorerState.clearYankRegisterEpic, ExplorerState.pasteEpic)
+
+const epicMiddleware = createEpicMiddleware(rootEpic, {
+ dependencies: {
+ fileSystem: MockedFileSystem as any,
+ notifications: {} as Notifications,
+ },
+})
+
const MemoryFileSystem = require("memory-fs") // tslint:disable-line
+const mockStore: MockStoreCreator = configureMockStore([
+ epicMiddleware,
+])
describe("ExplorerStore", () => {
let fileSystem: any
let store: Store
+ let explorerFileSystem: MockedFileSystem
const rootPath = path.normalize(path.join(TestHelpers.getRootDirectory(), "a", "test", "dir"))
const filePath = path.join(rootPath, "file.txt")
+ const target = { filePath, id: "1" }
+ const epicStore = mockStore({ ...ExplorerState.DefaultExplorerState })
+
+ const pasted1 = {
+ type: "file",
+ filePath: "/test/dir/afile.txt",
+ id: "1",
+ }
+
+ const target1 = {
+ type: "folder",
+ folderPath: "/test/dir/subdir/",
+ id: "1",
+ }
+
+ const deleteAction = {
+ type: "DELETE_SUCCESS",
+ persist: true,
+ path: "/test/dir",
+ target: {
+ type: "folder",
+ folderPath: "/test/dir/subdir",
+ id: "2",
+ expanded: false,
+ name: "subdir",
+ indentationLevel: 2,
+ },
+ } as ExplorerState.IDeleteSuccessAction
+
+ const pasteAction = {
+ type: "PASTE",
+ target: target1,
+ pasted: [pasted1],
+ sources: [pasted1],
+ } as ExplorerState.IPasteAction
beforeEach(() => {
fileSystem = new MemoryFileSystem()
fileSystem.mkdirpSync(rootPath)
fileSystem.writeFileSync(filePath, "Hello World")
- const explorerFileSystem = new ExplorerFileSystem.FileSystem(fileSystem as any)
- store = ExplorerState.createStore(explorerFileSystem)
+ explorerFileSystem = new MockedFileSystem(
+ new ExplorerFileSystem.FileSystem(fileSystem as any),
+ )
+ store = ExplorerState.createStore({
+ fileSystem: explorerFileSystem,
+ notifications: {} as any,
+ })
+ })
+
+ afterEach(() => {
+ epicMiddleware.replaceEpic(rootEpic)
})
describe("SET_ROOT_DIRECTORY", () => {
@@ -38,8 +137,9 @@ describe("ExplorerStore", () => {
})
await TestHelpers.waitForAllAsyncOperations()
+ TestHelpers.tick(0) // execute setImmediate of memory-fs callbacks
+ await Promise.all(explorerFileSystem.promises)
- // At this point, the FS operations are synchronous
const state = store.getState()
assert.deepEqual(
@@ -49,4 +149,504 @@ describe("ExplorerStore", () => {
)
})
})
+
+ describe("YANK_AND_PASTE_EPICS", async () => {
+ const fs = {
+ move: async (source, dest) => null,
+ readdir: () => null as any,
+ exists: async file => true,
+ persistNode: async file => null,
+ restoreNode: async file => null,
+ deleteNode: file => null,
+ canPersistNode: async (file, size) => true,
+ moveNodesBack: async collection => null,
+ writeFile: async name => null,
+ mkdir: async name => null,
+ } as ExplorerFileSystem.IFileSystem
+
+ const notifications = {
+ _id: 0,
+ _overlay: null,
+ _overlayManager: null,
+ _store: null,
+ enable: true,
+ disable: false,
+ createItem: () => ({
+ setContents: (title: string, details: string) => ({ title, details }),
+ setLevel: (level: string) => ({ level }),
+ setExpiration: (expirationTime: number) => ({ expirationTime: 8_000 }),
+ show: () => ({}),
+ }),
+ } as any
+
+ it("dispatches a clear register action after a minute", async () => {
+ epicStore.dispatch({ type: "YANK", target })
+ const actions = epicStore.getActions()
+ await TestHelpers.waitForAllAsyncOperations()
+ // three because an init action is sent first
+ await assert.ok(actions.length === 3)
+ const clearedRegister = !!actions.find(action => action.type === "CLEAR_REGISTER")
+ assert.ok(clearedRegister)
+ })
+
+ it("should dispatch a paste success upon pasting successfully", done => {
+ const action$ = ActionsObservable.of({
+ type: "PASTE",
+ target: target1,
+ pasted: [pasted1],
+ sources: [pasted1],
+ } as ExplorerState.ExplorerAction)
+
+ const expected = [
+ { type: "CLEAR_REGISTER", ids: ["1"] },
+ { type: "EXPAND_DIRECTORY", directoryPath: target1.folderPath },
+ { type: "REFRESH" },
+ {
+ type: "PASTE_SUCCESS",
+ moved: [
+ { destination: path.join(target1.folderPath, "afile.txt"), node: pasted1 },
+ ],
+ },
+ ]
+
+ ExplorerState.pasteEpic(action$, null, {
+ fileSystem: fs,
+ notifications,
+ })
+ .toArray()
+ .subscribe(actualActions => {
+ assert.ok(actualActions.find(action => action.type === "PASTE_SUCCESS"))
+ assert.deepEqual(actualActions, expected)
+ done()
+ })
+ })
+
+ it("should correctly trigger a node deletion", () => {
+ const action$ = ActionsObservable.of({
+ type: "DELETE",
+ target: target1,
+ persist: true,
+ } as ExplorerState.IDeleteAction)
+
+ const expected = [
+ { type: "DELETE_SUCCESS", target: target1, persist: true },
+ { type: "REFRESH" },
+ ]
+
+ ExplorerState.deleteEpic(action$, null, { fileSystem: fs, notifications })
+ .toArray()
+ .subscribe(actualActions => {
+ assert.deepEqual(actualActions, expected)
+ })
+ })
+
+ it("should correctly dispatch a fail action if there is an error", () => {
+ const action$ = ActionsObservable.of({
+ type: "DELETE",
+ target: target1,
+ persist: true,
+ } as ExplorerState.IDeleteAction)
+
+ const expected = [{ type: "DELETE_FAIL", reason: "Doesnt work" }]
+
+ ExplorerState.deleteEpic(action$, null, {
+ fileSystem: {
+ ...fs,
+ persistNode: async node => {
+ throw new Error("Doesnt work")
+ },
+ },
+ notifications,
+ })
+ .toArray()
+ .subscribe(actualActions => {
+ assert.deepEqual(actualActions, expected)
+ })
+ })
+
+ it("Should correctly trigger a move action on undo of paste", () => {
+ const action$ = ActionsObservable.of({
+ type: "UNDO",
+ } as ExplorerState.ExplorerAction)
+
+ const stateCopy = clone(ExplorerState.DefaultExplorerState)
+ const state = {
+ ...stateCopy,
+ register: {
+ ...stateCopy.register,
+ undo: [pasteAction],
+ },
+ }
+
+ const undoState = mockStore(state)
+ const expected = [{ type: "UNDO_SUCCESS" }, { type: "REFRESH" }]
+
+ ExplorerState.undoEpic(action$, undoState, { fileSystem: fs, notifications })
+ .toArray()
+ .subscribe(actualActions => {
+ assert.deepEqual(actualActions, expected)
+ })
+ })
+
+ it("Should trigger an expand directory on undo if the original source is a directory", () => {
+ const action$ = ActionsObservable.of({
+ type: "UNDO",
+ } as ExplorerState.ExplorerAction)
+
+ const stateCopy = clone(ExplorerState.DefaultExplorerState)
+ const state = {
+ ...stateCopy,
+ register: {
+ ...stateCopy.register,
+ undo: [{ ...pasteAction, sources: [target1] as ExplorerNode[] }],
+ },
+ }
+
+ const undoState = mockStore(state)
+ const expected = [
+ { type: "UNDO_SUCCESS" },
+ { type: "EXPAND_DIRECTORY", directoryPath: "/test/dir/subdir/" },
+ { type: "REFRESH" },
+ ]
+
+ ExplorerState.undoEpic(action$, undoState, { fileSystem: fs, notifications })
+ .toArray()
+ .subscribe(actualActions => {
+ assert.deepEqual(actualActions, expected)
+ })
+ })
+
+ it("Should trigger a restore action if the deleted note can be restored", () => {
+ const action$ = ActionsObservable.of({
+ type: "UNDO",
+ } as ExplorerState.ExplorerAction)
+
+ const stateCopy = clone(ExplorerState.DefaultExplorerState)
+ const state = {
+ ...stateCopy,
+ register: {
+ ...stateCopy.register,
+ undo: [deleteAction],
+ },
+ }
+
+ const undoState = mockStore(state)
+ const expected = [
+ { type: "UNDO_SUCCESS" },
+ { type: "EXPAND_DIRECTORY", directoryPath: "/test/dir/subdir" },
+ { type: "REFRESH" },
+ ]
+
+ ExplorerState.undoEpic(action$, undoState, { fileSystem: fs, notifications })
+ .toArray()
+ .subscribe(actualActions => {
+ assert.deepEqual(actualActions, expected)
+ })
+ })
+
+ it("Should return a fail action if the node was truly deleted", () => {
+ const action$ = ActionsObservable.of({
+ type: "UNDO",
+ } as ExplorerState.ExplorerAction)
+
+ const stateCopy = clone(ExplorerState.DefaultExplorerState)
+ const state = {
+ ...stateCopy,
+ register: {
+ ...stateCopy.register,
+ undo: [{ ...deleteAction, persist: false }],
+ },
+ }
+
+ const undoState = mockStore(state)
+ const expected = [
+ {
+ type: "UNDO_FAIL",
+ reason: "The last deletion cannot be undone, sorry",
+ } as ExplorerState.IUndoFailAction,
+ ]
+
+ ExplorerState.undoEpic(action$, undoState, { fileSystem: fs, notifications })
+ .toArray()
+ .subscribe(actualActions => {
+ assert.deepEqual(actualActions, expected)
+ })
+ })
+
+ it("Should clear updates after a short interval", () => {
+ const action$ = ActionsObservable.of(deleteAction)
+
+ const expected = [
+ {
+ type: "CLEAR_UPDATE",
+ } as ExplorerState.IClearUpdateAction,
+ ]
+
+ ExplorerState.clearUpdateEpic(action$, null, {
+ fileSystem: fs,
+ notifications,
+ })
+ .toArray()
+ .subscribe(actualActions => {
+ assert.deepEqual(actualActions, expected)
+ })
+ })
+
+ it("Should move an item when a rename is triggered", () => {
+ const action$ = ActionsObservable.of({
+ type: "RENAME_COMMIT",
+ target: target1,
+ newName: "testing",
+ } as ExplorerState.IRenameCommitAction)
+
+ const expected = [
+ {
+ type: "RENAME_SUCCESS",
+ targetType: "folder",
+ source: target1.folderPath,
+ destination: path.join(path.dirname(target1.folderPath), "testing"),
+ },
+ { type: "REFRESH" },
+ ]
+
+ ExplorerState.renameEpic(action$, null, { fileSystem: fs, notifications })
+ .toArray()
+ .subscribe(actualActions => assert.deepEqual(actualActions, expected))
+ })
+
+ it("Should send a notification on paste success", () => {
+ const action$ = ActionsObservable.of({
+ type: "PASTE_SUCCESS",
+ moved: [{ node: target1, destination: "/another/test/dir" }],
+ } as ExplorerState.IPasteSuccessAction)
+
+ const expected = [{ type: "NOTIFICATION_SENT", typeOfNotification: "PASTE_SUCCESS" }]
+
+ ExplorerState.notificationEpic(action$, null, { fileSystem: fs, notifications })
+ .toArray()
+ .subscribe(actualAction => assert.deepEqual(actualAction, expected))
+ })
+
+ it("Should send a notification on paste fail", () => {
+ const action$ = ActionsObservable.of({
+ type: "PASTE_FAIL",
+ } as ExplorerState.IPasteFailAction)
+
+ const expected = [{ type: "NOTIFICATION_SENT", typeOfNotification: "PASTE_FAIL" }]
+
+ ExplorerState.notificationEpic(action$, null, { fileSystem: fs, notifications })
+ .toArray()
+ .subscribe(actualAction => assert.deepEqual(actualAction, expected))
+ })
+
+ it("Should send a notification on rename success", () => {
+ const action$ = ActionsObservable.of({
+ type: "RENAME_SUCCESS",
+ source: "/initial/test/dir",
+ destination: "/destination/test/dir",
+ targetType: "folder",
+ } as ExplorerState.IRenameSuccessAction)
+
+ const expected = [{ type: "NOTIFICATION_SENT", typeOfNotification: "RENAME_SUCCESS" }]
+
+ ExplorerState.notificationEpic(action$, null, { fileSystem: fs, notifications })
+ .toArray()
+ .subscribe(actualAction => assert.deepEqual(actualAction, expected))
+ })
+
+ it("Should send a notification on rename success", () => {
+ const action$ = ActionsObservable.of({
+ type: "RENAME_FAIL",
+ } as ExplorerState.IRenameFailAction)
+
+ const expected = [{ type: "NOTIFICATION_SENT", typeOfNotification: "RENAME_FAIL" }]
+
+ ExplorerState.notificationEpic(action$, null, { fileSystem: fs, notifications })
+ .toArray()
+ .subscribe(actualAction => assert.deepEqual(actualAction, expected))
+ })
+
+ it("Should return a create node success action if a creation is committed", () => {
+ const action$ = ActionsObservable.of({
+ type: "CREATE_NODE_COMMIT",
+ name: "/test/dir/file.txt",
+ } as ExplorerState.ICreateNodeCommitAction)
+
+ const stateCopy = clone(ExplorerState.DefaultExplorerState)
+ const state = {
+ ...stateCopy,
+ register: {
+ ...stateCopy.register,
+ create: {
+ active: true,
+ nodeType: "file" as "file" | "folder",
+ name: "/test/dir/file.txt",
+ },
+ },
+ }
+
+ const createState = mockStore(state)
+
+ const expected = [
+ { type: "CREATE_NODE_SUCCESS", nodeType: "file", name: "/test/dir/file.txt" },
+ { type: "EXPAND_DIRECTORY", directoryPath: "/test/dir" },
+ { type: "REFRESH" },
+ ]
+
+ ExplorerState.createNodeEpic(action$, createState, { fileSystem: fs, notifications })
+ .toArray()
+ .subscribe(actualActions => assert.deepEqual(actualActions, expected))
+ })
+
+ it("Should return an error action if a creation fails", () => {
+ const action$ = ActionsObservable.of({
+ type: "CREATE_NODE_COMMIT",
+ name: "/test/dir/file.txt",
+ } as ExplorerState.ICreateNodeCommitAction)
+
+ const stateCopy = clone(ExplorerState.DefaultExplorerState)
+ const state = {
+ ...stateCopy,
+ register: {
+ ...stateCopy.register,
+ create: {
+ active: true,
+ nodeType: "file" as "file" | "folder",
+ name: "/test/dir/file.txt",
+ },
+ },
+ }
+
+ const createState = mockStore(state)
+
+ const expected = [{ type: "CREATE_NODE_FAIL", reason: "Duplicate" }]
+
+ ExplorerState.createNodeEpic(action$, createState, {
+ fileSystem: {
+ ...fs,
+ writeFile: async folderpath => {
+ throw new Error("Duplicate")
+ },
+ },
+ notifications,
+ })
+ .toArray()
+ .subscribe(actualActions => {
+ assert.deepEqual(actualActions, expected)
+ })
+ })
+
+ it("Should trigger a persist/delete action if the created node is undone", () => {
+ const action$ = ActionsObservable.of({
+ type: "UNDO",
+ } as ExplorerState.ExplorerAction)
+
+ const stateCopy = clone(ExplorerState.DefaultExplorerState)
+ const state = {
+ ...stateCopy,
+ register: {
+ ...stateCopy.register,
+ undo: [
+ {
+ type: "CREATE_NODE_SUCCESS",
+ name: "/test/dir/file.txt",
+ nodeType: "file",
+ } as ExplorerState.ICreateNodeSuccessAction,
+ ],
+ },
+ }
+
+ const undoState = mockStore(state)
+ const expected = [{ type: "UNDO_SUCCESS" }, { type: "REFRESH" }]
+
+ ExplorerState.undoEpic(action$, undoState, { fileSystem: fs, notifications })
+ .toArray()
+ .subscribe(actualActions => {
+ assert.deepEqual(actualActions, expected)
+ })
+ })
+ })
+
+ describe("Store utility helper tests", () => {
+ it("Should not add an action if it isn't set to persist", () => {
+ const testAction = {
+ type: "DELETE_SUCCESS",
+ persist: false,
+ target: { id: "2", type: "file", filePath },
+ } as ExplorerState.IDeleteSuccessAction
+ const newState = ExplorerState.shouldAddDeletion(testAction)
+ assert.ok(newState.length === 0 && Array.isArray(newState))
+ })
+
+ it("Should return an action if it is set to persist", () => {
+ const testAction = {
+ type: "DELETE_SUCCESS",
+ persist: true,
+ target: { id: "2", type: "file", filePath },
+ } as ExplorerState.IDeleteSuccessAction
+ const newState = ExplorerState.shouldAddDeletion(testAction)
+ assert.deepEqual(head(newState), testAction)
+ })
+ describe("Register Reducer test", () => {
+ const { yankRegisterReducer, DefaultExplorerState: { register } } = ExplorerState
+
+ it("It should add paste items to both the paste and undo registers", () => {
+ const newState = yankRegisterReducer(clone(register), pasteAction)
+ assert.deepEqual(
+ newState.paste,
+ pasteAction.target,
+ "Paste is set to the node which was the target of the paste action",
+ )
+ assert.deepEqual(
+ head(newState.undo),
+ pasteAction,
+ "The paste action is saved in the undo queue",
+ )
+ })
+
+ it("Should remove item from the end of the undo list following undo success", () => {
+ const state = { ...register, undo: [pasteAction] }
+ const action = { type: "UNDO_SUCCESS" }
+ const newState = yankRegisterReducer(state, action)
+ assert.ok(!newState.undo.length)
+ })
+
+ it("Adds a delete action to the undo register IF it can be persisted)", () => {
+ const newState = yankRegisterReducer(clone(register), deleteAction)
+ assert.deepEqual(head(newState.undo), deleteAction)
+ })
+
+ it("Does NOT Add a delete action to the undo register IF it can't be persisted)", () => {
+ const newState = yankRegisterReducer(clone(register), {
+ ...deleteAction,
+ persist: false,
+ })
+ assert.ok(!newState.undo.length)
+ })
+
+ it("Should add a successful rename to undo register", () => {
+ const newState = yankRegisterReducer(clone(register), {
+ type: "RENAME_SUCCESS",
+ destination: path.basename(target1.folderPath) + "/rename",
+ source: target1.folderPath,
+ targetType: "folder",
+ })
+
+ assert.ok(newState.undo.length === 1)
+ })
+
+ it("Should clear the renaming if a rename cancel action is triggered", () => {
+ const state = {
+ ...clone(register),
+ rename: {
+ target: target1 as ExplorerNode,
+ active: true,
+ },
+ }
+ const newState = yankRegisterReducer(state, { type: "RENAME_CANCEL" })
+ assert.ok(!newState.rename.active)
+ assert.ok(!newState.rename.target)
+ })
+ })
+ })
})
diff --git a/browser/test/Services/Learning/Tutorial/TutorialGameplayManagerTests.ts b/browser/test/Services/Learning/Tutorial/TutorialGameplayManagerTests.ts
new file mode 100644
index 0000000000..590f7d2533
--- /dev/null
+++ b/browser/test/Services/Learning/Tutorial/TutorialGameplayManagerTests.ts
@@ -0,0 +1,73 @@
+/**
+ * TutorialGameplayManagerTests.ts
+ */
+
+import * as assert from "assert"
+
+import * as Oni from "oni-api"
+
+import { MockEditor } from "./../../../Mocks"
+import * as TestHelpers from "./../../../TestHelpers"
+
+import { ITutorialMetadata } from "./../../../../src/Services/Learning/Tutorial"
+import {
+ TICK_RATE,
+ TutorialGameplayManager,
+} from "./../../../../src/Services/Learning/Tutorial/TutorialGameplayManager"
+
+const MockTutorialMetadata: ITutorialMetadata = {
+ id: "tutorial.test",
+ name: "test tutorial",
+ description: "tutorial for unit tests",
+ level: -1,
+}
+
+// Helper to execute a 'tick', so that the 'setInterval' that runs the ticks
+// gets picked up
+const tick = async () => {
+ await TestHelpers.waitForPromiseResolution()
+ TestHelpers.tick(TICK_RATE + 1)
+}
+
+describe("TutorialGameplayManagerTests", () => {
+ let mockEditor: Oni.Editor = null
+ let tutorialGameplayManager: TutorialGameplayManager = null
+
+ beforeEach(() => {
+ mockEditor = new MockEditor()
+ tutorialGameplayManager = new TutorialGameplayManager(mockEditor)
+ })
+
+ it("calls tick periodically while active", async () => {
+ let hitCount = 0
+
+ const tickFunction = () => {
+ hitCount++
+ return Promise.resolve(false)
+ }
+
+ const myTutorial = {
+ metadata: MockTutorialMetadata,
+ stages: [
+ {
+ tickFunction,
+ },
+ ],
+ }
+
+ tutorialGameplayManager.start(myTutorial, mockEditor.activeBuffer)
+
+ // Validate the tick function was executed
+ assert.strictEqual(hitCount, 1)
+
+ // Validate that another 'tick' was executed
+ await tick()
+ assert.strictEqual(hitCount, 2)
+
+ tutorialGameplayManager.stop()
+
+ // Validate that there wasn't another tick after stopping
+ await tick()
+ assert.strictEqual(hitCount, 2)
+ })
+})
diff --git a/browser/test/Services/QuickOpen/RegExFilterTests.ts b/browser/test/Services/QuickOpen/RegExFilterTests.ts
index c548e1d0ae..d4c6301c1f 100644
--- a/browser/test/Services/QuickOpen/RegExFilterTests.ts
+++ b/browser/test/Services/QuickOpen/RegExFilterTests.ts
@@ -66,6 +66,7 @@ describe("regexFilter", () => {
result.forEach(r => {
delete r.detailHighlights
delete r.labelHighlights
+ delete r.score
})
const expectedResult = [
@@ -88,6 +89,7 @@ describe("regexFilter", () => {
// elsewhere.
delete result[0].detailHighlights
delete result[0].labelHighlights
+ delete result[0].score
const expectedResult = [{ label: "index.ts", detail: "browser/src/index.ts" }]
@@ -106,6 +108,7 @@ describe("regexFilter", () => {
// elsewhere.
delete result[0].detailHighlights
delete result[0].labelHighlights
+ delete result[0].score
const expectedResult = [
{ label: "index.ts", detail: "browser/src/services/quickopen/index.ts" },
diff --git a/browser/test/Services/QuickOpen/VSCodeFilterTests.ts b/browser/test/Services/QuickOpen/VSCodeFilterTests.ts
new file mode 100644
index 0000000000..ae78044320
--- /dev/null
+++ b/browser/test/Services/QuickOpen/VSCodeFilterTests.ts
@@ -0,0 +1,294 @@
+/**
+ * VSCodeFilterTests.ts
+ */
+
+import * as assert from "assert"
+import { ScorerCache } from "../../../src/Services/QuickOpen/Scorer/QuickOpenScorer"
+import { processSearchTerm, vsCodeFilter } from "./../../../src/Services/QuickOpen/VSCodeFilter"
+
+describe("processSearchTerm", () => {
+ let cache: ScorerCache
+
+ beforeEach(() => {
+ cache = {}
+ })
+
+ it("Correctly matches word.", async () => {
+ const testString = "src"
+ const testList = [
+ { label: "index.ts", detail: "browser/src" },
+ { label: "index.ts", detail: "browser/test" },
+ ]
+
+ const result = processSearchTerm(testString, testList, cache)
+ const filteredResult = result.filter(r => r.score !== 0)
+
+ // Remove the score since it can change if we updated the
+ // module. As long as its not 0 that is enough here.
+ assert.equal(result[0].score > 0, true)
+ delete result[0].score
+
+ const expectedResult = [
+ {
+ label: "index.ts",
+ labelHighlights: [] as number[],
+ detail: "browser/src",
+ detailHighlights: [8, 9, 10],
+ },
+ ]
+
+ assert.deepEqual(filteredResult, expectedResult)
+ })
+ it("Correctly score case-match higher", async () => {
+ const testString = "SRC"
+ const testList = [
+ { label: "index.ts", detail: "browser/src" },
+ { label: "index.ts", detail: "browser/SRC" },
+ ]
+
+ const result = processSearchTerm(testString, testList, cache)
+
+ // Check the exact case match scores higher
+ const lowercase = result.find(r => r.detail === "browser/src")
+ const uppercase = result.find(r => r.detail === "browser/SRC")
+ assert.equal(uppercase.score > lowercase.score, true)
+
+ // Both should be highlighted though
+ assert.deepEqual(uppercase.detailHighlights, [8, 9, 10])
+ assert.deepEqual(lowercase.detailHighlights, [8, 9, 10])
+ })
+ it("Correctly returns no matches.", async () => {
+ const testString = "zzz"
+ const testList = [
+ { label: "index.ts", detail: "browser/src" },
+ { label: "index.ts", detail: "browser/test" },
+ ]
+
+ const result = processSearchTerm(testString, testList, cache)
+ const filteredResult = result.filter(r => r.score !== 0)
+
+ assert.deepEqual(filteredResult, [])
+ })
+})
+
+describe("vsCodeFilter", () => {
+ it("Correctly matches string.", async () => {
+ const testString = "index"
+ const testList = [
+ { label: "index.ts", detail: "browser/src" },
+ { label: "main.ts", detail: "browser/src" },
+ { label: "index.ts", detail: "browser/test" },
+ ]
+
+ const result = vsCodeFilter(testList, testString)
+
+ // Remove the score since it can change if we updated the
+ // module.
+ // However, the score should be equal due to an exact match on both.
+ assert.equal(result[0].score === result[1].score, true)
+ delete result[0].score
+ delete result[1].score
+
+ const expectedResult = [
+ {
+ label: "index.ts",
+ labelHighlights: [0, 1, 2, 3, 4],
+ detail: "browser/src",
+ detailHighlights: [] as number[],
+ },
+ {
+ label: "index.ts",
+ labelHighlights: [0, 1, 2, 3, 4],
+ detail: "browser/test",
+ detailHighlights: [] as number[],
+ },
+ ]
+
+ assert.deepEqual(result, expectedResult)
+ })
+ it("Correctly matches string with extension.", async () => {
+ const testString = "index.ts"
+ const testList = [
+ { label: "index.ts", detail: "browser/src" },
+ { label: "main.ts", detail: "browser/src" },
+ { label: "index.ts", detail: "browser/test" },
+ ]
+
+ const result = vsCodeFilter(testList, testString)
+
+ // Remove the score since it can change if we updated the
+ // module.
+ // However, the score should be equal due to an exact match on both.
+ assert.equal(result[0].score === result[1].score, true)
+ delete result[0].score
+ delete result[1].score
+
+ const expectedResult = [
+ {
+ label: "index.ts",
+ labelHighlights: [0, 1, 2, 3, 4, 5, 6, 7],
+ detail: "browser/src",
+ detailHighlights: [] as number[],
+ },
+ {
+ label: "index.ts",
+ labelHighlights: [0, 1, 2, 3, 4, 5, 6, 7],
+ detail: "browser/test",
+ detailHighlights: [] as number[],
+ },
+ ]
+
+ assert.deepEqual(result, expectedResult)
+ })
+ it("Correctly splits and matches string.", async () => {
+ const testString = "index src"
+ const testList = [
+ { label: "index.ts", detail: "browser/src" },
+ { label: "index.ts", detail: "browser/test" },
+ ]
+
+ const result = vsCodeFilter(testList, testString)
+
+ // Remove the score since it can change if we updated the
+ // module. As long as its not 0 that is enough here.
+ assert.equal(result[0].score > 0, true)
+ delete result[0].score
+
+ const expectedResult = [
+ {
+ label: "index.ts",
+ labelHighlights: [0, 1, 2, 3, 4],
+ detail: "browser/src",
+ detailHighlights: [8, 9, 10],
+ },
+ ]
+
+ assert.deepEqual(result, expectedResult)
+ })
+ it("Correctly matches long split string.", async () => {
+ const testString = "index src service quickopen"
+ const testList = [
+ { label: "index.ts", detail: "browser/src/services/menu" },
+ { label: "index.ts", detail: "browser/src/services/quickopen" },
+ ]
+
+ const result = vsCodeFilter(testList, testString)
+
+ // Remove the score since it can change if we updated the
+ // module. As long as its not 0 that is enough here.
+ // Similarly, the highlights has been tested elsewhere,
+ // and its long here, so just check lengths.
+ assert.equal(result[0].score > 0, true)
+ assert.equal(result[0].labelHighlights.length === 5, true)
+ assert.equal(result[0].detailHighlights.length === 19, true)
+ delete result[0].score
+ delete result[0].labelHighlights
+ delete result[0].detailHighlights
+
+ const expectedResult = [{ label: "index.ts", detail: "browser/src/services/quickopen" }]
+
+ assert.deepEqual(result, expectedResult)
+ })
+ it("Correctly doesn't match.", async () => {
+ const testString = "zzz"
+ const testList = [
+ { label: "index.ts", detail: "browser/src/services/menu" },
+ { label: "index.ts", detail: "browser/src/services/quickopen" },
+ ]
+
+ const result = vsCodeFilter(testList, testString)
+
+ assert.deepEqual(result, [])
+ })
+ it("Correctly matches split string in turn.", async () => {
+ const testString = "index main"
+ const testList = [
+ { label: "index.ts", detail: "browser/src/services/config" },
+ { label: "index.ts", detail: "browser/src/services/quickopen" },
+ { label: "main.ts", detail: "browser/src/services/menu" },
+ ]
+
+ // Should return no results, since the first term should restrict the second
+ // search to return no results.
+ const result = vsCodeFilter(testList, testString)
+
+ assert.deepEqual(result, [])
+ })
+ it("Correctly sorts results for fuzzy match.", async () => {
+ const testString = "aBE"
+ const testList = [
+ { label: "BufferEditor.ts", detail: "packages/demo/src" },
+ { label: "BufferEditorContainer.ts", detail: "packages/demo/src" },
+ { label: "astBackedEditing.ts", detail: "packages/core/src" },
+ ]
+
+ // All results match, but only the last has an exact match on aBE inside the file name.
+ const result = vsCodeFilter(testList, testString)
+
+ const be = result.find(r => r.label === "BufferEditor.ts")
+ const bec = result.find(r => r.label === "BufferEditorContainer.ts")
+ const abe = result.find(r => r.label === "astBackedEditing.ts")
+
+ // Therefore it should score the highest.
+ assert.equal(abe.score > be.score, true)
+ assert.equal(abe.score > bec.score, true)
+
+ // It should also be the first in the list
+ assert.deepEqual(result[0], abe)
+ })
+ it("Correctly sorts results for filtered search.", async () => {
+ const testString = "buffer test oni"
+ const testList = [
+ { label: "BufferEditor.ts", detail: "packages/demo/src" },
+ { label: "BufferEditorContainer.ts", detail: "packages/demo/src" },
+ { label: "BufferEditor.ts", detail: "packages/core/src" },
+ { label: "BufferEditor.ts", detail: "packages/core/test" },
+ { label: "BufferEditor.ts", detail: "packages/core/test/oni" },
+ ]
+
+ const result = vsCodeFilter(testList, testString)
+
+ // Should only match the last term
+ const best = result.find(r => r.detail === "packages/core/test/oni")
+ assert.deepEqual(result[0], best)
+ assert.equal(result.length, 1)
+ })
+ it("Correctly sorts results for shortest result on file name.", async () => {
+ const testString = "main"
+ const testList = [
+ { label: "main.tex", detail: "packages/core/src" },
+ { label: "main.tex", detail: "packages/core/test" },
+ { label: "main.tex", detail: "packages/core/test/oni" },
+ ]
+
+ const result = vsCodeFilter(testList, testString)
+
+ // Should prefer the short path
+ const best = result.find(r => r.detail === "packages/core/src")
+ const second = result.find(r => r.detail === "packages/core/test")
+ const third = result.find(r => r.detail === "packages/core/test/oni")
+
+ // Order should be as follows
+ assert.deepEqual(result[0], best)
+ assert.deepEqual(result[1], second)
+ assert.deepEqual(result[2], third)
+ })
+ it("Correctly sorts results for shortest result on path.", async () => {
+ const testString = "somepath"
+ const testList = [
+ { label: "fileA.ts", detail: "/some/path" },
+ { label: "fileB.ts", detail: "/some/path/longer" },
+ { label: "fileC.ts", detail: "packages/core/oni" },
+ ]
+
+ const result = vsCodeFilter(testList, testString)
+
+ // Should prefer the short path
+ const best = result.find(r => r.label === "fileA.ts")
+ const second = result.find(r => r.label === "fileB.ts")
+
+ // Order should be as follows
+ assert.deepEqual(result[0], best)
+ assert.deepEqual(result[1], second)
+ })
+})
diff --git a/browser/test/Services/SyntaxHighlighting/SyntaxHighlightingReducerTests.ts b/browser/test/Services/SyntaxHighlighting/SyntaxHighlightingReducerTests.ts
index be86764b52..de926a04cc 100644
--- a/browser/test/Services/SyntaxHighlighting/SyntaxHighlightingReducerTests.ts
+++ b/browser/test/Services/SyntaxHighlighting/SyntaxHighlightingReducerTests.ts
@@ -34,19 +34,21 @@ describe("SyntaxHighlightingReducer", () => {
})
})
- it("only sets changed lines to dirty", () => {
+ it("sets lines with a different buffer version to dirty", () => {
const originalState: SyntaxHighlighting.SyntaxHighlightLines = {
"0": {
ruleStack: null,
tokens: [],
line: "line1",
dirty: false,
+ version: 1,
},
"1": {
ruleStack: null,
tokens: [],
line: "line2",
dirty: false,
+ version: 0,
},
}
@@ -66,6 +68,7 @@ describe("SyntaxHighlightingReducer", () => {
tokens: [],
line: "line1",
dirty: false,
+ version: 1,
})
assert.deepEqual(newState["1"], {
@@ -73,6 +76,7 @@ describe("SyntaxHighlightingReducer", () => {
tokens: [],
line: "line2_update",
dirty: true,
+ version: 0,
})
})
})
diff --git a/browser/test/Services/WindowManager/WindowManagerTests.ts b/browser/test/Services/WindowManager/WindowManagerTests.ts
index 10baead686..1055f0f4b9 100644
--- a/browser/test/Services/WindowManager/WindowManagerTests.ts
+++ b/browser/test/Services/WindowManager/WindowManagerTests.ts
@@ -4,7 +4,7 @@
import * as assert from "assert"
-import { WindowManager } from "./../../../src/Services/WindowManager"
+import { ISplitInfo, WindowManager } from "./../../../src/Services/WindowManager"
import { MockWindowSplit } from "./../../Mocks"
describe("WindowManagerTests", () => {
@@ -52,4 +52,26 @@ describe("WindowManagerTests", () => {
assert.strictEqual(handle.id, handle3.id)
})
+
+ it("respects direction even if a reference split is not passed in", async () => {
+ const split1 = new MockWindowSplit("window1")
+ const split2 = new MockWindowSplit("window2")
+
+ const handle1 = windowManager.createSplit("horizontal", split1)
+ handle1.focus()
+
+ windowManager.createSplit("vertical", split2, split1)
+
+ const splitRoot = windowManager.splitRoot
+
+ const firstChild = splitRoot.splits[0] as ISplitInfo
+
+ assert.strictEqual(firstChild.type, "Split")
+ assert.strictEqual(
+ firstChild.direction,
+ "horizontal",
+ "Validate the splits are arranged horizontally (it's confusing... but this means they are vertical splits)",
+ )
+ assert.strictEqual(firstChild.splits.length, 2, "Validate both windows are in this split")
+ })
})
diff --git a/browser/tsconfig.json b/browser/tsconfig.json
index 92817ac4d9..d8157e6cc0 100644
--- a/browser/tsconfig.json
+++ b/browser/tsconfig.json
@@ -24,7 +24,7 @@
"suppressImplicitAnyIndexErrors": true,
"target": "es2015",
"sourceMap": true,
- "types": ["mocha"]
+ "types": ["mocha", "webgl2"]
},
"include": ["src/**/*.ts", "test/**/*.ts"],
"exclude": ["node_modules"]
diff --git a/browser/tsconfig.test.json b/browser/tsconfig.test.json
index 0174601759..f2488b6c90 100644
--- a/browser/tsconfig.test.json
+++ b/browser/tsconfig.test.json
@@ -20,7 +20,7 @@
"suppressImplicitAnyIndexErrors": true,
"target": "es2015",
"sourceMap": true,
- "types": ["mocha"]
+ "types": ["mocha", "webgl2"]
},
"include": ["src/**/*.ts", "src/**/*.tsx", "test/**/*.ts"],
"exclude": ["node_modules"]
diff --git a/browser/webpack.debug.config.js b/browser/webpack.debug.config.js
index 12b7e0166d..7ed8d1a581 100644
--- a/browser/webpack.debug.config.js
+++ b/browser/webpack.debug.config.js
@@ -6,15 +6,18 @@ const webpack = require("webpack")
const baseConfig = require("./webpack.development.config.js")
const debugConfig = Object.assign({}, baseConfig, {
+ devtool: "source-map",
plugins: [
new webpack.DefinePlugin({
"process.env.NODE_ENV": '"development"',
}),
- new webpack.optimize.CommonsChunkPlugin({
- async: true,
- minChunks: 2,
- }),
],
+ optimization: {
+ splitChunks: {
+ name: "vendor",
+ minChunks: 2,
+ },
+ },
output: {
path: path.join(__dirname, "..", "lib", "browser"),
publicPath: "lib/browser/",
diff --git a/browser/webpack.development.config.js b/browser/webpack.development.config.js
index 61b8b7cc4d..b026924ce7 100644
--- a/browser/webpack.development.config.js
+++ b/browser/webpack.development.config.js
@@ -2,6 +2,7 @@ var path = require("path")
var webpack = require("webpack")
module.exports = {
+ mode: "development",
entry: [path.join(__dirname, "src/index.tsx")],
target: "electron-renderer",
externals: {
@@ -12,13 +13,19 @@ module.exports = {
gifshot: "require('gifshot')",
"msgpack-lite": "require('msgpack-lite')",
"styled-components": "require('styled-components')",
+ fsevents: "require('fsevents')",
},
resolve: {
extensions: [".tsx", ".ts", ".js", ".less"],
},
- devtool: "cheap-module-eval-source-map",
module: {
rules: [
+ {
+ test: /\.(html)$/,
+ use: {
+ loader: "html-loader",
+ },
+ },
{
test: /\.less$/,
use: [
diff --git a/browser/webpack.production.config.js b/browser/webpack.production.config.js
index 5a7464482a..e5b1051c10 100644
--- a/browser/webpack.production.config.js
+++ b/browser/webpack.production.config.js
@@ -5,23 +5,13 @@ const webpack = require("webpack")
// Override 'debug' settings
const baseConfig = require("./webpack.debug.config.js")
-const OptimizeJsPlugin = require("optimize-js-plugin")
-const BabiliPlugin = require("babili-webpack-plugin")
-
const productionConfig = Object.assign({}, baseConfig, {
+ mode: "production",
devtool: false,
plugins: [
new webpack.DefinePlugin({
"process.env.NODE_ENV": '"production"',
}),
- new webpack.optimize.CommonsChunkPlugin({
- async: true,
- minChunks: 2,
- }),
- new BabiliPlugin(),
- new OptimizeJsPlugin({
- sourceMap: false,
- }),
],
})
diff --git a/build/script/UploadDistributionBuildsToAzure.js b/build/script/UploadDistributionBuildsToAzure.js
index a2e78f1faf..4732b4eff6 100644
--- a/build/script/UploadDistributionBuildsToAzure.js
+++ b/build/script/UploadDistributionBuildsToAzure.js
@@ -129,6 +129,7 @@ const generateBuildMetadata = (branch, version) => {
return {
branch,
version,
+ commit: COMMIT_ID,
releaseNotesUrl: "https://github.com/onivim/oni/wiki/Whats-New-in-Oni",
releaseDate: new Date().getTime(),
containerName: getContainerName(branch, version, COMMIT_ID),
diff --git a/configuration/config.default.js b/configuration/config.default.js
index ec2ad7b72a..08c4f89dc7 100644
--- a/configuration/config.default.js
+++ b/configuration/config.default.js
@@ -9,10 +9,11 @@ const activate = oni => {
//
// Add input bindings here:
//
+ oni.input.bind("", "oni.debug.openDevTools")
oni.input.bind("", () => console.log("Control+Enter was pressed"))
//
- // Or remove the default bindings here by uncommenting the below line:
+ // Or remove the default bindings:
//
// oni.input.unbind("")
}
diff --git a/extensions/clojure/syntaxes/clojure.tmLanguage.json b/extensions/clojure/syntaxes/clojure.tmLanguage.json
new file mode 100755
index 0000000000..96848424a0
--- /dev/null
+++ b/extensions/clojure/syntaxes/clojure.tmLanguage.json
@@ -0,0 +1,444 @@
+{
+ "information_for_contributors": [
+ "This file has been converted from https://github.com/atom/language-clojure/blob/master/grammars/clojure.cson",
+ "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/atom/language-clojure/commit/ecc790326bc8e14220e4d2d72a392a30876c3219",
+ "name": "Clojure",
+ "scopeName": "source.clojure",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#shebang-comment"
+ },
+ {
+ "include": "#quoted-sexp"
+ },
+ {
+ "include": "#sexp"
+ },
+ {
+ "include": "#keyfn"
+ },
+ {
+ "include": "#string"
+ },
+ {
+ "include": "#vector"
+ },
+ {
+ "include": "#set"
+ },
+ {
+ "include": "#map"
+ },
+ {
+ "include": "#regexp"
+ },
+ {
+ "include": "#var"
+ },
+ {
+ "include": "#constants"
+ },
+ {
+ "include": "#dynamic-variables"
+ },
+ {
+ "include": "#metadata"
+ },
+ {
+ "include": "#namespace-symbol"
+ },
+ {
+ "include": "#symbol"
+ }
+ ],
+ "repository": {
+ "comment": {
+ "begin": "(?\\<\\/\\!\\?\\*]+(?=(\\s|\\)|\\]|\\}|\\,))",
+ "name": "constant.keyword.clojure"
+ },
+ "keyfn": {
+ "patterns": [
+ {
+ "match":
+ "(?<=(\\s|\\(|\\[|\\{))(if(-[-a-z\\?]*)?|when(-[-a-z]*)?|for(-[-a-z]*)?|cond|do|let(-[-a-z\\?]*)?|binding|loop|recur|fn|throw[a-z\\-]*|try|catch|finally|([a-z]*case))(?=(\\s|\\)|\\]|\\}))",
+ "name": "storage.control.clojure"
+ },
+ {
+ "match":
+ "(?<=(\\s|\\(|\\[|\\{))(declare-?|(in-)?ns|import|use|require|load|compile|(def[a-z\\-]*))(?=(\\s|\\)|\\]|\\}))",
+ "name": "keyword.control.clojure"
+ }
+ ]
+ },
+ "dynamic-variables": {
+ "match": "\\*[\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\d]+\\*",
+ "name": "meta.symbol.dynamic.clojure"
+ },
+ "map": {
+ "begin": "(\\{)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.section.map.begin.clojure"
+ }
+ },
+ "end": "(\\}(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\})",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.section.map.end.trailing.clojure"
+ },
+ "2": {
+ "name": "punctuation.section.map.end.clojure"
+ }
+ },
+ "name": "meta.map.clojure",
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ "metadata": {
+ "patterns": [
+ {
+ "begin": "(\\^\\{)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.section.metadata.map.begin.clojure"
+ }
+ },
+ "end": "(\\}(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\})",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.section.metadata.map.end.trailing.clojure"
+ },
+ "2": {
+ "name": "punctuation.section.metadata.map.end.clojure"
+ }
+ },
+ "name": "meta.metadata.map.clojure",
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ {
+ "begin": "(\\^)",
+ "end": "(\\s)",
+ "name": "meta.metadata.simple.clojure",
+ "patterns": [
+ {
+ "include": "#keyword"
+ },
+ {
+ "include": "$self"
+ }
+ ]
+ }
+ ]
+ },
+ "quoted-sexp": {
+ "begin": "(['``]\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.section.expression.begin.clojure"
+ }
+ },
+ "end": "(\\))$|(\\)(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\))",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.section.expression.end.trailing.clojure"
+ },
+ "2": {
+ "name": "punctuation.section.expression.end.trailing.clojure"
+ },
+ "3": {
+ "name": "punctuation.section.expression.end.clojure"
+ }
+ },
+ "name": "meta.quoted-expression.clojure",
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ "regexp": {
+ "begin": "#\"",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.regexp.begin.clojure"
+ }
+ },
+ "end": "\"",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.regexp.end.clojure"
+ }
+ },
+ "name": "string.regexp.clojure",
+ "patterns": [
+ {
+ "include": "#regexp_escaped_char"
+ }
+ ]
+ },
+ "regexp_escaped_char": {
+ "match": "\\\\.",
+ "name": "constant.character.escape.clojure"
+ },
+ "set": {
+ "begin": "(\\#\\{)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.section.set.begin.clojure"
+ }
+ },
+ "end": "(\\}(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\})",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.section.set.end.trailing.clojure"
+ },
+ "2": {
+ "name": "punctuation.section.set.end.clojure"
+ }
+ },
+ "name": "meta.set.clojure",
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ "sexp": {
+ "begin": "(\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.section.expression.begin.clojure"
+ }
+ },
+ "end": "(\\))$|(\\)(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\))",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.section.expression.end.trailing.clojure"
+ },
+ "2": {
+ "name": "punctuation.section.expression.end.trailing.clojure"
+ },
+ "3": {
+ "name": "punctuation.section.expression.end.clojure"
+ }
+ },
+ "name": "meta.expression.clojure",
+ "patterns": [
+ {
+ "begin":
+ "(?<=\\()(ns|declare|def[\\w\\d._:+=>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)",
+ "name": "entity.global.clojure"
+ },
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ {
+ "include": "#keyfn"
+ },
+ {
+ "include": "#constants"
+ },
+ {
+ "include": "#vector"
+ },
+ {
+ "include": "#map"
+ },
+ {
+ "include": "#set"
+ },
+ {
+ "include": "#sexp"
+ },
+ {
+ "match": "(?<=\\()(.+?)(?=\\s|\\))",
+ "captures": {
+ "1": {
+ "name": "entity.name.function.clojure"
+ }
+ },
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ "shebang-comment": {
+ "begin": "^(#!)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.comment.shebang.clojure"
+ }
+ },
+ "end": "$",
+ "name": "comment.line.shebang.clojure"
+ },
+ "string": {
+ "begin": "(?\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)/",
+ "captures": {
+ "1": {
+ "name": "meta.symbol.namespace.clojure"
+ }
+ }
+ }
+ ]
+ },
+ "symbol": {
+ "patterns": [
+ {
+ "match":
+ "([a-zA-Z\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)",
+ "name": "meta.symbol.clojure"
+ }
+ ]
+ },
+ "var": {
+ "match":
+ "(?<=(\\s|\\(|\\[|\\{)\\#)'[a-zA-Z0-9\\.\\-\\_\\:\\+\\=\\>\\<\\/\\!\\?\\*]+(?=(\\s|\\)|\\]|\\}))",
+ "name": "meta.var.clojure"
+ },
+ "vector": {
+ "begin": "(\\[)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.section.vector.begin.clojure"
+ }
+ },
+ "end": "(\\](?=[\\}\\]\\)\\s]*(?:;|$)))|(\\])",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.section.vector.end.trailing.clojure"
+ },
+ "2": {
+ "name": "punctuation.section.vector.end.clojure"
+ }
+ },
+ "name": "meta.vector.clojure",
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ }
+ }
+}
diff --git a/extensions/java/syntaxes/Java.tmLanguage.json b/extensions/java/syntaxes/Java.tmLanguage.json
new file mode 100644
index 0000000000..23aeeb748a
--- /dev/null
+++ b/extensions/java/syntaxes/Java.tmLanguage.json
@@ -0,0 +1,1431 @@
+{
+ "scopeName": "source.java",
+ "name": "Java",
+ "fileTypes": ["java", "bsh"],
+ "patterns": [
+ {
+ "begin": "\\b(package)\\b\\s*",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.package.java"
+ }
+ },
+ "end": "\\s*(;)",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.terminator.java"
+ }
+ },
+ "name": "meta.package.java",
+ "contentName": "storage.modifier.package.java",
+ "patterns": [
+ {
+ "include": "#comments"
+ },
+ {
+ "match": "(?<=\\.)\\s*\\.|\\.(?=\\s*;)",
+ "name": "invalid.illegal.character_not_allowed_here.java"
+ },
+ {
+ "match": "(?",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.bracket.angle.java"
+ }
+ },
+ "patterns": [
+ {
+ "match": "\\b(extends|super)\\b",
+ "name": "storage.modifier.$1.java"
+ },
+ {
+ "match": "(?>>?|~|\\^)",
+ "name": "keyword.operator.bitwise.java"
+ },
+ {
+ "match": "((&|\\^|\\||<<|>>>?)=)",
+ "name": "keyword.operator.assignment.bitwise.java"
+ },
+ {
+ "match": "(===?|!=|<=|>=|<>|<|>)",
+ "name": "keyword.operator.comparison.java"
+ },
+ {
+ "match": "([+*/%-]=)",
+ "name": "keyword.operator.assignment.arithmetic.java"
+ },
+ {
+ "match": "(=)",
+ "name": "keyword.operator.assignment.java"
+ },
+ {
+ "match": "(\\-\\-|\\+\\+)",
+ "name": "keyword.operator.increment-decrement.java"
+ },
+ {
+ "match": "(\\-|\\+|\\*|\\/|%)",
+ "name": "keyword.operator.arithmetic.java"
+ },
+ {
+ "match": "(!|&&|\\|\\|)",
+ "name": "keyword.operator.logical.java"
+ },
+ {
+ "match": "(\\||&)",
+ "name": "keyword.operator.bitwise.java"
+ },
+ {
+ "match": "\\b(const|goto)\\b",
+ "name": "keyword.reserved.java"
+ }
+ ]
+ },
+ "lambda-expression": {
+ "patterns": [
+ {
+ "match": "->",
+ "name": "storage.type.function.arrow.java"
+ }
+ ]
+ },
+ "method-call": {
+ "begin": "(\\.)\\s*([A-Za-z_$][\\w$]*)\\s*(\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.separator.period.java"
+ },
+ "2": {
+ "name": "entity.name.function.java"
+ },
+ "3": {
+ "name": "punctuation.definition.parameters.begin.bracket.round.java"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.parameters.end.bracket.round.java"
+ }
+ },
+ "name": "meta.method-call.java",
+ "patterns": [
+ {
+ "include": "#code"
+ }
+ ]
+ },
+ "methods": {
+ "begin": "(?!new)(?=[\\w<].*\\s+)(?=([^=/]|/(?!/))+\\()",
+ "end": "(})|(?=;)",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.section.method.end.bracket.curly.java"
+ }
+ },
+ "name": "meta.method.java",
+ "patterns": [
+ {
+ "include": "#storage-modifiers"
+ },
+ {
+ "begin": "(\\w+)\\s*(\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "entity.name.function.java"
+ },
+ "2": {
+ "name": "punctuation.definition.parameters.begin.bracket.round.java"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.parameters.end.bracket.round.java"
+ }
+ },
+ "name": "meta.method.identifier.java",
+ "patterns": [
+ {
+ "include": "#parameters"
+ },
+ {
+ "include": "#parens"
+ },
+ {
+ "include": "#comments-inline"
+ }
+ ]
+ },
+ {
+ "include": "#generics"
+ },
+ {
+ "begin": "(?=\\w.*\\s+\\w+\\s*\\()",
+ "end": "(?=\\s+\\w+\\s*\\()",
+ "name": "meta.method.return-type.java",
+ "patterns": [
+ {
+ "include": "#all-types"
+ },
+ {
+ "include": "#parens"
+ }
+ ]
+ },
+ {
+ "include": "#throws"
+ },
+ {
+ "begin": "{",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.method.begin.bracket.curly.java"
+ }
+ },
+ "end": "(?=})",
+ "contentName": "meta.method.body.java",
+ "patterns": [
+ {
+ "include": "#code"
+ }
+ ]
+ },
+ {
+ "include": "#comments"
+ }
+ ]
+ },
+ "numbers": {
+ "patterns": [
+ {
+ "match":
+ "(?x)\n\\b(?)|(?!;)",
+ "patterns": [
+ {
+ "include": "#generics"
+ }
+ ]
+ },
+ {
+ "match":
+ "\\b(?:[A-Z]\\w*\\s*(\\.)\\s*)*[A-Z]\\w*\\b((?=\\s*[A-Za-z$_\\n])|(?=\\s*\\.\\.\\.))",
+ "name": "storage.type.java",
+ "captures": {
+ "1": {
+ "name": "punctuation.separator.period.java"
+ }
+ }
+ }
+ ]
+ },
+ "object-types-inherited": {
+ "patterns": [
+ {
+ "include": "#generics"
+ },
+ {
+ "match": "\\b(?:[A-Z]\\w*\\s*(\\.)\\s*)*[A-Z]\\w*\\b",
+ "name": "entity.other.inherited-class.java",
+ "captures": {
+ "1": {
+ "name": "punctuation.separator.period.java"
+ }
+ }
+ },
+ {
+ "match": ",",
+ "name": "punctuation.separator.delimiter.java"
+ }
+ ]
+ },
+ "objects": {
+ "match": "(?(\\w+\\.)*[A-Z]+\\w*) # e.g. `javax.ws.rs.Response`, or `String`\n )\n (\n <[\\w<>,\\.?\\s]*> # e.g. `HashMap`, or `List`\n )?\n (\n (\\[\\])* # int[][]\n )?\n \\s+\n [A-Za-z_$][\\w$]* # At least one identifier after space\n ([\\w\\[\\],$][\\w\\[\\],\\s]*)? # possibly primitive array or additional identifiers\n \\s*(=|;)\n)",
+ "end": "(?=;)",
+ "name": "meta.definition.variable.java",
+ "patterns": [
+ {
+ "match": "([A-Za-z$_][\\w$]*)(?=\\s*(\\[\\])*\\s*(;|=|,))",
+ "captures": {
+ "1": {
+ "name": "variable.other.definition.java"
+ }
+ }
+ },
+ {
+ "include": "#all-types"
+ },
+ {
+ "begin": "=",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.assignment.java"
+ }
+ },
+ "end": "(?=;)",
+ "patterns": [
+ {
+ "include": "#code"
+ }
+ ]
+ },
+ {
+ "include": "#code"
+ }
+ ]
+ },
+ "member-variables": {
+ "begin":
+ "(?=private|protected|public|native|synchronized|abstract|threadsafe|transient|static|final)",
+ "end": "(?=;)",
+ "patterns": [
+ {
+ "include": "#storage-modifiers"
+ },
+ {
+ "include": "#variables"
+ },
+ {
+ "include": "#primitive-arrays"
+ },
+ {
+ "include": "#object-types"
+ }
+ ]
+ }
+ }
+}
diff --git a/extensions/lua/syntaxes/lua.tmLanguage.json b/extensions/lua/syntaxes/lua.tmLanguage.json
new file mode 100755
index 0000000000..87de56a47c
--- /dev/null
+++ b/extensions/lua/syntaxes/lua.tmLanguage.json
@@ -0,0 +1,282 @@
+{
+ "information_for_contributors": [
+ "This file has been converted from https://github.com/textmate/lua.tmbundle/blob/master/Syntaxes/Lua.plist",
+ "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/textmate/lua.tmbundle/commit/42da2c6ff5d86c068f72520f856190f413911a80",
+ "name": "Lua",
+ "scopeName": "source.lua",
+ "comment": "Lua Syntax: version 0.8",
+ "patterns": [
+ {
+ "begin":
+ "\\b((local\\b)\\s+)?(function)\\s*(\\s+[a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z_][a-zA-Z0-9_]*)*(:[a-zA-Z_][a-zA-Z0-9_]*)?\\s*)?(\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.local.lua"
+ },
+ "3": {
+ "name": "keyword.control.lua"
+ },
+ "4": {
+ "name": "entity.name.function.lua"
+ },
+ "5": {
+ "name": "punctuation.definition.parameters.begin.lua"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.parameters.end.lua"
+ }
+ },
+ "name": "meta.function.lua",
+ "patterns": [
+ {
+ "match": "[a-zA-Z_][a-zA-Z0-9_]*",
+ "name": "variable.parameter.function.lua"
+ }
+ ]
+ },
+ {
+ "match": "(?=?|(?) ?",
+ "captures": {
+ "2": {
+ "name": "beginning.punctuation.definition.quote.markdown"
+ }
+ },
+ "name": "markup.quote.markdown",
+ "patterns": [
+ {
+ "include": "#block"
+ }
+ ],
+ "while": "(^|\\G)\\s*(>) ?"
+ },
+ "fenced_code_block_css": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(css|css.erb)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.css",
+ "patterns": [
+ {
+ "include": "source.css"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_basic": {
+ "begin":
+ "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(html|htm|shtml|xhtml|inc|tmpl|tpl)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.html",
+ "patterns": [
+ {
+ "include": "text.html.basic"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_ini": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(ini|conf)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.ini",
+ "patterns": [
+ {
+ "include": "source.ini"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_java": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(java|bsh)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.java",
+ "patterns": [
+ {
+ "include": "source.java"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_lua": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(lua)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.lua",
+ "patterns": [
+ {
+ "include": "source.lua"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_makefile": {
+ "begin":
+ "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(Makefile|makefile|GNUmakefile|OCamlMakefile)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.makefile",
+ "patterns": [
+ {
+ "include": "source.makefile"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_perl": {
+ "begin":
+ "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(perl|pl|pm|pod|t|PL|psgi|vcl)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.perl",
+ "patterns": [
+ {
+ "include": "source.perl"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_r": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(R|r|s|S|Rprofile)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.r",
+ "patterns": [
+ {
+ "include": "source.r"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_ruby": {
+ "begin":
+ "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(ruby|rb|rbx|rjs|Rakefile|rake|cgi|fcgi|gemspec|irbrc|Capfile|ru|prawn|Cheffile|Gemfile|Guardfile|Hobofile|Vagrantfile|Appraisals|Rantfile|Berksfile|Berksfile.lock|Thorfile|Puppetfile)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.ruby",
+ "patterns": [
+ {
+ "include": "source.ruby"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_php": {
+ "begin":
+ "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(php|php3|php4|php5|phpt|phtml|aw|ctp)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.php",
+ "patterns": [
+ {
+ "include": "text.html.basic"
+ },
+ {
+ "include": "source.php"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_sql": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(sql|ddl|dml)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.sql",
+ "patterns": [
+ {
+ "include": "source.sql"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_vs_net": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(vb)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.vs_net",
+ "patterns": [
+ {
+ "include": "source.asp.vb.net"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_xml": {
+ "begin":
+ "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(xml|xsd|tld|jsp|pt|cpt|dtml|rss|opml)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.xml",
+ "patterns": [
+ {
+ "include": "text.xml"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_xsl": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(xsl|xslt)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.xsl",
+ "patterns": [
+ {
+ "include": "text.xml.xsl"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_yaml": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(yaml|yml)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.yaml",
+ "patterns": [
+ {
+ "include": "source.yaml"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_dosbatch": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(bat|batch)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.dosbatch",
+ "patterns": [
+ {
+ "include": "source.dosbatch"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_clojure": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(clj|cljs|clojure)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.clojure",
+ "patterns": [
+ {
+ "include": "source.clojure"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_coffee": {
+ "begin":
+ "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(coffee|Cakefile|coffee.erb)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.coffee",
+ "patterns": [
+ {
+ "include": "source.coffee"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_c": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(c|h)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.c",
+ "patterns": [
+ {
+ "include": "source.c"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_cpp": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(cpp|c\\+\\+|cxx)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.cpp",
+ "patterns": [
+ {
+ "include": "source.cpp"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_diff": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(patch|diff|rej)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.diff",
+ "patterns": [
+ {
+ "include": "source.diff"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_dockerfile": {
+ "begin":
+ "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(dockerfile|Dockerfile)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.dockerfile",
+ "patterns": [
+ {
+ "include": "source.dockerfile"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_git_commit": {
+ "begin":
+ "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(COMMIT_EDITMSG|MERGE_MSG)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.git_commit",
+ "patterns": [
+ {
+ "include": "text.git-commit"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_git_rebase": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(git-rebase-todo)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.git_rebase",
+ "patterns": [
+ {
+ "include": "text.git-rebase"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_go": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(go|golang)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.go",
+ "patterns": [
+ {
+ "include": "source.go"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_groovy": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(groovy|gvy)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.groovy",
+ "patterns": [
+ {
+ "include": "source.groovy"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_jade": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(jade|pug)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.jade",
+ "patterns": [
+ {
+ "include": "text.jade"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_js": {
+ "begin":
+ "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(js|jsx|javascript|es6|mjs)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.javascript",
+ "patterns": [
+ {
+ "include": "source.js"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_js_regexp": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(regexp)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.js_regexp",
+ "patterns": [
+ {
+ "include": "source.js.regexp"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_json": {
+ "begin":
+ "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(json|sublime-settings|sublime-menu|sublime-keymap|sublime-mousemap|sublime-theme|sublime-build|sublime-project|sublime-completions)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.json",
+ "patterns": [
+ {
+ "include": "source.json"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_less": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(less)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.less",
+ "patterns": [
+ {
+ "include": "source.css.less"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_objc": {
+ "begin":
+ "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(objectivec|objective-c|mm|objc|obj-c|m|h)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.objc",
+ "patterns": [
+ {
+ "include": "source.objc"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_scss": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(scss)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.scss",
+ "patterns": [
+ {
+ "include": "source.css.scss"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_perl6": {
+ "begin":
+ "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(perl6|p6|pl6|pm6|nqp)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.perl6",
+ "patterns": [
+ {
+ "include": "source.perl.6"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_powershell": {
+ "begin":
+ "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(powershell|ps1|psm1|psd1)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.powershell",
+ "patterns": [
+ {
+ "include": "source.powershell"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_python": {
+ "begin":
+ "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(python|py|py3|rpy|pyw|cpy|SConstruct|Sconstruct|sconstruct|SConscript|gyp|gypi)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.python",
+ "patterns": [
+ {
+ "include": "source.python"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_regexp_python": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(re)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.regexp_python",
+ "patterns": [
+ {
+ "include": "source.regexp.python"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_rust": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(rust|rs)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.rust",
+ "patterns": [
+ {
+ "include": "source.rust"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_scala": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(scala|sbt)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.scala",
+ "patterns": [
+ {
+ "include": "source.scala"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_shell": {
+ "begin":
+ "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(shell|sh|bash|zsh|bashrc|bash_profile|bash_login|profile|bash_logout|.textmate_init)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.shellscript",
+ "patterns": [
+ {
+ "include": "source.shell"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_ts": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(typescript|ts)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.typescript",
+ "patterns": [
+ {
+ "include": "source.ts"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_tsx": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(tsx)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.typescriptreact",
+ "patterns": [
+ {
+ "include": "source.tsx"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_csharp": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(cs|csharp|c#)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.csharp",
+ "patterns": [
+ {
+ "include": "source.cs"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_fsharp": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(fs|fsharp|f#)(\\s+[^`~]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language"
+ },
+ "6": {
+ "name": "fenced_code.block.language.attributes"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.fsharp",
+ "patterns": [
+ {
+ "include": "source.fsharp"
+ }
+ ]
+ }
+ ]
+ },
+ "fenced_code_block_unknown": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?=([^`~]*)?$)",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "4": {
+ "name": "fenced_code.block.language"
+ }
+ },
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "name": "markup.fenced_code.block.markdown"
+ },
+ "heading": {
+ "begin": "(?:^|\\G)[ ]{0,3}(#{1,6})\\s*(?=[\\S[^#]])",
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.heading.markdown"
+ }
+ },
+ "contentName": "entity.name.section.markdown",
+ "end": "\\s*(#{1,6})?$\\n?",
+ "name": "markup.heading.markdown",
+ "patterns": [
+ {
+ "include": "#inline"
+ }
+ ]
+ },
+ "heading-setext": {
+ "patterns": [
+ {
+ "match": "^(={3,})(?=[ \\t]*$\\n?)",
+ "name": "markup.heading.setext.1.markdown"
+ },
+ {
+ "match": "^(-{3,})(?=[ \\t]*$\\n?)",
+ "name": "markup.heading.setext.2.markdown"
+ }
+ ]
+ },
+ "html": {
+ "patterns": [
+ {
+ "begin": "(^|\\G)\\s*()",
+ "name": "comment.block.html"
+ },
+ {
+ "begin":
+ "(^|\\G)\\s*(?=<(script|style|pre)(\\s|$|>)(?!.*?(script|style|pre)>))",
+ "end": "(?=.*(script|style|pre)>)",
+ "patterns": [
+ {
+ "begin": "(\\s*|$)",
+ "patterns": [
+ {
+ "include": "text.html.basic"
+ }
+ ],
+ "while": "^(?!.*(script|style|pre)>)"
+ }
+ ]
+ },
+ {
+ "begin":
+ "(^|\\G)\\s*(?=?(address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(\\s|$|/?>))",
+ "patterns": [
+ {
+ "include": "text.html.basic"
+ }
+ ],
+ "while": "^(?!\\s*$)"
+ },
+ {
+ "begin":
+ "(^|\\G)\\s*(?=(<[a-zA-Z0-9\\-](/?>|\\s.*?>)|[a-zA-Z0-9\\-]>)\\s*$)",
+ "patterns": [
+ {
+ "include": "text.html.basic"
+ }
+ ],
+ "while": "^(?!\\s*$)"
+ }
+ ]
+ },
+ "link-def": {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.constant.markdown"
+ },
+ "2": {
+ "name": "constant.other.reference.link.markdown"
+ },
+ "3": {
+ "name": "punctuation.definition.constant.markdown"
+ },
+ "4": {
+ "name": "punctuation.separator.key-value.markdown"
+ },
+ "5": {
+ "name": "punctuation.definition.link.markdown"
+ },
+ "6": {
+ "name": "markup.underline.link.markdown"
+ },
+ "7": {
+ "name": "punctuation.definition.link.markdown"
+ },
+ "8": {
+ "name": "string.other.link.description.title.markdown"
+ },
+ "9": {
+ "name": "punctuation.definition.string.begin.markdown"
+ },
+ "10": {
+ "name": "punctuation.definition.string.end.markdown"
+ },
+ "11": {
+ "name": "string.other.link.description.title.markdown"
+ },
+ "12": {
+ "name": "punctuation.definition.string.begin.markdown"
+ },
+ "13": {
+ "name": "punctuation.definition.string.end.markdown"
+ }
+ },
+ "match":
+ "(?x)\n \\s* # Leading whitespace\n (\\[)(.+?)(\\])(:) # Reference name\n [ \\t]* # Optional whitespace\n ()(\\S+?)(>?) # The url\n [ \\t]* # Optional whitespace\n (?:\n ((\\().+?(\\))) # Match title in quotes…\n | ((\").+?(\")) # or in parens.\n )? # Title is optional\n \\s* # Optional whitespace\n $\n",
+ "name": "meta.link.reference.def.markdown"
+ },
+ "list_paragraph": {
+ "begin": "(^|\\G)(?=\\S)(?![*+->]\\s|[0-9]+\\.\\s)",
+ "name": "meta.paragraph.markdown",
+ "patterns": [
+ {
+ "include": "#inline"
+ },
+ {
+ "include": "text.html.basic"
+ },
+ {
+ "include": "#heading-setext"
+ }
+ ],
+ "while":
+ "(^|\\G)(?!\\s*$|#|[ ]{0,3}([-*_>][ ]{2,}){3,}[ \\t]*$\\n?|[ ]{0,3}[*+->]|[ ]{0,3}[0-9]+\\.)"
+ },
+ "lists": {
+ "patterns": [
+ {
+ "begin": "(^|\\G)([ ]{0,3})([*+-])([ ]{1,3}|\\t)",
+ "beginCaptures": {
+ "3": {
+ "name": "beginning.punctuation.definition.list.markdown"
+ }
+ },
+ "comment": "Currently does not support un-indented second lines.",
+ "name": "markup.list.unnumbered.markdown",
+ "patterns": [
+ {
+ "include": "#block"
+ },
+ {
+ "include": "#list_paragraph"
+ }
+ ],
+ "while": "((^|\\G)([ ]{4}|\\t))|(^[ \\t]*$)"
+ },
+ {
+ "begin": "(^|\\G)([ ]{0,3})([0-9]+\\.)([ ]{1,3}|\\t)",
+ "beginCaptures": {
+ "3": {
+ "name": "beginning.punctuation.definition.list.markdown"
+ }
+ },
+ "name": "markup.list.numbered.markdown",
+ "patterns": [
+ {
+ "include": "#block"
+ },
+ {
+ "include": "#list_paragraph"
+ }
+ ],
+ "while": "((^|\\G)([ ]{4}|\\t))|(^[ \\t]*$)"
+ }
+ ]
+ },
+ "paragraph": {
+ "begin": "(^|\\G)[ ]{0,3}(?=\\S)",
+ "name": "meta.paragraph.markdown",
+ "patterns": [
+ {
+ "include": "#inline"
+ },
+ {
+ "include": "text.html.basic"
+ },
+ {
+ "include": "#heading-setext"
+ }
+ ],
+ "while": "(^|\\G)((?=\\s*[-=]{3,}\\s*$)|[ ]{4,}(?=\\S))"
+ },
+ "raw_block": {
+ "begin": "(^|\\G)([ ]{4}|\\t)",
+ "name": "markup.raw.block.markdown",
+ "while": "(^|\\G)([ ]{4}|\\t)"
+ },
+ "separator": {
+ "match": "(^|\\G)[ ]{0,3}([*-_])([ ]{0,2}\\2){2,}[ \\t]*$\\n?",
+ "name": "meta.separator.markdown"
+ }
+ }
+ },
+ "frontMatter": {
+ "begin": "\\A-{3}\\s*$",
+ "contentName": "meta.embedded.block.frontmatter",
+ "patterns": [
+ {
+ "include": "source.yaml"
+ }
+ ],
+ "while": "^(?!(-{3}|\\.{3})\\s*$)"
+ },
+ "inline": {
+ "patterns": [
+ {
+ "include": "#ampersand"
+ },
+ {
+ "include": "#bracket"
+ },
+ {
+ "include": "#bold"
+ },
+ {
+ "include": "#italic"
+ },
+ {
+ "include": "#raw"
+ },
+ {
+ "include": "#escape"
+ },
+ {
+ "include": "#image-inline"
+ },
+ {
+ "include": "#image-ref"
+ },
+ {
+ "include": "#link-email"
+ },
+ {
+ "include": "#link-inet"
+ },
+ {
+ "include": "#link-inline"
+ },
+ {
+ "include": "#link-ref"
+ },
+ {
+ "include": "#link-ref-literal"
+ }
+ ],
+ "repository": {
+ "ampersand": {
+ "comment":
+ "Markdown will convert this for us. We match it so that the HTML grammar will not mark it up as invalid.",
+ "match": "&(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)",
+ "name": "meta.other.valid-ampersand.markdown"
+ },
+ "bold": {
+ "begin":
+ "(?x)\n ((?]*+> # HTML tags\n | (?`+)([^`]|(?!(?(?!`))`)*+\\k\n # Raw\n | \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+ # Escapes\n | \\[\n (\n (? # Named group\n [^\\[\\]\\\\] # Match most chars\n | \\\\. # Escaped chars\n | \\[ \\g*+ \\] # Nested brackets\n )*+\n \\]\n (\n ( # Reference Link\n [ ]? # Optional space\n \\[[^\\]]*+\\] # Ref name\n )\n | ( # Inline Link\n \\( # Opening paren\n [ \\t]*+ # Optional whitespace\n (.*?)>? # URL\n [ \\t]*+ # Optional whitespace\n ( # Optional Title\n (?['\"])\n (.*?)\n \\k\n )?\n \\)\n )\n )\n )\n | (?!(?<=\\S)\\1). # Everything besides\n # style closer\n )++\n (?<=\\S)\\1 # Close\n )\n",
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.bold.markdown"
+ }
+ },
+ "end": "(?<=\\S)(\\1)",
+ "name": "markup.bold.markdown",
+ "patterns": [
+ {
+ "applyEndPatternLast": 1,
+ "begin": "(?=<[^>]*?>)",
+ "end": "(?<=>)",
+ "patterns": [
+ {
+ "include": "text.html.basic"
+ }
+ ]
+ },
+ {
+ "include": "#escape"
+ },
+ {
+ "include": "#ampersand"
+ },
+ {
+ "include": "#bracket"
+ },
+ {
+ "include": "#raw"
+ },
+ {
+ "include": "#bold"
+ },
+ {
+ "include": "#italic"
+ },
+ {
+ "include": "#image-inline"
+ },
+ {
+ "include": "#link-inline"
+ },
+ {
+ "include": "#link-inet"
+ },
+ {
+ "include": "#link-email"
+ },
+ {
+ "include": "#image-ref"
+ },
+ {
+ "include": "#link-ref-literal"
+ },
+ {
+ "include": "#link-ref"
+ }
+ ]
+ },
+ "bracket": {
+ "comment":
+ "Markdown will convert this for us. We match it so that the HTML grammar will not mark it up as invalid.",
+ "match": "<(?![a-z/?\\$!])",
+ "name": "meta.other.valid-bracket.markdown"
+ },
+ "escape": {
+ "match": "\\\\[-`*_#+.!(){}\\[\\]\\\\>]",
+ "name": "constant.character.escape.markdown"
+ },
+ "image-inline": {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.string.begin.markdown"
+ },
+ "2": {
+ "name": "string.other.link.description.markdown"
+ },
+ "4": {
+ "name": "punctuation.definition.string.end.markdown"
+ },
+ "5": {
+ "name": "punctuation.definition.metadata.markdown"
+ },
+ "6": {
+ "name": "punctuation.definition.link.markdown"
+ },
+ "7": {
+ "name": "markup.underline.link.image.markdown"
+ },
+ "8": {
+ "name": "punctuation.definition.link.markdown"
+ },
+ "9": {
+ "name": "string.other.link.description.title.markdown"
+ },
+ "10": {
+ "name": "punctuation.definition.string.markdown"
+ },
+ "11": {
+ "name": "punctuation.definition.string.markdown"
+ },
+ "12": {
+ "name": "string.other.link.description.title.markdown"
+ },
+ "13": {
+ "name": "punctuation.definition.string.markdown"
+ },
+ "14": {
+ "name": "punctuation.definition.string.markdown"
+ },
+ "15": {
+ "name": "punctuation.definition.metadata.markdown"
+ }
+ },
+ "match":
+ "(?x)\n (\\!\\[)((?[^\\[\\]\\\\]|\\\\.|\\[\\g*+\\])*+)(\\])\n # Match the link text.\n (\\() # Opening paren for url\n ()(\\S+?)(>?) # The url\n [ \\t]* # Optional whitespace\n (?:\n ((\\().+?(\\))) # Match title in parens…\n | ((\").+?(\")) # or in quotes.\n )? # Title is optional\n \\s* # Optional whitespace\n (\\))\n",
+ "name": "meta.image.inline.markdown"
+ },
+ "image-ref": {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.string.begin.markdown"
+ },
+ "2": {
+ "name": "string.other.link.description.markdown"
+ },
+ "4": {
+ "name": "punctuation.definition.string.begin.markdown"
+ },
+ "5": {
+ "name": "punctuation.definition.constant.markdown"
+ },
+ "6": {
+ "name": "constant.other.reference.link.markdown"
+ },
+ "7": {
+ "name": "punctuation.definition.constant.markdown"
+ }
+ },
+ "match":
+ "(\\!\\[)((?[^\\[\\]\\\\]|\\\\.|\\[\\g*+\\])*+)(\\])[ ]?(\\[)(.*?)(\\])",
+ "name": "meta.image.reference.markdown"
+ },
+ "italic": {
+ "begin":
+ "(?x) (\\*\\b|\\b_)(?=\\S) # Open\n (?=\n (\n <[^>]*+> # HTML tags\n | (?`+)([^`]|(?!(?(?!`))`)*+\\k\n # Raw\n | \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+ # Escapes\n | \\[\n (\n (? # Named group\n [^\\[\\]\\\\] # Match most chars\n | \\\\. # Escaped chars\n | \\[ \\g*+ \\] # Nested brackets\n )*+\n \\]\n (\n ( # Reference Link\n [ ]? # Optional space\n \\[[^\\]]*+\\] # Ref name\n )\n | ( # Inline Link\n \\( # Opening paren\n [ \\t]*+ # Optional whtiespace\n (.*?)>? # URL\n [ \\t]*+ # Optional whtiespace\n ( # Optional Title\n (?['\"])\n (.*?)\n \\k\n )?\n \\)\n )\n )\n )\n | \\1\\1 # Must be bold closer\n | (?!(?<=\\S)\\1). # Everything besides\n # style closer\n )++\n (?<=\\S)\\1 # Close\n )\n",
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.italic.markdown"
+ }
+ },
+ "end": "(?<=\\S)(\\1)((?!\\1)|(?=\\1\\1))",
+ "name": "markup.italic.markdown",
+ "patterns": [
+ {
+ "applyEndPatternLast": 1,
+ "begin": "(?=<[^>]*?>)",
+ "end": "(?<=>)",
+ "patterns": [
+ {
+ "include": "text.html.basic"
+ }
+ ]
+ },
+ {
+ "include": "#escape"
+ },
+ {
+ "include": "#ampersand"
+ },
+ {
+ "include": "#bracket"
+ },
+ {
+ "include": "#raw"
+ },
+ {
+ "include": "#bold"
+ },
+ {
+ "include": "#image-inline"
+ },
+ {
+ "include": "#link-inline"
+ },
+ {
+ "include": "#link-inet"
+ },
+ {
+ "include": "#link-email"
+ },
+ {
+ "include": "#image-ref"
+ },
+ {
+ "include": "#link-ref-literal"
+ },
+ {
+ "include": "#link-ref"
+ }
+ ]
+ },
+ "link-email": {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.link.markdown"
+ },
+ "2": {
+ "name": "markup.underline.link.markdown"
+ },
+ "4": {
+ "name": "punctuation.definition.link.markdown"
+ }
+ },
+ "match": "(<)((?:mailto:)?[-.\\w]+@[-a-z0-9]+(\\.[-a-z0-9]+)*\\.[a-z]+)(>)",
+ "name": "meta.link.email.lt-gt.markdown"
+ },
+ "link-inet": {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.link.markdown"
+ },
+ "2": {
+ "name": "markup.underline.link.markdown"
+ },
+ "3": {
+ "name": "punctuation.definition.link.markdown"
+ }
+ },
+ "match": "(<)((?:https?|ftp)://.*?)(>)",
+ "name": "meta.link.inet.markdown"
+ },
+ "link-inline": {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.string.begin.markdown"
+ },
+ "2": {
+ "name": "string.other.link.title.markdown"
+ },
+ "4": {
+ "name": "punctuation.definition.string.end.markdown"
+ },
+ "5": {
+ "name": "punctuation.definition.metadata.markdown"
+ },
+ "6": {
+ "name": "punctuation.definition.link.markdown"
+ },
+ "7": {
+ "name": "markup.underline.link.markdown"
+ },
+ "8": {
+ "name": "punctuation.definition.link.markdown"
+ },
+ "9": {
+ "name": "string.other.link.description.title.markdown"
+ },
+ "10": {
+ "name": "punctuation.definition.string.begin.markdown"
+ },
+ "11": {
+ "name": "punctuation.definition.string.end.markdown"
+ },
+ "12": {
+ "name": "string.other.link.description.title.markdown"
+ },
+ "13": {
+ "name": "punctuation.definition.string.begin.markdown"
+ },
+ "14": {
+ "name": "punctuation.definition.string.end.markdown"
+ },
+ "15": {
+ "name": "punctuation.definition.metadata.markdown"
+ }
+ },
+ "match":
+ "(?x)\n (\\[)((?[^\\[\\]\\\\]|\\\\.|\\[\\g*+\\])*+)(\\])\n # Match the link text.\n (\\() # Opening paren for url\n ()(.*?)(>?) # The url\n [ \\t]* # Optional whitespace\n (?:\n ((\\().+?(\\))) # Match title in parens…\n | ((\").+?(\")) # or in quotes.\n )? # Title is optional\n \\s* # Optional whitespace\n (\\))\n",
+ "name": "meta.link.inline.markdown"
+ },
+ "link-ref": {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.string.begin.markdown"
+ },
+ "2": {
+ "name": "string.other.link.title.markdown"
+ },
+ "4": {
+ "name": "punctuation.definition.string.end.markdown"
+ },
+ "5": {
+ "name": "punctuation.definition.constant.begin.markdown"
+ },
+ "6": {
+ "name": "constant.other.reference.link.markdown"
+ },
+ "7": {
+ "name": "punctuation.definition.constant.end.markdown"
+ }
+ },
+ "match":
+ "(\\[)((?[^\\[\\]\\\\]|\\\\.|\\[\\g*+\\])*+)(\\])(\\[)([^\\]]*+)(\\])",
+ "name": "meta.link.reference.markdown"
+ },
+ "link-ref-literal": {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.string.begin.markdown"
+ },
+ "2": {
+ "name": "string.other.link.title.markdown"
+ },
+ "4": {
+ "name": "punctuation.definition.string.end.markdown"
+ },
+ "5": {
+ "name": "punctuation.definition.constant.begin.markdown"
+ },
+ "6": {
+ "name": "punctuation.definition.constant.end.markdown"
+ }
+ },
+ "match":
+ "(\\[)((?[^\\[\\]\\\\]|\\\\.|\\[\\g*+\\])*+)(\\])[ ]?(\\[)(\\])",
+ "name": "meta.link.reference.literal.markdown"
+ },
+ "raw": {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.raw.markdown"
+ },
+ "3": {
+ "name": "punctuation.definition.raw.markdown"
+ }
+ },
+ "match": "(`+)([^`]|(?!(?)",
+ "name": "meta.id-with-protocol.objc",
+ "patterns": [
+ {
+ "include": "#protocol_list"
+ }
+ ]
+ },
+ {
+ "match": "\\b(NS_DURING|NS_HANDLER|NS_ENDHANDLER)\\b",
+ "name": "keyword.control.macro.objc"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.keyword.objc"
+ }
+ },
+ "match": "(@)(try|catch|finally|throw)\\b",
+ "name": "keyword.control.exception.objc"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.keyword.objc"
+ }
+ },
+ "match": "(@)(synchronized)\\b",
+ "name": "keyword.control.synchronize.objc"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.keyword.objc"
+ }
+ },
+ "match": "(@)(required|optional)\\b",
+ "name": "keyword.control.protocol-specification.objc"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.keyword.objc"
+ }
+ },
+ "match": "(@)(defs|encode)\\b",
+ "name": "keyword.other.objc"
+ },
+ {
+ "match": "\\bid\\b",
+ "name": "storage.type.id.objc"
+ },
+ {
+ "match": "\\b(IBOutlet|IBAction|BOOL|SEL|id|unichar|IMP|Class|instancetype)\\b",
+ "name": "storage.type.objc"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.storage.type.objc"
+ }
+ },
+ "match": "(@)(class|protocol)\\b",
+ "name": "storage.type.objc"
+ },
+ {
+ "begin": "((@)selector)\\s*(\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.type.objc"
+ },
+ "2": {
+ "name": "punctuation.definition.storage.type.objc"
+ },
+ "3": {
+ "name": "punctuation.definition.storage.type.objc"
+ }
+ },
+ "contentName": "meta.selector.method-name.objc",
+ "end": "(\\))",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.definition.storage.type.objc"
+ }
+ },
+ "name": "meta.selector.objc",
+ "patterns": [
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.separator.arguments.objc"
+ }
+ },
+ "match": "\\b(?:[a-zA-Z_:][\\w]*)+",
+ "name": "support.function.any-method.name-of-parameter.objc"
+ }
+ ]
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.storage.modifier.objc"
+ }
+ },
+ "match": "(@)(synchronized|public|package|private|protected)\\b",
+ "name": "storage.modifier.objc"
+ },
+ {
+ "match": "\\b(YES|NO|Nil|nil)\\b",
+ "name": "constant.language.objc"
+ },
+ {
+ "match": "\\bNSApp\\b",
+ "name": "support.variable.foundation"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.whitespace.support.function.cocoa.leopard"
+ },
+ "2": {
+ "name": "support.function.cocoa.leopard"
+ }
+ },
+ "match":
+ "(\\s*)\\b(NS(Rect(ToCGRect|FromCGRect)|MakeCollectable|S(tringFromProtocol|ize(ToCGSize|FromCGSize))|Draw(NinePartImage|ThreePartImage)|P(oint(ToCGPoint|FromCGPoint)|rotocolFromString)|EventMaskFromType|Value))\\b"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.whitespace.support.function.leading.cocoa"
+ },
+ "2": {
+ "name": "support.function.cocoa"
+ }
+ },
+ "match":
+ "(\\s*)\\b(NS(R(ound(DownToMultipleOfPageSize|UpToMultipleOfPageSize)|un(CriticalAlertPanel(RelativeToWindow)?|InformationalAlertPanel(RelativeToWindow)?|AlertPanel(RelativeToWindow)?)|e(set(MapTable|HashTable)|c(ycleZone|t(Clip(List)?|F(ill(UsingOperation|List(UsingOperation|With(Grays|Colors(UsingOperation)?))?)?|romString))|ordAllocationEvent)|turnAddress|leaseAlertPanel|a(dPixel|l(MemoryAvailable|locateCollectable))|gisterServicesProvider)|angeFromString)|Get(SizeAndAlignment|CriticalAlertPanel|InformationalAlertPanel|UncaughtExceptionHandler|FileType(s)?|WindowServerMemory|AlertPanel)|M(i(n(X|Y)|d(X|Y))|ouseInRect|a(p(Remove|Get|Member|Insert(IfAbsent|KnownAbsent)?)|ke(R(ect|ange)|Size|Point)|x(Range|X|Y)))|B(itsPer(SampleFromDepth|PixelFromDepth)|e(stDepth|ep|gin(CriticalAlertSheet|InformationalAlertSheet|AlertSheet)))|S(ho(uldRetainWithZone|w(sServicesMenuItem|AnimationEffect))|tringFrom(R(ect|ange)|MapTable|S(ize|elector)|HashTable|Class|Point)|izeFromString|e(t(ShowsServicesMenuItem|ZoneName|UncaughtExceptionHandler|FocusRingStyle)|lectorFromString|archPathForDirectoriesInDomains)|wap(Big(ShortToHost|IntToHost|DoubleToHost|FloatToHost|Long(ToHost|LongToHost))|Short|Host(ShortTo(Big|Little)|IntTo(Big|Little)|DoubleTo(Big|Little)|FloatTo(Big|Little)|Long(To(Big|Little)|LongTo(Big|Little)))|Int|Double|Float|L(ittle(ShortToHost|IntToHost|DoubleToHost|FloatToHost|Long(ToHost|LongToHost))|ong(Long)?)))|H(ighlightRect|o(stByteOrder|meDirectory(ForUser)?)|eight|ash(Remove|Get|Insert(IfAbsent|KnownAbsent)?)|FSType(CodeFromFileType|OfFile))|N(umberOfColorComponents|ext(MapEnumeratorPair|HashEnumeratorItem))|C(o(n(tainsRect|vert(GlyphsToPackedGlyphs|Swapped(DoubleToHost|FloatToHost)|Host(DoubleToSwapped|FloatToSwapped)))|unt(MapTable|HashTable|Frames|Windows(ForContext)?)|py(M(emoryPages|apTableWithZone)|Bits|HashTableWithZone|Object)|lorSpaceFromDepth|mpare(MapTables|HashTables))|lassFromString|reate(MapTable(WithZone)?|HashTable(WithZone)?|Zone|File(namePboardType|ContentsPboardType)))|TemporaryDirectory|I(s(ControllerMarker|EmptyRect|FreedObject)|n(setRect|crementExtraRefCount|te(r(sect(sRect|ionR(ect|ange))|faceStyleForKey)|gralRect)))|Zone(Realloc|Malloc|Name|Calloc|Fr(omPointer|ee))|O(penStepRootDirectory|ffsetRect)|D(i(sableScreenUpdates|videRect)|ottedFrameRect|e(c(imal(Round|Multiply|S(tring|ubtract)|Normalize|Co(py|mpa(ct|re))|IsNotANumber|Divide|Power|Add)|rementExtraRefCountWasZero)|faultMallocZone|allocate(MemoryPages|Object))|raw(Gr(oove|ayBezel)|B(itmap|utton)|ColorTiledRects|TiledRects|DarkBezel|W(hiteBezel|indowBackground)|LightBezel))|U(serName|n(ionR(ect|ange)|registerServicesProvider)|pdateDynamicServices)|Java(Bundle(Setup|Cleanup)|Setup(VirtualMachine)?|Needs(ToLoadClasses|VirtualMachine)|ClassesF(orBundle|romPath)|ObjectNamedInPath|ProvidesClasses)|P(oint(InRect|FromString)|erformService|lanarFromDepth|ageSize)|E(n(d(MapTableEnumeration|HashTableEnumeration)|umerate(MapTable|HashTable)|ableScreenUpdates)|qual(R(ects|anges)|Sizes|Points)|raseRect|xtraRefCount)|F(ileTypeForHFSTypeCode|ullUserName|r(ee(MapTable|HashTable)|ame(Rect(WithWidth(UsingOperation)?)?|Address)))|Wi(ndowList(ForContext)?|dth)|Lo(cationInRange|g(v|PageSize)?)|A(ccessibility(R(oleDescription(ForUIElement)?|aiseBadArgumentException)|Unignored(Children(ForOnlyChild)?|Descendant|Ancestor)|PostNotification|ActionDescription)|pplication(Main|Load)|vailableWindowDepths|ll(MapTable(Values|Keys)|HashTableObjects|ocate(MemoryPages|Collectable|Object)))))\\b"
+ },
+ {
+ "match":
+ "\\bNS(RuleEditor|G(arbageCollector|radient)|MapTable|HashTable|Co(ndition|llectionView(Item)?)|T(oolbarItemGroup|extInputClient|r(eeNode|ackingArea))|InvocationOperation|Operation(Queue)?|D(ictionaryController|ockTile)|P(ointer(Functions|Array)|athC(o(ntrol(Delegate)?|mponentCell)|ell(Delegate)?)|r(intPanelAccessorizing|edicateEditor(RowTemplate)?))|ViewController|FastEnumeration|Animat(ionContext|ablePropertyContainer))\\b",
+ "name": "support.class.cocoa.leopard"
+ },
+ {
+ "match":
+ "\\bNS(R(u(nLoop|ler(Marker|View))|e(sponder|cursiveLock|lativeSpecifier)|an(domSpecifier|geSpecifier))|G(etCommand|lyph(Generator|Storage|Info)|raphicsContext)|XML(Node|D(ocument|TD(Node)?)|Parser|Element)|M(iddleSpecifier|ov(ie(View)?|eCommand)|utable(S(tring|et)|C(haracterSet|opying)|IndexSet|D(ictionary|ata)|URLRequest|ParagraphStyle|A(ttributedString|rray))|e(ssagePort(NameServer)?|nu(Item(Cell)?|View)?|t(hodSignature|adata(Item|Query(ResultGroup|AttributeValueTuple)?)))|a(ch(BootstrapServer|Port)|trix))|B(itmapImageRep|ox|u(ndle|tton(Cell)?)|ezierPath|rowser(Cell)?)|S(hadow|c(anner|r(ipt(SuiteRegistry|C(o(ercionHandler|mmand(Description)?)|lassDescription)|ObjectSpecifier|ExecutionContext|WhoseTest)|oll(er|View)|een))|t(epper(Cell)?|atus(Bar|Item)|r(ing|eam))|imple(HorizontalTypesetter|CString)|o(cketPort(NameServer)?|und|rtDescriptor)|p(e(cifierTest|ech(Recognizer|Synthesizer)|ll(Server|Checker))|litView)|e(cureTextField(Cell)?|t(Command)?|archField(Cell)?|rializer|gmentedC(ontrol|ell))|lider(Cell)?|avePanel)|H(ost|TTP(Cookie(Storage)?|URLResponse)|elpManager)|N(ib(Con(nector|trolConnector)|OutletConnector)?|otification(Center|Queue)?|u(ll|mber(Formatter)?)|etService(Browser)?|ameSpecifier)|C(ha(ngeSpelling|racterSet)|o(n(stantString|nection|trol(ler)?|ditionLock)|d(ing|er)|unt(Command|edSet)|pying|lor(Space|P(ick(ing(Custom|Default)|er)|anel)|Well|List)?|m(p(oundPredicate|arisonPredicate)|boBox(Cell)?))|u(stomImageRep|rsor)|IImageRep|ell|l(ipView|o(seCommand|neCommand)|assDescription)|a(ched(ImageRep|URLResponse)|lendar(Date)?)|reateCommand)|T(hread|ypesetter|ime(Zone|r)|o(olbar(Item(Validations)?)?|kenField(Cell)?)|ext(Block|Storage|Container|Tab(le(Block)?)?|Input|View|Field(Cell)?|List|Attachment(Cell)?)?|a(sk|b(le(Header(Cell|View)|Column|View)|View(Item)?))|reeController)|I(n(dex(S(pecifier|et)|Path)|put(Manager|S(tream|erv(iceProvider|er(MouseTracker)?)))|vocation)|gnoreMisspelledWords|mage(Rep|Cell|View)?)|O(ut(putStream|lineView)|pen(GL(Context|Pixel(Buffer|Format)|View)|Panel)|bj(CTypeSerializationCallBack|ect(Controller)?))|D(i(st(antObject(Request)?|ributed(NotificationCenter|Lock))|ctionary|rectoryEnumerator)|ocument(Controller)?|e(serializer|cimalNumber(Behaviors|Handler)?|leteCommand)|at(e(Components|Picker(Cell)?|Formatter)?|a)|ra(wer|ggingInfo))|U(ser(InterfaceValidations|Defaults(Controller)?)|RL(Re(sponse|quest)|Handle(Client)?|C(onnection|ache|redential(Storage)?)|Download(Delegate)?|Prot(ocol(Client)?|ectionSpace)|AuthenticationChallenge(Sender)?)?|n(iqueIDSpecifier|doManager|archiver))|P(ipe|o(sitionalSpecifier|pUpButton(Cell)?|rt(Message|NameServer|Coder)?)|ICTImageRep|ersistentDocument|DFImageRep|a(steboard|nel|ragraphStyle|geLayout)|r(int(Info|er|Operation|Panel)|o(cessInfo|tocolChecker|perty(Specifier|ListSerialization)|gressIndicator|xy)|edicate))|E(numerator|vent|PSImageRep|rror|x(ception|istsCommand|pression))|V(iew(Animation)?|al(idated(ToobarItem|UserInterfaceItem)|ue(Transformer)?))|Keyed(Unarchiver|Archiver)|Qui(ckDrawView|tCommand)|F(ile(Manager|Handle|Wrapper)|o(nt(Manager|Descriptor|Panel)?|rm(Cell|atter)))|W(hoseSpecifier|indow(Controller)?|orkspace)|L(o(c(k(ing)?|ale)|gicalTest)|evelIndicator(Cell)?|ayoutManager)|A(ssertionHandler|nimation|ctionCell|ttributedString|utoreleasePool|TSTypesetter|ppl(ication|e(Script|Event(Manager|Descriptor)))|ffineTransform|lert|r(chiver|ray(Controller)?)))\\b",
+ "name": "support.class.cocoa"
+ },
+ {
+ "match":
+ "\\bNS(R(oundingMode|ule(Editor(RowType|NestingMode)|rOrientation)|e(questUserAttentionType|lativePosition))|G(lyphInscription|radientDrawingOptions)|XML(NodeKind|D(ocumentContentKind|TDNodeKind)|ParserError)|M(ultibyteGlyphPacking|apTableOptions)|B(itmapFormat|oxType|ezierPathElement|ackgroundStyle|rowserDropOperation)|S(tr(ing(CompareOptions|DrawingOptions|EncodingConversionOptions)|eam(Status|Event))|p(eechBoundary|litViewDividerStyle)|e(archPathD(irectory|omainMask)|gmentS(tyle|witchTracking))|liderType|aveOptions)|H(TTPCookieAcceptPolicy|ashTableOptions)|N(otification(SuspensionBehavior|Coalescing)|umberFormatter(RoundingMode|Behavior|Style|PadPosition)|etService(sError|Options))|C(haracterCollection|o(lor(RenderingIntent|SpaceModel|PanelMode)|mp(oundPredicateType|arisonPredicateModifier))|ellStateValue|al(culationError|endarUnit))|T(ypesetterControlCharacterAction|imeZoneNameStyle|e(stComparisonOperation|xt(Block(Dimension|V(erticalAlignment|alueType)|Layer)|TableLayoutAlgorithm|FieldBezelStyle))|ableView(SelectionHighlightStyle|ColumnAutoresizingStyle)|rackingAreaOptions)|I(n(sertionPosition|te(rfaceStyle|ger))|mage(RepLoadStatus|Scaling|CacheMode|FrameStyle|LoadStatus|Alignment))|Ope(nGLPixelFormatAttribute|rationQueuePriority)|Date(Picker(Mode|Style)|Formatter(Behavior|Style))|U(RL(RequestCachePolicy|HandleStatus|C(acheStoragePolicy|redentialPersistence))|Integer)|P(o(stingStyle|int(ingDeviceType|erFunctionsOptions)|pUpArrowPosition)|athStyle|r(int(ing(Orientation|PaginationMode)|erTableStatus|PanelOptions)|opertyList(MutabilityOptions|Format)|edicateOperatorType))|ExpressionType|KeyValue(SetMutationKind|Change)|QTMovieLoopMode|F(indPanel(SubstringMatchType|Action)|o(nt(RenderingMode|FamilyClass)|cusRingPlacement))|W(hoseSubelementIdentifier|ind(ingRule|ow(B(utton|ackingLocation)|SharingType|CollectionBehavior)))|L(ine(MovementDirection|SweepDirection|CapStyle|JoinStyle)|evelIndicatorStyle)|Animation(BlockingMode|Curve))\\b",
+ "name": "support.type.cocoa.leopard"
+ },
+ {
+ "match":
+ "\\bC(I(Sampler|Co(ntext|lor)|Image(Accumulator)?|PlugIn(Registration)?|Vector|Kernel|Filter(Generator|Shape)?)|A(Renderer|MediaTiming(Function)?|BasicAnimation|ScrollLayer|Constraint(LayoutManager)?|T(iledLayer|extLayer|rans(ition|action))|OpenGLLayer|PropertyAnimation|KeyframeAnimation|Layer|A(nimation(Group)?|ction)))\\b",
+ "name": "support.class.quartz"
+ },
+ {
+ "match": "\\bC(G(Float|Point|Size|Rect)|IFormat|AConstraintAttribute)\\b",
+ "name": "support.type.quartz"
+ },
+ {
+ "match":
+ "\\bNS(R(ect(Edge)?|ange)|G(lyph(Relation|LayoutMode)?|radientType)|M(odalSession|a(trixMode|p(Table|Enumerator)))|B(itmapImageFileType|orderType|uttonType|ezelStyle|ackingStoreType|rowserColumnResizingType)|S(cr(oll(er(Part|Arrow)|ArrowPosition)|eenAuxiliaryOpaque)|tringEncoding|ize|ocketNativeHandle|election(Granularity|Direction|Affinity)|wapped(Double|Float)|aveOperationType)|Ha(sh(Table|Enumerator)|ndler(2)?)|C(o(ntrol(Size|Tint)|mp(ositingOperation|arisonResult))|ell(State|Type|ImagePosition|Attribute))|T(hreadPrivate|ypesetterGlyphInfo|i(ckMarkPosition|tlePosition|meInterval)|o(ol(TipTag|bar(SizeMode|DisplayMode))|kenStyle)|IFFCompression|ext(TabType|Alignment)|ab(State|leViewDropOperation|ViewType)|rackingRectTag)|ImageInterpolation|Zone|OpenGL(ContextAuxiliary|PixelFormatAuxiliary)|D(ocumentChangeType|atePickerElementFlags|ra(werState|gOperation))|UsableScrollerParts|P(oint|r(intingPageOrder|ogressIndicator(Style|Th(ickness|readInfo))))|EventType|KeyValueObservingOptions|Fo(nt(SymbolicTraits|TraitMask|Action)|cusRingType)|W(indow(OrderingMode|Depth)|orkspace(IconCreationOptions|LaunchOptions)|ritingDirection)|L(ineBreakMode|ayout(Status|Direction))|A(nimation(Progress|Effect)|ppl(ication(TerminateReply|DelegateReply|PrintReply)|eEventManagerSuspensionID)|ffineTransformStruct|lertStyle))\\b",
+ "name": "support.type.cocoa"
+ },
+ {
+ "match": "\\bNS(NotFound|Ordered(Ascending|Descending|Same))\\b",
+ "name": "support.constant.cocoa"
+ },
+ {
+ "match": "\\bNS(MenuDidBeginTracking|ViewDidUpdateTrackingAreas)?Notification\\b",
+ "name": "support.constant.notification.cocoa.leopard"
+ },
+ {
+ "match":
+ "\\bNS(Menu(Did(RemoveItem|SendAction|ChangeItem|EndTracking|AddItem)|WillSendAction)|S(ystemColorsDidChange|plitView(DidResizeSubviews|WillResizeSubviews))|C(o(nt(extHelpModeDid(Deactivate|Activate)|rolT(intDidChange|extDid(BeginEditing|Change|EndEditing)))|lor(PanelColorDidChange|ListDidChange)|mboBox(Selection(IsChanging|DidChange)|Will(Dismiss|PopUp)))|lassDescriptionNeededForClass)|T(oolbar(DidRemoveItem|WillAddItem)|ext(Storage(DidProcessEditing|WillProcessEditing)|Did(BeginEditing|Change|EndEditing)|View(DidChange(Selection|TypingAttributes)|WillChangeNotifyingTextView))|ableView(Selection(IsChanging|DidChange)|ColumnDid(Resize|Move)))|ImageRepRegistryDidChange|OutlineView(Selection(IsChanging|DidChange)|ColumnDid(Resize|Move)|Item(Did(Collapse|Expand)|Will(Collapse|Expand)))|Drawer(Did(Close|Open)|Will(Close|Open))|PopUpButton(CellWillPopUp|WillPopUp)|View(GlobalFrameDidChange|BoundsDidChange|F(ocusDidChange|rameDidChange))|FontSetChanged|W(indow(Did(Resi(ze|gn(Main|Key))|M(iniaturize|ove)|Become(Main|Key)|ChangeScreen(|Profile)|Deminiaturize|Update|E(ndSheet|xpose))|Will(M(iniaturize|ove)|BeginSheet|Close))|orkspace(SessionDid(ResignActive|BecomeActive)|Did(Mount|TerminateApplication|Unmount|PerformFileOperation|Wake|LaunchApplication)|Will(Sleep|Unmount|PowerOff|LaunchApplication)))|A(ntialiasThresholdChanged|ppl(ication(Did(ResignActive|BecomeActive|Hide|ChangeScreenParameters|U(nhide|pdate)|FinishLaunching)|Will(ResignActive|BecomeActive|Hide|Terminate|U(nhide|pdate)|FinishLaunching))|eEventManagerWillProcessFirstEvent)))Notification\\b",
+ "name": "support.constant.notification.cocoa"
+ },
+ {
+ "match":
+ "\\bNS(RuleEditor(RowType(Simple|Compound)|NestingMode(Si(ngle|mple)|Compound|List))|GradientDraws(BeforeStartingLocation|AfterEndingLocation)|M(inusSetExpressionType|a(chPortDeallocate(ReceiveRight|SendRight|None)|pTable(StrongMemory|CopyIn|ZeroingWeakMemory|ObjectPointerPersonality)))|B(oxCustom|undleExecutableArchitecture(X86|I386|PPC(64)?)|etweenPredicateOperatorType|ackgroundStyle(Raised|Dark|L(ight|owered)))|S(tring(DrawingTruncatesLastVisibleLine|EncodingConversion(ExternalRepresentation|AllowLossy))|ubqueryExpressionType|p(e(ech(SentenceBoundary|ImmediateBoundary|WordBoundary)|llingState(GrammarFlag|SpellingFlag))|litViewDividerStyleThi(n|ck))|e(rvice(RequestTimedOutError|M(iscellaneousError|alformedServiceDictionaryError)|InvalidPasteboardDataError|ErrorM(inimum|aximum)|Application(NotFoundError|LaunchFailedError))|gmentStyle(Round(Rect|ed)|SmallSquare|Capsule|Textured(Rounded|Square)|Automatic)))|H(UDWindowMask|ashTable(StrongMemory|CopyIn|ZeroingWeakMemory|ObjectPointerPersonality))|N(oModeColorPanel|etServiceNoAutoRename)|C(hangeRedone|o(ntainsPredicateOperatorType|l(orRenderingIntent(RelativeColorimetric|Saturation|Default|Perceptual|AbsoluteColorimetric)|lectorDisabledOption))|ellHit(None|ContentArea|TrackableArea|EditableTextArea))|T(imeZoneNameStyle(S(hort(Standard|DaylightSaving)|tandard)|DaylightSaving)|extFieldDatePickerStyle|ableViewSelectionHighlightStyle(Regular|SourceList)|racking(Mouse(Moved|EnteredAndExited)|CursorUpdate|InVisibleRect|EnabledDuringMouseDrag|A(ssumeInside|ctive(In(KeyWindow|ActiveApp)|WhenFirstResponder|Always))))|I(n(tersectSetExpressionType|dexedColorSpaceModel)|mageScale(None|Proportionally(Down|UpOrDown)|AxesIndependently))|Ope(nGLPFAAllowOfflineRenderers|rationQueue(DefaultMaxConcurrentOperationCount|Priority(High|Normal|Very(High|Low)|Low)))|D(iacriticInsensitiveSearch|ownloadsDirectory)|U(nionSetExpressionType|TF(16(BigEndianStringEncoding|StringEncoding|LittleEndianStringEncoding)|32(BigEndianStringEncoding|StringEncoding|LittleEndianStringEncoding)))|P(ointerFunctions(Ma(chVirtualMemory|llocMemory)|Str(ongMemory|uctPersonality)|C(StringPersonality|opyIn)|IntegerPersonality|ZeroingWeakMemory|O(paque(Memory|Personality)|bjectP(ointerPersonality|ersonality)))|at(hStyle(Standard|NavigationBar|PopUp)|ternColorSpaceModel)|rintPanelShows(Scaling|Copies|Orientation|P(a(perSize|ge(Range|SetupAccessory))|review)))|Executable(RuntimeMismatchError|NotLoadableError|ErrorM(inimum|aximum)|L(inkError|oadError)|ArchitectureMismatchError)|KeyValueObservingOption(Initial|Prior)|F(i(ndPanelSubstringMatchType(StartsWith|Contains|EndsWith|FullWord)|leRead(TooLargeError|UnknownStringEncodingError))|orcedOrderingSearch)|Wi(ndow(BackingLocation(MainMemory|Default|VideoMemory)|Sharing(Read(Only|Write)|None)|CollectionBehavior(MoveToActiveSpace|CanJoinAllSpaces|Default))|dthInsensitiveSearch)|AggregateExpressionType)\\b",
+ "name": "support.constant.cocoa.leopard"
+ },
+ {
+ "match":
+ "\\bNS(R(GB(ModeColorPanel|ColorSpaceModel)|ight(Mouse(D(own(Mask)?|ragged(Mask)?)|Up(Mask)?)|T(ext(Movement|Alignment)|ab(sBezelBorder|StopType))|ArrowFunctionKey)|ound(RectBezelStyle|Bankers|ed(BezelStyle|TokenStyle|DisclosureBezelStyle)|Down|Up|Plain|Line(CapStyle|JoinStyle))|un(StoppedResponse|ContinuesResponse|AbortedResponse)|e(s(izableWindowMask|et(CursorRectsRunLoopOrdering|FunctionKey))|ce(ssedBezelStyle|iver(sCantHandleCommandScriptError|EvaluationScriptError))|turnTextMovement|doFunctionKey|quiredArgumentsMissingScriptError|l(evancyLevelIndicatorStyle|ative(Before|After))|gular(SquareBezelStyle|ControlSize)|moveTraitFontAction)|a(n(domSubelement|geDateMode)|tingLevelIndicatorStyle|dio(ModeMatrix|Button)))|G(IFFileType|lyph(Below|Inscribe(B(elow|ase)|Over(strike|Below)|Above)|Layout(WithPrevious|A(tAPoint|gainstAPoint))|A(ttribute(BidiLevel|Soft|Inscribe|Elastic)|bove))|r(ooveBorder|eaterThan(Comparison|OrEqualTo(Comparison|PredicateOperatorType)|PredicateOperatorType)|a(y(ModeColorPanel|ColorSpaceModel)|dient(None|Con(cave(Strong|Weak)|vex(Strong|Weak)))|phiteControlTint)))|XML(N(o(tationDeclarationKind|de(CompactEmptyElement|IsCDATA|OptionsNone|Use(SingleQuotes|DoubleQuotes)|Pre(serve(NamespaceOrder|C(haracterReferences|DATA)|DTD|Prefixes|E(ntities|mptyElements)|Quotes|Whitespace|A(ttributeOrder|ll))|ttyPrint)|ExpandEmptyElement))|amespaceKind)|CommentKind|TextKind|InvalidKind|D(ocument(X(MLKind|HTMLKind|Include)|HTMLKind|T(idy(XML|HTML)|extKind)|IncludeContentTypeDeclaration|Validate|Kind)|TDKind)|P(arser(GTRequiredError|XMLDeclNot(StartedError|FinishedError)|Mi(splaced(XMLDeclarationError|CDATAEndStringError)|xedContentDeclNot(StartedError|FinishedError))|S(t(andaloneValueError|ringNot(StartedError|ClosedError))|paceRequiredError|eparatorRequiredError)|N(MTOKENRequiredError|o(t(ationNot(StartedError|FinishedError)|WellBalancedError)|DTDError)|amespaceDeclarationError|AMERequiredError)|C(haracterRef(In(DTDError|PrologError|EpilogError)|AtEOFError)|o(nditionalSectionNot(StartedError|FinishedError)|mment(NotFinishedError|ContainsDoubleHyphenError))|DATANotFinishedError)|TagNameMismatchError|In(ternalError|valid(HexCharacterRefError|C(haracter(RefError|InEntityError|Error)|onditionalSectionError)|DecimalCharacterRefError|URIError|Encoding(NameError|Error)))|OutOfMemoryError|D(ocumentStartError|elegateAbortedParseError|OCTYPEDeclNotFinishedError)|U(RI(RequiredError|FragmentError)|n(declaredEntityError|parsedEntityError|knownEncodingError|finishedTagError))|P(CDATARequiredError|ublicIdentifierRequiredError|arsedEntityRef(MissingSemiError|NoNameError|In(Internal(SubsetError|Error)|PrologError|EpilogError)|AtEOFError)|r(ocessingInstructionNot(StartedError|FinishedError)|ematureDocumentEndError))|E(n(codingNotSupportedError|tity(Ref(In(DTDError|PrologError|EpilogError)|erence(MissingSemiError|WithoutNameError)|LoopError|AtEOFError)|BoundaryError|Not(StartedError|FinishedError)|Is(ParameterError|ExternalError)|ValueRequiredError))|qualExpectedError|lementContentDeclNot(StartedError|FinishedError)|xt(ernalS(tandaloneEntityError|ubsetNotFinishedError)|raContentError)|mptyDocumentError)|L(iteralNot(StartedError|FinishedError)|T(RequiredError|SlashRequiredError)|essThanSymbolInAttributeError)|Attribute(RedefinedError|HasNoValueError|Not(StartedError|FinishedError)|ListNot(StartedError|FinishedError)))|rocessingInstructionKind)|E(ntity(GeneralKind|DeclarationKind|UnparsedKind|P(ar(sedKind|ameterKind)|redefined))|lement(Declaration(MixedKind|UndefinedKind|E(lementKind|mptyKind)|Kind|AnyKind)|Kind))|Attribute(N(MToken(sKind|Kind)|otationKind)|CDATAKind|ID(Ref(sKind|Kind)|Kind)|DeclarationKind|En(tit(yKind|iesKind)|umerationKind)|Kind))|M(i(n(XEdge|iaturizableWindowMask|YEdge|uteCalendarUnit)|terLineJoinStyle|ddleSubelement|xedState)|o(nthCalendarUnit|deSwitchFunctionKey|use(Moved(Mask)?|E(ntered(Mask)?|ventSubtype|xited(Mask)?))|veToBezierPathElement|mentary(ChangeButton|Push(Button|InButton)|Light(Button)?))|enuFunctionKey|a(c(intoshInterfaceStyle|OSRomanStringEncoding)|tchesPredicateOperatorType|ppedRead|x(XEdge|YEdge))|ACHOperatingSystem)|B(MPFileType|o(ttomTabsBezelBorder|ldFontMask|rderlessWindowMask|x(Se(condary|parator)|OldStyle|Primary))|uttLineCapStyle|e(zelBorder|velLineJoinStyle|low(Bottom|Top)|gin(sWith(Comparison|PredicateOperatorType)|FunctionKey))|lueControlTint|ack(spaceCharacter|tabTextMovement|ingStore(Retained|Buffered|Nonretained)|TabCharacter|wardsSearch|groundTab)|r(owser(NoColumnResizing|UserColumnResizing|AutoColumnResizing)|eakFunctionKey))|S(h(ift(JISStringEncoding|KeyMask)|ow(ControlGlyphs|InvisibleGlyphs)|adowlessSquareBezelStyle)|y(s(ReqFunctionKey|tem(D(omainMask|efined(Mask)?)|FunctionKey))|mbolStringEncoding)|c(a(nnedOption|le(None|ToFit|Proportionally))|r(oll(er(NoPart|Increment(Page|Line|Arrow)|Decrement(Page|Line|Arrow)|Knob(Slot)?|Arrows(M(inEnd|axEnd)|None|DefaultSetting))|Wheel(Mask)?|LockFunctionKey)|eenChangedEventType))|t(opFunctionKey|r(ingDrawing(OneShot|DisableScreenFontSubstitution|Uses(DeviceMetrics|FontLeading|LineFragmentOrigin))|eam(Status(Reading|NotOpen|Closed|Open(ing)?|Error|Writing|AtEnd)|Event(Has(BytesAvailable|SpaceAvailable)|None|OpenCompleted|E(ndEncountered|rrorOccurred)))))|i(ngle(DateMode|UnderlineStyle)|ze(DownFontAction|UpFontAction))|olarisOperatingSystem|unOSOperatingSystem|pecialPageOrder|e(condCalendarUnit|lect(By(Character|Paragraph|Word)|i(ng(Next|Previous)|onAffinity(Downstream|Upstream))|edTab|FunctionKey)|gmentSwitchTracking(Momentary|Select(One|Any)))|quareLineCapStyle|witchButton|ave(ToOperation|Op(tions(Yes|No|Ask)|eration)|AsOperation)|mall(SquareBezelStyle|C(ontrolSize|apsFontMask)|IconButtonBezelStyle))|H(ighlightModeMatrix|SBModeColorPanel|o(ur(Minute(SecondDatePickerElementFlag|DatePickerElementFlag)|CalendarUnit)|rizontalRuler|meFunctionKey)|TTPCookieAcceptPolicy(Never|OnlyFromMainDocumentDomain|Always)|e(lp(ButtonBezelStyle|KeyMask|FunctionKey)|avierFontAction)|PUXOperatingSystem)|Year(MonthDa(yDatePickerElementFlag|tePickerElementFlag)|CalendarUnit)|N(o(n(StandardCharacterSetFontMask|ZeroWindingRule|activatingPanelMask|LossyASCIIStringEncoding)|Border|t(ification(SuspensionBehavior(Hold|Coalesce|D(eliverImmediately|rop))|NoCoalescing|CoalescingOn(Sender|Name)|DeliverImmediately|PostToAllSessions)|PredicateType|EqualToPredicateOperatorType)|S(cr(iptError|ollerParts)|ubelement|pecifierError)|CellMask|T(itle|opLevelContainersSpecifierError|abs(BezelBorder|NoBorder|LineBorder))|I(nterfaceStyle|mage)|UnderlineStyle|FontChangeAction)|u(ll(Glyph|CellType)|m(eric(Search|PadKeyMask)|berFormatter(Round(Half(Down|Up|Even)|Ceiling|Down|Up|Floor)|Behavior(10|Default)|S(cientificStyle|pellOutStyle)|NoStyle|CurrencyStyle|DecimalStyle|P(ercentStyle|ad(Before(Suffix|Prefix)|After(Suffix|Prefix))))))|e(t(Services(BadArgumentError|NotFoundError|C(ollisionError|ancelledError)|TimeoutError|InvalidError|UnknownError|ActivityInProgress)|workDomainMask)|wlineCharacter|xt(StepInterfaceStyle|FunctionKey))|EXTSTEPStringEncoding|a(t(iveShortGlyphPacking|uralTextAlignment)|rrowFontMask))|C(hange(ReadOtherContents|GrayCell(Mask)?|BackgroundCell(Mask)?|Cleared|Done|Undone|Autosaved)|MYK(ModeColorPanel|ColorSpaceModel)|ircular(BezelStyle|Slider)|o(n(stantValueExpressionType|t(inuousCapacityLevelIndicatorStyle|entsCellMask|ain(sComparison|erSpecifierError)|rol(Glyph|KeyMask))|densedFontMask)|lor(Panel(RGBModeMask|GrayModeMask|HSBModeMask|C(MYKModeMask|olorListModeMask|ustomPaletteModeMask|rayonModeMask)|WheelModeMask|AllModesMask)|ListModeColorPanel)|reServiceDirectory|m(p(osite(XOR|Source(In|O(ut|ver)|Atop)|Highlight|C(opy|lear)|Destination(In|O(ut|ver)|Atop)|Plus(Darker|Lighter))|ressedFontMask)|mandKeyMask))|u(stom(SelectorPredicateOperatorType|PaletteModeColorPanel)|r(sor(Update(Mask)?|PointingDevice)|veToBezierPathElement))|e(nterT(extAlignment|abStopType)|ll(State|H(ighlighted|as(Image(Horizontal|OnLeftOrBottom)|OverlappingImage))|ChangesContents|Is(Bordered|InsetButton)|Disabled|Editable|LightsBy(Gray|Background|Contents)|AllowsMixedState))|l(ipPagination|o(s(ePathBezierPathElement|ableWindowMask)|ckAndCalendarDatePickerStyle)|ear(ControlTint|DisplayFunctionKey|LineFunctionKey))|a(seInsensitive(Search|PredicateOption)|n(notCreateScriptCommandError|cel(Button|TextMovement))|chesDirectory|lculation(NoError|Overflow|DivideByZero|Underflow|LossOfPrecision)|rriageReturnCharacter)|r(itical(Request|AlertStyle)|ayonModeColorPanel))|T(hick(SquareBezelStyle|erSquareBezelStyle)|ypesetter(Behavior|HorizontalTabAction|ContainerBreakAction|ZeroAdvancementAction|OriginalBehavior|ParagraphBreakAction|WhitespaceAction|L(ineBreakAction|atestBehavior))|i(ckMark(Right|Below|Left|Above)|tledWindowMask|meZoneDatePickerElementFlag)|o(olbarItemVisibilityPriority(Standard|High|User|Low)|pTabsBezelBorder|ggleButton)|IFF(Compression(N(one|EXT)|CCITTFAX(3|4)|OldJPEG|JPEG|PackBits|LZW)|FileType)|e(rminate(Now|Cancel|Later)|xt(Read(InapplicableDocumentTypeError|WriteErrorM(inimum|aximum))|Block(M(i(nimum(Height|Width)|ddleAlignment)|a(rgin|ximum(Height|Width)))|B(o(ttomAlignment|rder)|aselineAlignment)|Height|TopAlignment|P(ercentageValueType|adding)|Width|AbsoluteValueType)|StorageEdited(Characters|Attributes)|CellType|ured(RoundedBezelStyle|BackgroundWindowMask|SquareBezelStyle)|Table(FixedLayoutAlgorithm|AutomaticLayoutAlgorithm)|Field(RoundedBezel|SquareBezel|AndStepperDatePickerStyle)|WriteInapplicableDocumentTypeError|ListPrependEnclosingMarker))|woByteGlyphPacking|ab(Character|TextMovement|le(tP(oint(Mask|EventSubtype)?|roximity(Mask|EventSubtype)?)|Column(NoResizing|UserResizingMask|AutoresizingMask)|View(ReverseSequentialColumnAutoresizingStyle|GridNone|S(olid(HorizontalGridLineMask|VerticalGridLineMask)|equentialColumnAutoresizingStyle)|NoColumnAutoresizing|UniformColumnAutoresizingStyle|FirstColumnOnlyAutoresizingStyle|LastColumnOnlyAutoresizingStyle)))|rackModeMatrix)|I(n(sert(CharFunctionKey|FunctionKey|LineFunctionKey)|t(Type|ernalS(criptError|pecifierError))|dexSubelement|validIndexSpecifierError|formational(Request|AlertStyle)|PredicateOperatorType)|talicFontMask|SO(2022JPStringEncoding|Latin(1StringEncoding|2StringEncoding))|dentityMappingCharacterCollection|llegalTextMovement|mage(R(ight|ep(MatchesDevice|LoadStatus(ReadingHeader|Completed|InvalidData|Un(expectedEOF|knownType)|WillNeedAllData)))|Below|C(ellType|ache(BySize|Never|Default|Always))|Interpolation(High|None|Default|Low)|O(nly|verlaps)|Frame(Gr(oove|ayBezel)|Button|None|Photo)|L(oadStatus(ReadError|C(ompleted|ancelled)|InvalidData|UnexpectedEOF)|eft)|A(lign(Right|Bottom(Right|Left)?|Center|Top(Right|Left)?|Left)|bove)))|O(n(State|eByteGlyphPacking|OffButton|lyScrollerArrows)|ther(Mouse(D(own(Mask)?|ragged(Mask)?)|Up(Mask)?)|TextMovement)|SF1OperatingSystem|pe(n(GL(GO(Re(setLibrary|tainRenderers)|ClearFormatCache|FormatCacheSize)|PFA(R(obust|endererID)|M(inimumPolicy|ulti(sample|Screen)|PSafe|aximumPolicy)|BackingStore|S(creenMask|te(ncilSize|reo)|ingleRenderer|upersample|ample(s|Buffers|Alpha))|NoRecovery|C(o(lor(Size|Float)|mpliant)|losestPolicy)|OffScreen|D(oubleBuffer|epthSize)|PixelBuffer|VirtualScreenCount|FullScreen|Window|A(cc(umSize|elerated)|ux(Buffers|DepthStencil)|l(phaSize|lRenderers))))|StepUnicodeReservedBase)|rationNotSupportedForKeyS(criptError|pecifierError))|ffState|KButton|rPredicateType|bjC(B(itfield|oolType)|S(hortType|tr(ingType|uctType)|electorType)|NoType|CharType|ObjectType|DoubleType|UnionType|PointerType|VoidType|FloatType|Long(Type|longType)|ArrayType))|D(i(s(c(losureBezelStyle|reteCapacityLevelIndicatorStyle)|playWindowRunLoopOrdering)|acriticInsensitivePredicateOption|rect(Selection|PredicateModifier))|o(c(ModalWindowMask|ument(Directory|ationDirectory))|ubleType|wn(TextMovement|ArrowFunctionKey))|e(s(cendingPageOrder|ktopDirectory)|cimalTabStopType|v(ice(NColorSpaceModel|IndependentModifierFlagsMask)|eloper(Directory|ApplicationDirectory))|fault(ControlTint|TokenStyle)|lete(Char(acter|FunctionKey)|FunctionKey|LineFunctionKey)|moApplicationDirectory)|a(yCalendarUnit|teFormatter(MediumStyle|Behavior(10|Default)|ShortStyle|NoStyle|FullStyle|LongStyle))|ra(wer(Clos(ingState|edState)|Open(ingState|State))|gOperation(Generic|Move|None|Copy|Delete|Private|Every|Link|All)))|U(ser(CancelledError|D(irectory|omainMask)|FunctionKey)|RL(Handle(NotLoaded|Load(Succeeded|InProgress|Failed))|CredentialPersistence(None|Permanent|ForSession))|n(scaledWindowMask|cachedRead|i(codeStringEncoding|talicFontMask|fiedTitleAndToolbarWindowMask)|d(o(CloseGroupingRunLoopOrdering|FunctionKey)|e(finedDateComponent|rline(Style(Single|None|Thick|Double)|Pattern(Solid|D(ot|ash(Dot(Dot)?)?)))))|known(ColorSpaceModel|P(ointingDevice|ageOrder)|KeyS(criptError|pecifierError))|boldFontMask)|tilityWindowMask|TF8StringEncoding|p(dateWindowsRunLoopOrdering|TextMovement|ArrowFunctionKey))|J(ustifiedTextAlignment|PEG(2000FileType|FileType)|apaneseEUC(GlyphPacking|StringEncoding))|P(o(s(t(Now|erFontMask|WhenIdle|ASAP)|iti(on(Replace|Be(fore|ginning)|End|After)|ve(IntType|DoubleType|FloatType)))|pUp(NoArrow|ArrowAt(Bottom|Center))|werOffEventType|rtraitOrientation)|NGFileType|ush(InCell(Mask)?|OnPushOffButton)|e(n(TipMask|UpperSideMask|PointingDevice|LowerSideMask)|riodic(Mask)?)|P(S(caleField|tatus(Title|Field)|aveButton)|N(ote(Title|Field)|ame(Title|Field))|CopiesField|TitleField|ImageButton|OptionsButton|P(a(perFeedButton|ge(Range(To|From)|ChoiceMatrix))|reviewButton)|LayoutButton)|lainTextTokenStyle|a(useFunctionKey|ragraphSeparatorCharacter|ge(DownFunctionKey|UpFunctionKey))|r(int(ing(ReplyLater|Success|Cancelled|Failure)|ScreenFunctionKey|erTable(NotFound|OK|Error)|FunctionKey)|o(p(ertyList(XMLFormat|MutableContainers(AndLeaves)?|BinaryFormat|Immutable|OpenStepFormat)|rietaryStringEncoding)|gressIndicator(BarStyle|SpinningStyle|Preferred(SmallThickness|Thickness|LargeThickness|AquaThickness)))|e(ssedTab|vFunctionKey))|L(HeightForm|CancelButton|TitleField|ImageButton|O(KButton|rientationMatrix)|UnitsButton|PaperNameButton|WidthForm))|E(n(terCharacter|d(sWith(Comparison|PredicateOperatorType)|FunctionKey))|v(e(nOddWindingRule|rySubelement)|aluatedObjectExpressionType)|qualTo(Comparison|PredicateOperatorType)|ra(serPointingDevice|CalendarUnit|DatePickerElementFlag)|x(clude(10|QuickDrawElementsIconCreationOption)|pandedFontMask|ecuteFunctionKey))|V(i(ew(M(in(XMargin|YMargin)|ax(XMargin|YMargin))|HeightSizable|NotSizable|WidthSizable)|aPanelFontAction)|erticalRuler|a(lidationErrorM(inimum|aximum)|riableExpressionType))|Key(SpecifierEvaluationScriptError|Down(Mask)?|Up(Mask)?|PathExpressionType|Value(MinusSetMutation|SetSetMutation|Change(Re(placement|moval)|Setting|Insertion)|IntersectSetMutation|ObservingOption(New|Old)|UnionSetMutation|ValidationError))|QTMovie(NormalPlayback|Looping(BackAndForthPlayback|Playback))|F(1(1FunctionKey|7FunctionKey|2FunctionKey|8FunctionKey|3FunctionKey|9FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey|6FunctionKey)|7FunctionKey|i(nd(PanelAction(Replace(A(ndFind|ll(InSelection)?))?|S(howFindPanel|e(tFindString|lectAll(InSelection)?))|Next|Previous)|FunctionKey)|tPagination|le(Read(No(SuchFileError|PermissionError)|CorruptFileError|In(validFileNameError|applicableStringEncodingError)|Un(supportedSchemeError|knownError))|HandlingPanel(CancelButton|OKButton)|NoSuchFileError|ErrorM(inimum|aximum)|Write(NoPermissionError|In(validFileNameError|applicableStringEncodingError)|OutOfSpaceError|Un(supportedSchemeError|knownError))|LockingError)|xedPitchFontMask)|2(1FunctionKey|7FunctionKey|2FunctionKey|8FunctionKey|3FunctionKey|9FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey|6FunctionKey)|o(nt(Mo(noSpaceTrait|dernSerifsClass)|BoldTrait|S(ymbolicClass|criptsClass|labSerifsClass|ansSerifClass)|C(o(ndensedTrait|llectionApplicationOnlyMask)|larendonSerifsClass)|TransitionalSerifsClass|I(ntegerAdvancementsRenderingMode|talicTrait)|O(ldStyleSerifsClass|rnamentalsClass)|DefaultRenderingMode|U(nknownClass|IOptimizedTrait)|Panel(S(hadowEffectModeMask|t(andardModesMask|rikethroughEffectModeMask)|izeModeMask)|CollectionModeMask|TextColorEffectModeMask|DocumentColorEffectModeMask|UnderlineEffectModeMask|FaceModeMask|All(ModesMask|EffectsModeMask))|ExpandedTrait|VerticalTrait|F(amilyClassMask|reeformSerifsClass)|Antialiased(RenderingMode|IntegerAdvancementsRenderingMode))|cusRing(Below|Type(None|Default|Exterior)|Only|Above)|urByteGlyphPacking|rm(attingError(M(inimum|aximum))?|FeedCharacter))|8FunctionKey|unction(ExpressionType|KeyMask)|3(1FunctionKey|2FunctionKey|3FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey)|9FunctionKey|4FunctionKey|P(RevertButton|S(ize(Title|Field)|etButton)|CurrentField|Preview(Button|Field))|l(oat(ingPointSamplesBitmapFormat|Type)|agsChanged(Mask)?)|axButton|5FunctionKey|6FunctionKey)|W(heelModeColorPanel|indow(s(NTOperatingSystem|CP125(1StringEncoding|2StringEncoding|3StringEncoding|4StringEncoding|0StringEncoding)|95(InterfaceStyle|OperatingSystem))|M(iniaturizeButton|ovedEventType)|Below|CloseButton|ToolbarButton|ZoomButton|Out|DocumentIconButton|ExposedEventType|Above)|orkspaceLaunch(NewInstance|InhibitingBackgroundOnly|Default|PreferringClassic|WithoutA(ctivation|ddingToRecents)|A(sync|nd(Hide(Others)?|Print)|llowingClassicStartup))|eek(day(CalendarUnit|OrdinalCalendarUnit)|CalendarUnit)|a(ntsBidiLevels|rningAlertStyle)|r(itingDirection(RightToLeft|Natural|LeftToRight)|apCalendarComponents))|L(i(stModeMatrix|ne(Moves(Right|Down|Up|Left)|B(order|reakBy(C(harWrapping|lipping)|Truncating(Middle|Head|Tail)|WordWrapping))|S(eparatorCharacter|weep(Right|Down|Up|Left))|ToBezierPathElement|DoesntMove|arSlider)|teralSearch|kePredicateOperatorType|ghterFontAction|braryDirectory)|ocalDomainMask|e(ssThan(Comparison|OrEqualTo(Comparison|PredicateOperatorType)|PredicateOperatorType)|ft(Mouse(D(own(Mask)?|ragged(Mask)?)|Up(Mask)?)|T(ext(Movement|Alignment)|ab(sBezelBorder|StopType))|ArrowFunctionKey))|a(yout(RightToLeft|NotDone|CantFit|OutOfGlyphs|Done|LeftToRight)|ndscapeOrientation)|ABColorSpaceModel)|A(sc(iiWithDoubleByteEUCGlyphPacking|endingPageOrder)|n(y(Type|PredicateModifier|EventMask)|choredSearch|imation(Blocking|Nonblocking(Threaded)?|E(ffect(DisappearingItemDefault|Poof)|ase(In(Out)?|Out))|Linear)|dPredicateType)|t(Bottom|tachmentCharacter|omicWrite|Top)|SCIIStringEncoding|d(obe(GB1CharacterCollection|CNS1CharacterCollection|Japan(1CharacterCollection|2CharacterCollection)|Korea1CharacterCollection)|dTraitFontAction|minApplicationDirectory)|uto(saveOperation|Pagination)|pp(lication(SupportDirectory|D(irectory|e(fined(Mask)?|legateReply(Success|Cancel|Failure)|activatedEventType))|ActivatedEventType)|KitDefined(Mask)?)|l(ternateKeyMask|pha(ShiftKeyMask|NonpremultipliedBitmapFormat|FirstBitmapFormat)|ert(SecondButtonReturn|ThirdButtonReturn|OtherReturn|DefaultReturn|ErrorReturn|FirstButtonReturn|AlternateReturn)|l(ScrollerParts|DomainsMask|PredicateModifier|LibrariesDirectory|ApplicationsDirectory))|rgument(sWrongScriptError|EvaluationScriptError)|bove(Bottom|Top)|WTEventType))\\b",
+ "name": "support.constant.cocoa"
+ },
+ {
+ "include": "source.c"
+ },
+ {
+ "include": "#bracketed_content"
+ }
+ ],
+ "repository": {
+ "bracketed_content": {
+ "begin": "\\[",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.scope.begin.objc"
+ }
+ },
+ "end": "\\]",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.scope.end.objc"
+ }
+ },
+ "name": "meta.bracketed.objc",
+ "patterns": [
+ {
+ "begin": "(?=predicateWithFormat:)(?<=NSPredicate )(predicateWithFormat:)",
+ "beginCaptures": {
+ "1": {
+ "name": "support.function.any-method.objc"
+ },
+ "2": {
+ "name": "punctuation.separator.arguments.objc"
+ }
+ },
+ "end": "(?=\\])",
+ "name": "meta.function-call.predicate.objc",
+ "patterns": [
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.separator.arguments.objc"
+ }
+ },
+ "match": "\\bargument(Array|s)(:)",
+ "name": "support.function.any-method.name-of-parameter.objc"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.separator.arguments.objc"
+ }
+ },
+ "match": "\\b\\w+(:)",
+ "name": "invalid.illegal.unknown-method.objc"
+ },
+ {
+ "begin": "@\"",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.objc"
+ }
+ },
+ "end": "\"",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.objc"
+ }
+ },
+ "name": "string.quoted.double.objc",
+ "patterns": [
+ {
+ "match": "\\b(AND|OR|NOT|IN)\\b",
+ "name": "keyword.operator.logical.predicate.cocoa"
+ },
+ {
+ "match": "\\b(ALL|ANY|SOME|NONE)\\b",
+ "name": "constant.language.predicate.cocoa"
+ },
+ {
+ "match":
+ "\\b(NULL|NIL|SELF|TRUE|YES|FALSE|NO|FIRST|LAST|SIZE)\\b",
+ "name": "constant.language.predicate.cocoa"
+ },
+ {
+ "match": "\\b(MATCHES|CONTAINS|BEGINSWITH|ENDSWITH|BETWEEN)\\b",
+ "name": "keyword.operator.comparison.predicate.cocoa"
+ },
+ {
+ "match": "\\bC(ASEINSENSITIVE|I)\\b",
+ "name": "keyword.other.modifier.predicate.cocoa"
+ },
+ {
+ "match":
+ "\\b(ANYKEY|SUBQUERY|CAST|TRUEPREDICATE|FALSEPREDICATE)\\b",
+ "name": "keyword.other.predicate.cocoa"
+ },
+ {
+ "match":
+ "\\\\(\\\\|[abefnrtv'\"?]|[0-3]\\d{,2}|[4-7]\\d?|x[a-zA-Z0-9]+)",
+ "name": "constant.character.escape.objc"
+ },
+ {
+ "match": "\\\\.",
+ "name": "invalid.illegal.unknown-escape.objc"
+ }
+ ]
+ },
+ {
+ "include": "#special_variables"
+ },
+ {
+ "include": "#c_functions"
+ },
+ {
+ "include": "$base"
+ }
+ ]
+ },
+ {
+ "begin": "(?=\\w)(?<=[\\w\\])\"] )(\\w+(?:(:)|(?=\\])))",
+ "beginCaptures": {
+ "1": {
+ "name": "support.function.any-method.objc"
+ },
+ "2": {
+ "name": "punctuation.separator.arguments.objc"
+ }
+ },
+ "end": "(?=\\])",
+ "name": "meta.function-call.objc",
+ "patterns": [
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.separator.arguments.objc"
+ }
+ },
+ "match": "\\b\\w+(:)",
+ "name": "support.function.any-method.name-of-parameter.objc"
+ },
+ {
+ "include": "#special_variables"
+ },
+ {
+ "include": "#c_functions"
+ },
+ {
+ "include": "$base"
+ }
+ ]
+ },
+ {
+ "include": "#special_variables"
+ },
+ {
+ "include": "#c_functions"
+ },
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ "c_functions": {
+ "patterns": [
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.whitespace.support.function.leading.c"
+ },
+ "2": {
+ "name": "support.function.C99.c"
+ }
+ },
+ "match":
+ "(\\s*)\\b(hypot(f|l)?|s(scanf|ystem|nprintf|ca(nf|lb(n(f|l)?|ln(f|l)?))|i(n(h(f|l)?|f|l)?|gn(al|bit))|tr(s(tr|pn)|nc(py|at|mp)|c(spn|hr|oll|py|at|mp)|to(imax|d|u(l(l)?|max)|k|f|l(d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(jmp|vbuf|locale|buf)|qrt(f|l)?|w(scanf|printf)|rand)|n(e(arbyint(f|l)?|xt(toward(f|l)?|after(f|l)?))|an(f|l)?)|c(s(in(h(f|l)?|f|l)?|qrt(f|l)?)|cos(h(f)?|f|l)?|imag(f|l)?|t(ime|an(h(f|l)?|f|l)?)|o(s(h(f|l)?|f|l)?|nj(f|l)?|pysign(f|l)?)|p(ow(f|l)?|roj(f|l)?)|e(il(f|l)?|xp(f|l)?)|l(o(ck|g(f|l)?)|earerr)|a(sin(h(f|l)?|f|l)?|cos(h(f|l)?|f|l)?|tan(h(f|l)?|f|l)?|lloc|rg(f|l)?|bs(f|l)?)|real(f|l)?|brt(f|l)?)|t(ime|o(upper|lower)|an(h(f|l)?|f|l)?|runc(f|l)?|gamma(f|l)?|mp(nam|file))|i(s(space|n(ormal|an)|cntrl|inf|digit|u(nordered|pper)|p(unct|rint)|finite|w(space|c(ntrl|type)|digit|upper|p(unct|rint)|lower|al(num|pha)|graph|xdigit|blank)|l(ower|ess(equal|greater)?)|al(num|pha)|gr(eater(equal)?|aph)|xdigit|blank)|logb(f|l)?|max(div|abs))|di(v|fftime)|_Exit|unget(c|wc)|p(ow(f|l)?|ut(s|c(har)?|wc(har)?)|error|rintf)|e(rf(c(f|l)?|f|l)?|x(it|p(2(f|l)?|f|l|m1(f|l)?)?))|v(s(scanf|nprintf|canf|printf|w(scanf|printf))|printf|f(scanf|printf|w(scanf|printf))|w(scanf|printf)|a_(start|copy|end|arg))|qsort|f(s(canf|e(tpos|ek))|close|tell|open|dim(f|l)?|p(classify|ut(s|c|w(s|c))|rintf)|e(holdexcept|set(e(nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(aiseexcept|ror)|get(e(nv|xceptflag)|round))|flush|w(scanf|ide|printf|rite)|loor(f|l)?|abs(f|l)?|get(s|c|pos|w(s|c))|re(open|e|ad|xp(f|l)?)|m(in(f|l)?|od(f|l)?|a(f|l|x(f|l)?)?))|l(d(iv|exp(f|l)?)|o(ngjmp|cal(time|econv)|g(1(p(f|l)?|0(f|l)?)|2(f|l)?|f|l|b(f|l)?)?)|abs|l(div|abs|r(int(f|l)?|ound(f|l)?))|r(int(f|l)?|ound(f|l)?)|gamma(f|l)?)|w(scanf|c(s(s(tr|pn)|nc(py|at|mp)|c(spn|hr|oll|py|at|mp)|to(imax|d|u(l(l)?|max)|k|f|l(d|l)?|mbs)|pbrk|ftime|len|r(chr|tombs)|xfrm)|to(b|mb)|rtomb)|printf|mem(set|c(hr|py|mp)|move))|a(s(sert|ctime|in(h(f|l)?|f|l)?)|cos(h(f|l)?|f|l)?|t(o(i|f|l(l)?)|exit|an(h(f|l)?|2(f|l)?|f|l)?)|b(s|ort))|g(et(s|c(har)?|env|wc(har)?)|mtime)|r(int(f|l)?|ound(f|l)?|e(name|alloc|wind|m(ove|quo(f|l)?|ainder(f|l)?))|a(nd|ise))|b(search|towc)|m(odf(f|l)?|em(set|c(hr|py|mp)|move)|ktime|alloc|b(s(init|towcs|rtowcs)|towc|len|r(towc|len))))\\b"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.whitespace.function-call.leading.c"
+ },
+ "2": {
+ "name": "support.function.any-method.c"
+ },
+ "3": {
+ "name": "punctuation.definition.parameters.c"
+ }
+ },
+ "match":
+ "(?x) (?: (?= \\s ) (?:(?<=else|new|return) | (?\\\\\\s*\\n)",
+ "name": "punctuation.separator.continuation.objc"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "disabled": {
+ "begin": "^\\s*#\\s*if(n?def)?\\b.*$",
+ "comment": "eat nested preprocessor if(def)s",
+ "end": "^\\s*#\\s*endif\\b.*$",
+ "patterns": [
+ {
+ "include": "#disabled"
+ },
+ {
+ "include": "#pragma-mark"
+ }
+ ]
+ },
+ "implementation_innards": {
+ "patterns": [
+ {
+ "include": "#preprocessor-rule-enabled-implementation"
+ },
+ {
+ "include": "#preprocessor-rule-disabled-implementation"
+ },
+ {
+ "include": "#preprocessor-rule-other-implementation"
+ },
+ {
+ "include": "#property_directive"
+ },
+ {
+ "include": "#special_variables"
+ },
+ {
+ "include": "#method_super"
+ },
+ {
+ "include": "$base"
+ }
+ ]
+ },
+ "interface_innards": {
+ "patterns": [
+ {
+ "include": "#preprocessor-rule-enabled-interface"
+ },
+ {
+ "include": "#preprocessor-rule-disabled-interface"
+ },
+ {
+ "include": "#preprocessor-rule-other-interface"
+ },
+ {
+ "include": "#properties"
+ },
+ {
+ "include": "#protocol_list"
+ },
+ {
+ "include": "#method"
+ },
+ {
+ "include": "$base"
+ }
+ ]
+ },
+ "method": {
+ "begin": "^(-|\\+)\\s*",
+ "end": "(?=\\{|#)|;",
+ "name": "meta.function.objc",
+ "patterns": [
+ {
+ "begin": "(\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.type.begin.objc"
+ }
+ },
+ "end": "(\\))\\s*(\\w+\\b)",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.definition.type.end.objc"
+ },
+ "2": {
+ "name": "entity.name.function.objc"
+ }
+ },
+ "name": "meta.return-type.objc",
+ "patterns": [
+ {
+ "include": "#protocol_list"
+ },
+ {
+ "include": "#protocol_type_qualifier"
+ },
+ {
+ "include": "$base"
+ }
+ ]
+ },
+ {
+ "match": "\\b\\w+(?=:)",
+ "name": "entity.name.function.name-of-parameter.objc"
+ },
+ {
+ "begin": "((:))\\s*(\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "entity.name.function.name-of-parameter.objc"
+ },
+ "2": {
+ "name": "punctuation.separator.arguments.objc"
+ },
+ "3": {
+ "name": "punctuation.definition.type.begin.objc"
+ }
+ },
+ "end": "(\\))\\s*(\\w+\\b)?",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.definition.type.end.objc"
+ },
+ "2": {
+ "name": "variable.parameter.function.objc"
+ }
+ },
+ "name": "meta.argument-type.objc",
+ "patterns": [
+ {
+ "include": "#protocol_list"
+ },
+ {
+ "include": "#protocol_type_qualifier"
+ },
+ {
+ "include": "$base"
+ }
+ ]
+ },
+ {
+ "include": "#comment"
+ }
+ ]
+ },
+ "method_super": {
+ "begin": "^(?=-|\\+)",
+ "end": "(?<=\\})|(?=#)",
+ "name": "meta.function-with-body.objc",
+ "patterns": [
+ {
+ "include": "#method"
+ },
+ {
+ "include": "$base"
+ }
+ ]
+ },
+ "pragma-mark": {
+ "captures": {
+ "1": {
+ "name": "meta.preprocessor.c"
+ },
+ "2": {
+ "name": "keyword.control.import.pragma.c"
+ },
+ "3": {
+ "name": "meta.toc-list.pragma-mark.c"
+ }
+ },
+ "match": "^\\s*(#\\s*(pragma\\s+mark)\\s+(.*))",
+ "name": "meta.section"
+ },
+ "preprocessor-rule-disabled-implementation": {
+ "begin": "^\\s*(#(if)\\s+(0)\\b).*",
+ "captures": {
+ "1": {
+ "name": "meta.preprocessor.c"
+ },
+ "2": {
+ "name": "keyword.control.import.if.c"
+ },
+ "3": {
+ "name": "constant.numeric.preprocessor.c"
+ }
+ },
+ "end": "^\\s*(#\\s*(endif)\\b.*?(?:(?=(?://|/\\*))|$))",
+ "patterns": [
+ {
+ "begin": "^\\s*(#\\s*(else)\\b)",
+ "captures": {
+ "1": {
+ "name": "meta.preprocessor.c"
+ },
+ "2": {
+ "name": "keyword.control.import.else.c"
+ }
+ },
+ "end": "(?=^\\s*#\\s*endif\\b.*?(?:(?=(?://|/\\*))|$))",
+ "patterns": [
+ {
+ "include": "#interface_innards"
+ }
+ ]
+ },
+ {
+ "begin": "",
+ "end": "(?=^\\s*#\\s*(else|endif)\\b.*?(?:(?=(?://|/\\*))|$))",
+ "name": "comment.block.preprocessor.if-branch.c",
+ "patterns": [
+ {
+ "include": "#disabled"
+ },
+ {
+ "include": "#pragma-mark"
+ }
+ ]
+ }
+ ]
+ },
+ "preprocessor-rule-disabled-interface": {
+ "begin": "^\\s*(#(if)\\s+(0)\\b).*",
+ "captures": {
+ "1": {
+ "name": "meta.preprocessor.c"
+ },
+ "2": {
+ "name": "keyword.control.import.if.c"
+ },
+ "3": {
+ "name": "constant.numeric.preprocessor.c"
+ }
+ },
+ "end": "^\\s*(#\\s*(endif)\\b.*?(?:(?=(?://|/\\*))|$))",
+ "patterns": [
+ {
+ "begin": "^\\s*(#\\s*(else)\\b)",
+ "captures": {
+ "1": {
+ "name": "meta.preprocessor.c"
+ },
+ "2": {
+ "name": "keyword.control.import.else.c"
+ }
+ },
+ "end": "(?=^\\s*#\\s*endif\\b.*?(?:(?=(?://|/\\*))|$))",
+ "patterns": [
+ {
+ "include": "#interface_innards"
+ }
+ ]
+ },
+ {
+ "begin": "",
+ "end": "(?=^\\s*#\\s*(else|endif)\\b.*?(?:(?=(?://|/\\*))|$))",
+ "name": "comment.block.preprocessor.if-branch.c",
+ "patterns": [
+ {
+ "include": "#disabled"
+ },
+ {
+ "include": "#pragma-mark"
+ }
+ ]
+ }
+ ]
+ },
+ "preprocessor-rule-enabled-implementation": {
+ "begin": "^\\s*(#(if)\\s+(0*1)\\b)",
+ "captures": {
+ "1": {
+ "name": "meta.preprocessor.c"
+ },
+ "2": {
+ "name": "keyword.control.import.if.c"
+ },
+ "3": {
+ "name": "constant.numeric.preprocessor.c"
+ }
+ },
+ "end": "^\\s*(#\\s*(endif)\\b.*?(?:(?=(?://|/\\*))|$))",
+ "patterns": [
+ {
+ "begin": "^\\s*(#\\s*(else)\\b).*",
+ "captures": {
+ "1": {
+ "name": "meta.preprocessor.c"
+ },
+ "2": {
+ "name": "keyword.control.import.else.c"
+ }
+ },
+ "contentName": "comment.block.preprocessor.else-branch.c",
+ "end": "(?=^\\s*#\\s*endif\\b.*?(?:(?=(?://|/\\*))|$))",
+ "patterns": [
+ {
+ "include": "#disabled"
+ },
+ {
+ "include": "#pragma-mark"
+ }
+ ]
+ },
+ {
+ "begin": "",
+ "end": "(?=^\\s*#\\s*(else|endif)\\b.*?(?:(?=(?://|/\\*))|$))",
+ "patterns": [
+ {
+ "include": "#implementation_innards"
+ }
+ ]
+ }
+ ]
+ },
+ "preprocessor-rule-enabled-interface": {
+ "begin": "^\\s*(#(if)\\s+(0*1)\\b)",
+ "captures": {
+ "1": {
+ "name": "meta.preprocessor.c"
+ },
+ "2": {
+ "name": "keyword.control.import.if.c"
+ },
+ "3": {
+ "name": "constant.numeric.preprocessor.c"
+ }
+ },
+ "end": "^\\s*(#\\s*(endif)\\b.*?(?:(?=(?://|/\\*))|$))",
+ "patterns": [
+ {
+ "begin": "^\\s*(#\\s*(else)\\b).*",
+ "captures": {
+ "1": {
+ "name": "meta.preprocessor.c"
+ },
+ "2": {
+ "name": "keyword.control.import.else.c"
+ }
+ },
+ "contentName": "comment.block.preprocessor.else-branch.c",
+ "end": "(?=^\\s*#\\s*endif\\b.*?(?:(?=(?://|/\\*))|$))",
+ "patterns": [
+ {
+ "include": "#disabled"
+ },
+ {
+ "include": "#pragma-mark"
+ }
+ ]
+ },
+ {
+ "begin": "",
+ "end": "(?=^\\s*#\\s*(else|endif)\\b.*?(?:(?=(?://|/\\*))|$))",
+ "patterns": [
+ {
+ "include": "#interface_innards"
+ }
+ ]
+ }
+ ]
+ },
+ "preprocessor-rule-other-implementation": {
+ "begin": "^\\s*(#\\s*(if(n?def)?)\\b.*?(?:(?=(?://|/\\*))|$))",
+ "captures": {
+ "1": {
+ "name": "meta.preprocessor.c"
+ },
+ "2": {
+ "name": "keyword.control.import.c"
+ }
+ },
+ "end": "^\\s*(#\\s*(endif)\\b).*?(?:(?=(?://|/\\*))|$)",
+ "patterns": [
+ {
+ "include": "#implementation_innards"
+ }
+ ]
+ },
+ "preprocessor-rule-other-interface": {
+ "begin": "^\\s*(#\\s*(if(n?def)?)\\b.*?(?:(?=(?://|/\\*))|$))",
+ "captures": {
+ "1": {
+ "name": "meta.preprocessor.c"
+ },
+ "2": {
+ "name": "keyword.control.import.c"
+ }
+ },
+ "end": "^\\s*(#\\s*(endif)\\b).*?(?:(?=(?://|/\\*))|$)",
+ "patterns": [
+ {
+ "include": "#interface_innards"
+ }
+ ]
+ },
+ "properties": {
+ "patterns": [
+ {
+ "begin": "((@)property)\\s*(\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.property.objc"
+ },
+ "2": {
+ "name": "punctuation.definition.keyword.objc"
+ },
+ "3": {
+ "name": "punctuation.section.scope.begin.objc"
+ }
+ },
+ "end": "(\\))",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.section.scope.end.objc"
+ }
+ },
+ "name": "meta.property-with-attributes.objc",
+ "patterns": [
+ {
+ "match":
+ "\\b(getter|setter|readonly|readwrite|assign|retain|copy|nonatomic|strong|weak)\\b",
+ "name": "keyword.other.property.attribute"
+ }
+ ]
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "keyword.other.property.objc"
+ },
+ "2": {
+ "name": "punctuation.definition.keyword.objc"
+ }
+ },
+ "match": "((@)property)\\b",
+ "name": "meta.property.objc"
+ }
+ ]
+ },
+ "property_directive": {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.keyword.objc"
+ }
+ },
+ "match": "(@)(dynamic|synthesize)\\b",
+ "name": "keyword.other.property.directive.objc"
+ },
+ "protocol_list": {
+ "begin": "(<)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.section.scope.begin.objc"
+ }
+ },
+ "end": "(>)",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.section.scope.end.objc"
+ }
+ },
+ "name": "meta.protocol-list.objc",
+ "patterns": [
+ {
+ "match":
+ "\\bNS(GlyphStorage|M(utableCopying|enuItem)|C(hangeSpelling|o(ding|pying|lorPicking(Custom|Default)))|T(oolbarItemValidations|ext(Input|AttachmentCell))|I(nputServ(iceProvider|erMouseTracker)|gnoreMisspelledWords)|Obj(CTypeSerializationCallBack|ect)|D(ecimalNumberBehaviors|raggingInfo)|U(serInterfaceValidations|RL(HandleClient|DownloadDelegate|ProtocolClient|AuthenticationChallengeSender))|Validated(ToobarItem|UserInterfaceItem)|Locking)\\b",
+ "name": "support.other.protocol.objc"
+ }
+ ]
+ },
+ "protocol_type_qualifier": {
+ "match": "\\b(in|out|inout|oneway|bycopy|byref)\\b",
+ "name": "storage.modifier.protocol.objc"
+ },
+ "special_variables": {
+ "patterns": [
+ {
+ "match": "\\b_cmd\\b",
+ "name": "variable.other.selector.objc"
+ },
+ {
+ "match": "\\b(self|super)\\b",
+ "name": "variable.language.objc"
+ }
+ ]
+ }
+ }
+}
diff --git a/extensions/oni-plugin-prettier/.eslintrc.json b/extensions/oni-plugin-prettier/.eslintrc.json
new file mode 100644
index 0000000000..ccd62afc2c
--- /dev/null
+++ b/extensions/oni-plugin-prettier/.eslintrc.json
@@ -0,0 +1,45 @@
+{
+ "rules": {
+ "indent": 0,
+ "linebreak-style": ["off", "unix"],
+ "quotes": ["error", "double", { "allowTemplateLiterals": true }],
+ "semi": ["error", "never"],
+ "array-callback-return": "error",
+ "eqeqeq": "error",
+ "no-console": "on",
+ "strict": 0,
+ "no-unused-vars": 0,
+ "no-undef": 1,
+ "no-undefined": 1,
+ "camelcase": 1,
+ "no-underscore-dangle": 0,
+ "no-console": 0,
+ "no-invalid-this": 1,
+ "no-useless-return": 1,
+ "comma-dangle": ["error", "only-multiline"],
+ "comma-spacing": ["error", { "before": false, "after": true }]
+ },
+ "env": {
+ "es6": true,
+ "browser": true,
+ "jasmine": true,
+ "mocha": true
+ },
+ "settings": {
+ "ecmascript": 6,
+ "jsx": true
+ },
+ "extends": "eslint:recommended",
+ "parser": "babel-eslint",
+ "plugins": ["react"],
+ "globals": {
+ "_": false,
+ "remote": false,
+ "process": false,
+ "module": false,
+ "require": false,
+ "__dirname": false,
+ "preloadedData": false
+ },
+ "root": true
+}
diff --git a/extensions/oni-plugin-prettier/index.js b/extensions/oni-plugin-prettier/index.js
new file mode 100644
index 0000000000..7836cbdf7e
--- /dev/null
+++ b/extensions/oni-plugin-prettier/index.js
@@ -0,0 +1,201 @@
+const path = require("path")
+const prettier = require("prettier")
+
+// Helper functions
+const compose = (...fns) => argument => fns.reduceRight((arg, fn) => fn(arg), argument)
+const joinOrSplit = (method, by = "\n") => array => array[method](by)
+const join = joinOrSplit("join")
+const split = joinOrSplit("split")
+const isEqual = toCompare => initialItem => initialItem === toCompare
+const isTrue = (...args) => args.every(a => Boolean(a))
+const eitherOr = (...args) => args.find(a => !!a)
+const flatten = multidimensional => [].concat(...multidimensional)
+
+const isCompatible = (allowedFiletypes, defaultFiletypes) => filePath => {
+ const filetypes = isTrue(allowedFiletypes, Array.isArray(allowedFiletypes))
+ ? allowedFiletypes
+ : defaultFiletypes
+ const extension = path.extname(filePath)
+ return filetypes.includes(extension)
+}
+
+const getSupportedLanguages = async () => {
+ const info = await prettier.getSupportInfo()
+ return flatten(info.languages.map(lang => lang.extensions))
+}
+
+const activate = async Oni => {
+ const config = Oni.configuration.getValue("oni.plugins.prettier")
+ const prettierItem = Oni.statusBar.createItem(0, "oni.plugins.prettier")
+
+ const applyPrettierWithState = applyPrettier()
+ const defaultFiletypes = await getSupportedLanguages()
+
+ const callback = async () => {
+ const isNormalMode = Oni.editors.activeEditor.mode === "normal"
+ if (isNormalMode) {
+ await applyPrettierWithState(Oni)
+ }
+ }
+ Oni.commands.registerCommand({
+ command: "autoformat.prettier",
+ name: "Autoformat with Prettier",
+ execute: callback,
+ })
+
+ const checkPrettierrc = async bufferPath => {
+ if (!bufferPath) {
+ throw new Error(`No buffer path passed for prettier to check for a Prettierrc`)
+ }
+ try {
+ return await prettier.resolveConfig(bufferPath)
+ } catch (e) {
+ throw new Error(`Error parsing config file, ${e}`)
+ }
+ }
+
+ // Status Bar Component ----
+ const { errorElement, successElement, prettierElement } = createPrettierComponent(Oni, callback)
+
+ prettierItem.setContents(prettierElement)
+
+ const setStatusBarContents = (statusBarItem, defaultElement) => async (
+ statusElement,
+ timeOut = 3500,
+ ) => {
+ statusBarItem.setContents(statusElement)
+ await setTimeout(() => statusBarItem.setContents(defaultElement), timeOut)
+ }
+
+ const setPrettierStatus = setStatusBarContents(prettierItem, prettierElement)
+
+ function applyPrettier() {
+ // Track the buffer state within the function using a closure
+ // if the buffer as a string is the same as the last state
+ // do no format because nothing has changed
+ let lastBufferState = null
+
+ // pass in Oni explicitly - Make dependencies clearer
+ return async Oni => {
+ const { activeBuffer } = Oni.editors.activeEditor
+
+ const [arrayOfLines, { line, character }] = await Promise.all([
+ activeBuffer.getLines(),
+ activeBuffer.getCursorPosition(),
+ ])
+
+ const hasNotChanged = compose(isEqual(lastBufferState), join)
+
+ if (hasNotChanged(arrayOfLines)) {
+ return
+ }
+
+ try {
+ const prettierrc = await checkPrettierrc(activeBuffer.filePath)
+ const prettierConfig = eitherOr(prettierrc, config.settings)
+
+ // Pass in the file path so prettier can infer the correct parser to use
+ const { formatted, cursorOffset } = prettier.formatWithCursor(
+ join(arrayOfLines),
+ Object.assign({ filepath: activeBuffer.filePath }, prettierConfig, {
+ cursorOffset: activeBuffer.cursorOffset,
+ }),
+ )
+ if (!formatted) {
+ throw new Error("Couldn't format the buffer")
+ }
+
+ await setPrettierStatus(successElement)
+
+ const withoutFinalCR = formatted.replace(/\n$/, "")
+ lastBufferState = withoutFinalCR
+
+ const [, { character, line }] = await Promise.all([
+ activeBuffer.setLines(0, arrayOfLines.length, split(withoutFinalCR)),
+ activeBuffer.convertOffsetToLineColumn(cursorOffset),
+ ])
+
+ await activeBuffer.setCursorPosition(line, character)
+ await Oni.editors.activeEditor.neovim.command("w")
+ } catch (e) {
+ console.warn(`Couldn't format the buffer because: ${e}`)
+ await setPrettierStatus(errorElement)
+ }
+ }
+ }
+
+ const { allowedFiletypes, formatOnSave, enabled } = config
+ const checkCompatibility = isCompatible(allowedFiletypes, defaultFiletypes)
+
+ Oni.editors.activeEditor.onBufferEnter.subscribe(({ filePath }) => {
+ const hasCompatibility = checkCompatibility(filePath)
+
+ hasCompatibility ? prettierItem.show() : prettierItem.hide()
+ })
+
+ Oni.editors.activeEditor.onBufferSaved.subscribe(async ({ filePath }) => {
+ const hasCompatibility = checkCompatibility(filePath)
+
+ const canApplyPrettier = isTrue(formatOnSave, enabled, hasCompatibility)
+ if (canApplyPrettier) {
+ await applyPrettierWithState(Oni)
+ }
+ })
+ return { applyPrettier: applyPrettierWithState, checkCompatibility, checkPrettierrc }
+}
+
+function createPrettierComponent(Oni, onClick) {
+ const { React } = Oni.dependencies
+
+ const background = Oni.colors.getColor("highlight.mode.normal.background")
+ const foreground = Oni.colors.getColor("highlight.mode.normal.foreground")
+ const style = {
+ width: "100%",
+ height: "100%",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ paddingLeft: "8px",
+ paddingRight: "8px",
+ color: "white",
+ backgroundColor: foreground,
+ }
+
+ const prettierIcon = (type = "magic") =>
+ Oni.ui.createIcon({
+ name: type,
+ size: Oni.ui.iconSize.Default,
+ })
+
+ const iconContainer = (type, color = "white") =>
+ React.createElement("div", { style: { padding: "0 6px 0 0", color } }, prettierIcon(type))
+
+ const prettierElement = React.createElement(
+ "div",
+ { className: "prettier", style, onClick },
+ iconContainer(),
+ "prettier",
+ )
+
+ const errorElement = React.createElement(
+ "div",
+ { style, className: "prettier" },
+ iconContainer("exclamation-triangle", "yellow"),
+ "prettier",
+ )
+
+ const successElement = React.createElement(
+ "div",
+ { style, className: "prettier" },
+ iconContainer("check", "#5AB379"),
+ "prettier",
+ )
+
+ return {
+ errorElement,
+ prettierElement,
+ successElement,
+ }
+}
+
+module.exports = { activate }
diff --git a/extensions/oni-plugin-prettier/package.json b/extensions/oni-plugin-prettier/package.json
new file mode 100644
index 0000000000..a4dfce72e7
--- /dev/null
+++ b/extensions/oni-plugin-prettier/package.json
@@ -0,0 +1,18 @@
+{
+ "name": "oni-plugin-prettier",
+ "version": "1.0.0",
+ "main": "index.js",
+ "engines": {
+ "oni": "^0.2.6"
+ },
+ "scripts": {},
+ "oni": {
+ "supportedFileTypes": [
+ "*"
+ ]
+ },
+ "dependencies": {
+ "prettier": "^1.11.1"
+ },
+ "devDependencies": {}
+}
diff --git a/extensions/php/syntaxes/html.tmLanguage.json b/extensions/php/syntaxes/html.tmLanguage.json
new file mode 100755
index 0000000000..42d9ed082b
--- /dev/null
+++ b/extensions/php/syntaxes/html.tmLanguage.json
@@ -0,0 +1,89 @@
+{
+ "information_for_contributors": [
+ "This file has been converted from https://github.com/atom/language-php/blob/master/grammars/html.cson",
+ "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/atom/language-php/commit/29c140e1531e0b5e842e5bfd4377f879d8b79cd4",
+ "name": "PHP",
+ "scopeName": "text.html.php",
+ "injections": {
+ "text.html.php - (meta.embedded | meta.tag), L:text.html.php meta.tag, L:text.html.php source.js": {
+ "patterns": [
+ {
+ "include": "#php-tag"
+ }
+ ]
+ }
+ },
+ "patterns": [
+ {
+ "begin": "\\A#!",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.comment.php"
+ }
+ },
+ "end": "$",
+ "name": "comment.line.shebang.php"
+ },
+ {
+ "include": "text.html.basic"
+ }
+ ],
+ "repository": {
+ "php-tag": {
+ "patterns": [
+ {
+ "begin": "<\\?(?i:php|=)?(?![^?]*\\?>)",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.begin.php"
+ }
+ },
+ "end": "(\\?)>",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.end.php"
+ },
+ "1": {
+ "name": "source.php"
+ }
+ },
+ "name": "meta.embedded.block.php",
+ "contentName": "source.php",
+ "patterns": [
+ {
+ "include": "source.php"
+ }
+ ]
+ },
+ {
+ "begin": "<\\?(?i:php|=)?",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.begin.php"
+ }
+ },
+ "end": "(\\?)>",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.end.php"
+ },
+ "1": {
+ "name": "source.php"
+ }
+ },
+ "name": "meta.embedded.line.php",
+ "contentName": "source.php",
+ "patterns": [
+ {
+ "include": "source.php"
+ }
+ ]
+ }
+ ]
+ }
+ }
+}
diff --git a/extensions/php/syntaxes/php.tmLanguage.json b/extensions/php/syntaxes/php.tmLanguage.json
new file mode 100755
index 0000000000..869703ae68
--- /dev/null
+++ b/extensions/php/syntaxes/php.tmLanguage.json
@@ -0,0 +1,3569 @@
+{
+ "information_for_contributors": [
+ "This file has been converted from https://github.com/atom/language-php/blob/master/grammars/php.cson",
+ "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/atom/language-php/commit/b054176835218c446d22b3c1b9dcfdcf8cacf49f",
+ "scopeName": "source.php",
+ "patterns": [
+ {
+ "include": "#comments"
+ },
+ {
+ "begin":
+ "(?i)^\\s*(interface)\\s+([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)\\s*(extends)?\\s*",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.type.interface.php"
+ },
+ "2": {
+ "name": "entity.name.type.interface.php"
+ },
+ "3": {
+ "name": "storage.modifier.extends.php"
+ }
+ },
+ "end":
+ "(?i)((?:[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*\\s*,\\s*)*)([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)?\\s*(?:(?={)|$)",
+ "endCaptures": {
+ "1": {
+ "patterns": [
+ {
+ "match":
+ "(?i)[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*",
+ "name": "entity.other.inherited-class.php"
+ },
+ {
+ "match": ",",
+ "name": "punctuation.separator.classes.php"
+ }
+ ]
+ },
+ "2": {
+ "name": "entity.other.inherited-class.php"
+ }
+ },
+ "name": "meta.interface.php",
+ "patterns": [
+ {
+ "include": "#namespace"
+ }
+ ]
+ },
+ {
+ "begin":
+ "(?i)^\\s*(trait)\\s+([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.type.trait.php"
+ },
+ "2": {
+ "name": "entity.name.type.trait.php"
+ }
+ },
+ "end": "(?={)",
+ "name": "meta.trait.php",
+ "patterns": [
+ {
+ "include": "#comments"
+ }
+ ]
+ },
+ {
+ "match":
+ "(?i)(?:^|(?<=<\\?php))\\s*(namespace)\\s+([a-z0-9_\\x{7f}-\\x{7fffffff}\\\\]+)(?=\\s*;)",
+ "name": "meta.namespace.php",
+ "captures": {
+ "1": {
+ "name": "keyword.other.namespace.php"
+ },
+ "2": {
+ "name": "entity.name.type.namespace.php",
+ "patterns": [
+ {
+ "match": "\\\\",
+ "name": "punctuation.separator.inheritance.php"
+ }
+ ]
+ }
+ }
+ },
+ {
+ "begin": "(?i)(?:^|(?<=<\\?php))\\s*(namespace)\\s+",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.namespace.php"
+ }
+ },
+ "end": "(?<=})|(?=\\?>)",
+ "name": "meta.namespace.php",
+ "patterns": [
+ {
+ "include": "#comments"
+ },
+ {
+ "match": "(?i)[a-z0-9_\\x{7f}-\\x{7fffffff}\\\\]+",
+ "name": "entity.name.type.namespace.php",
+ "captures": {
+ "0": {
+ "patterns": [
+ {
+ "match": "\\\\",
+ "name": "punctuation.separator.inheritance.php"
+ }
+ ]
+ }
+ }
+ },
+ {
+ "begin": "{",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.namespace.begin.bracket.curly.php"
+ }
+ },
+ "end": "}|(?=\\?>)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.namespace.end.bracket.curly.php"
+ }
+ },
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ {
+ "match": "[^\\s]+",
+ "name": "invalid.illegal.identifier.php"
+ }
+ ]
+ },
+ {
+ "match": "\\s+(?=use\\b)"
+ },
+ {
+ "begin": "(?i)\\buse\\b",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.other.use.php"
+ }
+ },
+ "end": "(?<=})|(?=;)",
+ "name": "meta.use.php",
+ "patterns": [
+ {
+ "match": "\\b(const|function)\\b",
+ "name": "storage.type.${1:/downcase}.php"
+ },
+ {
+ "begin": "{",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.use.begin.bracket.curly.php"
+ }
+ },
+ "end": "}",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.use.end.bracket.curly.php"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#scope-resolution"
+ },
+ {
+ "match":
+ "(?xi)\n\\b(as)\n\\s+(final|abstract|public|private|protected|static)\n\\s+([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)",
+ "captures": {
+ "1": {
+ "name": "keyword.other.use-as.php"
+ },
+ "2": {
+ "name": "storage.modifier.php"
+ },
+ "3": {
+ "name": "entity.other.alias.php"
+ }
+ }
+ },
+ {
+ "match":
+ "(?xi)\n\\b(as)\n\\s+([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)",
+ "captures": {
+ "1": {
+ "name": "keyword.other.use-as.php"
+ },
+ "2": {
+ "patterns": [
+ {
+ "match":
+ "^(?:final|abstract|public|private|protected|static)$",
+ "name": "storage.modifier.php"
+ },
+ {
+ "match": ".+",
+ "name": "entity.other.alias.php"
+ }
+ ]
+ }
+ }
+ },
+ {
+ "match":
+ "(?i)\\b(insteadof)\\s+([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)",
+ "captures": {
+ "1": {
+ "name": "keyword.other.use-insteadof.php"
+ },
+ "2": {
+ "name": "support.class.php"
+ }
+ }
+ },
+ {
+ "match": ";",
+ "name": "punctuation.terminator.expression.php"
+ },
+ {
+ "include": "#use-inner"
+ }
+ ]
+ },
+ {
+ "include": "#use-inner"
+ }
+ ]
+ },
+ {
+ "begin":
+ "(?i)(?:^|(?<=}))\\s*(?:(abstract|final)\\s+)?(class)\\s+([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.${1:/downcase}.php"
+ },
+ "2": {
+ "name": "storage.type.class.php"
+ },
+ "3": {
+ "name": "entity.name.type.class.php"
+ }
+ },
+ "end": "}|(?=\\?>)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.class.end.bracket.curly.php"
+ }
+ },
+ "name": "meta.class.php",
+ "patterns": [
+ {
+ "include": "#comments"
+ },
+ {
+ "begin": "(?i)(extends)\\s+",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.extends.php"
+ }
+ },
+ "contentName": "meta.other.inherited-class.php",
+ "end": "(?i)(?=[^a-z0-9_\\x{7f}-\\x{7fffffff}\\\\])",
+ "patterns": [
+ {
+ "begin":
+ "(?i)(?=\\\\?[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*\\\\)",
+ "end":
+ "(?i)([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)?(?=[^a-z0-9_\\x{7f}-\\x{7fffffff}\\\\])",
+ "endCaptures": {
+ "1": {
+ "name": "entity.other.inherited-class.php"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#namespace"
+ }
+ ]
+ },
+ {
+ "include": "#class-builtin"
+ },
+ {
+ "include": "#namespace"
+ },
+ {
+ "match":
+ "(?i)[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*",
+ "name": "entity.other.inherited-class.php"
+ }
+ ]
+ },
+ {
+ "begin": "(?i)(implements)\\s+",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.implements.php"
+ }
+ },
+ "end": "(?i)(?=[;{])",
+ "patterns": [
+ {
+ "include": "#comments"
+ },
+ {
+ "begin": "(?i)(?=[a-z0-9_\\x{7f}-\\x{7fffffff}\\\\]+)",
+ "contentName": "meta.other.inherited-class.php",
+ "end":
+ "(?i)(?:\\s*(?:,|(?=[^a-z0-9_\\x{7f}-\\x{7fffffff}\\\\\\s]))\\s*)",
+ "patterns": [
+ {
+ "begin":
+ "(?i)(?=\\\\?[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*\\\\)",
+ "end":
+ "(?i)([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)?(?=[^a-z0-9_\\x{7f}-\\x{7fffffff}\\\\])",
+ "endCaptures": {
+ "1": {
+ "name": "entity.other.inherited-class.php"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#namespace"
+ }
+ ]
+ },
+ {
+ "include": "#class-builtin"
+ },
+ {
+ "include": "#namespace"
+ },
+ {
+ "match":
+ "(?i)[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*",
+ "name": "entity.other.inherited-class.php"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "begin": "{",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.class.begin.bracket.curly.php"
+ }
+ },
+ "end": "(?=}|\\?>)",
+ "contentName": "meta.class.body.php",
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "include": "#switch_statement"
+ },
+ {
+ "match": "\\s*\\b(yield\\s+from)\\b",
+ "captures": {
+ "1": {
+ "name": "keyword.control.yield-from.php"
+ }
+ }
+ },
+ {
+ "match":
+ "(?x)\n\\s* # FIXME: Removing this causes specs to fail. Investigate.\n\\b(\n break|case|continue|declare|default|die|do|\n else(if)?|end(declare|for(each)?|if|switch|while)|exit|\n for(each)?|if|return|switch|use|while|yield\n)\\b",
+ "captures": {
+ "1": {
+ "name": "keyword.control.${1:/downcase}.php"
+ }
+ }
+ },
+ {
+ "begin": "(?i)\\b((?:require|include)(?:_once)?)\\s+",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.control.import.include.php"
+ }
+ },
+ "end": "(?=\\s|;|$|\\?>)",
+ "name": "meta.include.php",
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ {
+ "begin": "\\b(catch)\\s*(\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.control.exception.catch.php"
+ },
+ "2": {
+ "name": "punctuation.definition.parameters.begin.bracket.round.php"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.parameters.end.bracket.round.php"
+ }
+ },
+ "name": "meta.catch.php",
+ "patterns": [
+ {
+ "include": "#namespace"
+ },
+ {
+ "match":
+ "(?xi)\n([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*) # Exception class\n((?:\\s*\\|\\s*[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)*) # Optional additional exception classes\n\\s*\n((\\$+)[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*) # Variable",
+ "captures": {
+ "1": {
+ "name": "support.class.exception.php"
+ },
+ "2": {
+ "patterns": [
+ {
+ "match":
+ "(?i)[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*",
+ "name": "support.class.exception.php"
+ },
+ {
+ "match": "\\|",
+ "name": "punctuation.separator.delimiter.php"
+ }
+ ]
+ },
+ "3": {
+ "name": "variable.other.php"
+ },
+ "4": {
+ "name": "punctuation.definition.variable.php"
+ }
+ }
+ }
+ ]
+ },
+ {
+ "match": "\\b(catch|try|throw|exception|finally)\\b",
+ "name": "keyword.control.exception.php"
+ },
+ {
+ "begin": "(?i)\\b(function)\\s*(?=\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.type.function.php"
+ }
+ },
+ "end": "(?={)",
+ "name": "meta.function.closure.php",
+ "patterns": [
+ {
+ "begin": "\\(",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.parameters.begin.bracket.round.php"
+ }
+ },
+ "contentName": "meta.function.parameters.php",
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.parameters.end.bracket.round.php"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#function-parameters"
+ }
+ ]
+ },
+ {
+ "begin": "(?i)(use)\\s*(\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.function.use.php"
+ },
+ "2": {
+ "name": "punctuation.definition.parameters.begin.bracket.round.php"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.parameters.end.bracket.round.php"
+ }
+ },
+ "patterns": [
+ {
+ "captures": {
+ "1": {
+ "name": "variable.other.php"
+ },
+ "2": {
+ "name": "storage.modifier.reference.php"
+ },
+ "3": {
+ "name": "punctuation.definition.variable.php"
+ }
+ },
+ "match":
+ "(?i)((&)?\\s*(\\$+)[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)\\s*(?=,|\\))",
+ "name": "meta.function.closure.use.php"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "begin":
+ "(?x)\n((?:(?:final|abstract|public|private|protected|static)\\s+)*)\n(function)\\s+\n(?i:\n (__(?:call|construct|debugInfo|destruct|get|set|isset|unset|toString|\n clone|set_state|sleep|wakeup|autoload|invoke|callStatic))\n |([a-zA-Z_\\x{7f}-\\x{7fffffff}][a-zA-Z0-9_\\x{7f}-\\x{7fffffff}]*)\n)\n\\s*(\\()",
+ "beginCaptures": {
+ "1": {
+ "patterns": [
+ {
+ "match": "final|abstract|public|private|protected|static",
+ "name": "storage.modifier.php"
+ }
+ ]
+ },
+ "2": {
+ "name": "storage.type.function.php"
+ },
+ "3": {
+ "name": "support.function.magic.php"
+ },
+ "4": {
+ "name": "entity.name.function.php"
+ },
+ "5": {
+ "name": "punctuation.definition.parameters.begin.bracket.round.php"
+ }
+ },
+ "contentName": "meta.function.parameters.php",
+ "end":
+ "(\\))(?:\\s*(:)\\s*(\\?)?\\s*([a-zA-Z_\\x{7f}-\\x{7fffffff}][a-zA-Z0-9_\\x{7f}-\\x{7fffffff}]*))?",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.definition.parameters.end.bracket.round.php"
+ },
+ "2": {
+ "name": "keyword.operator.return-value.php"
+ },
+ "3": {
+ "name": "keyword.operator.nullable-type.php"
+ },
+ "4": {
+ "name": "storage.type.php"
+ }
+ },
+ "name": "meta.function.php",
+ "patterns": [
+ {
+ "include": "#function-parameters"
+ }
+ ]
+ },
+ {
+ "include": "#invoke-call"
+ },
+ {
+ "include": "#scope-resolution"
+ },
+ {
+ "include": "#variables"
+ },
+ {
+ "include": "#strings"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "support.function.construct.php"
+ },
+ "2": {
+ "name": "punctuation.definition.array.begin.bracket.round.php"
+ },
+ "3": {
+ "name": "punctuation.definition.array.end.bracket.round.php"
+ }
+ },
+ "match": "(array)(\\()(\\))",
+ "name": "meta.array.empty.php"
+ },
+ {
+ "begin": "(array)\\s*(\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "support.function.construct.php"
+ },
+ "2": {
+ "name": "punctuation.definition.array.begin.bracket.round.php"
+ }
+ },
+ "end": "\\)|(?=\\?>)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.array.end.bracket.round.php"
+ }
+ },
+ "name": "meta.array.php",
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ {
+ "match":
+ "(?i)(\\()\\s*(array|real|double|float|int(?:eger)?|bool(?:ean)?|string|object|binary|unset)\\s*(\\))",
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.storage-type.begin.bracket.round.php"
+ },
+ "2": {
+ "name": "storage.type.php"
+ },
+ "3": {
+ "name": "punctuation.definition.storage-type.end.bracket.round.php"
+ }
+ }
+ },
+ {
+ "match":
+ "(?i)\\b(array|real|double|float|int(eger)?|bool(ean)?|string|class|var|function|interface|trait|parent|self|object)\\b",
+ "name": "storage.type.php"
+ },
+ {
+ "match":
+ "(?i)\\b(global|abstract|const|extends|implements|final|private|protected|public|static)\\b",
+ "name": "storage.modifier.php"
+ },
+ {
+ "include": "#object"
+ },
+ {
+ "match": ";",
+ "name": "punctuation.terminator.expression.php"
+ },
+ {
+ "match": ":",
+ "name": "punctuation.terminator.statement.php"
+ },
+ {
+ "include": "#heredoc"
+ },
+ {
+ "include": "#numbers"
+ },
+ {
+ "match": "(?i)\\bclone\\b",
+ "name": "keyword.other.clone.php"
+ },
+ {
+ "match": "\\.=?",
+ "name": "keyword.operator.string.php"
+ },
+ {
+ "match": "=>",
+ "name": "keyword.operator.key.php"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "keyword.operator.assignment.php"
+ },
+ "2": {
+ "name": "storage.modifier.reference.php"
+ },
+ "3": {
+ "name": "storage.modifier.reference.php"
+ }
+ },
+ "match": "(?i)(\\=)(&)|(&)(?=[$a-z_])"
+ },
+ {
+ "match": "@",
+ "name": "keyword.operator.error-control.php"
+ },
+ {
+ "match": "===|==|!==|!=|<>",
+ "name": "keyword.operator.comparison.php"
+ },
+ {
+ "match": "=|\\+=|\\-=|\\*=|/=|%=|&=|\\|=|\\^=|<<=|>>=",
+ "name": "keyword.operator.assignment.php"
+ },
+ {
+ "match": "<=>|<=|>=|<|>",
+ "name": "keyword.operator.comparison.php"
+ },
+ {
+ "match": "\\-\\-|\\+\\+",
+ "name": "keyword.operator.increment-decrement.php"
+ },
+ {
+ "match": "\\-|\\+|\\*|/|%",
+ "name": "keyword.operator.arithmetic.php"
+ },
+ {
+ "match": "(?i)(!|&&|\\|\\|)|\\b(and|or|xor|as)\\b",
+ "name": "keyword.operator.logical.php"
+ },
+ {
+ "include": "#function-call"
+ },
+ {
+ "match": "<<|>>|~|\\^|&|\\|",
+ "name": "keyword.operator.bitwise.php"
+ },
+ {
+ "begin": "(?i)\\b(instanceof)\\s+(?=[\\\\$a-z_])",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.operator.type.php"
+ }
+ },
+ "end": "(?=[^\\\\$a-z0-9_\\x{7f}-\\x{7fffffff}])",
+ "patterns": [
+ {
+ "include": "#class-name"
+ },
+ {
+ "include": "#variable-name"
+ }
+ ]
+ },
+ {
+ "include": "#instantiation"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "keyword.control.goto.php"
+ },
+ "2": {
+ "name": "support.other.php"
+ }
+ },
+ "match": "(?i)(goto)\\s+([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "entity.name.goto-label.php"
+ }
+ },
+ "match":
+ "(?i)^\\s*([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)\\s*:(?!:)"
+ },
+ {
+ "include": "#string-backtick"
+ },
+ {
+ "include": "#ternary_shorthand"
+ },
+ {
+ "include": "#null_coalescing"
+ },
+ {
+ "include": "#ternary_expression"
+ },
+ {
+ "begin": "{",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.begin.bracket.curly.php"
+ }
+ },
+ "end": "}|(?=\\?>)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.end.bracket.curly.php"
+ }
+ },
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ {
+ "begin": "\\[",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.array.begin.php"
+ }
+ },
+ "end": "\\]|(?=\\?>)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.array.end.php"
+ }
+ },
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ {
+ "begin": "\\(",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.begin.bracket.round.php"
+ }
+ },
+ "end": "\\)|(?=\\?>)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.end.bracket.round.php"
+ }
+ },
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ {
+ "include": "#constants"
+ },
+ {
+ "match": ",",
+ "name": "punctuation.separator.delimiter.php"
+ }
+ ],
+ "repository": {
+ "class-builtin": {
+ "patterns": [
+ {
+ "match":
+ "(?xi)\n(\\\\)?\\b\n((APC|Append)Iterator|Array(Access|Iterator|Object)\n|Bad(Function|Method)CallException\n|(Caching|CallbackFilter)Iterator|Collator|Collectable|Cond|Countable|CURLFile\n|Date(Interval|Period|Time(Interface|Immutable|Zone)?)?|Directory(Iterator)?|DomainException\n|DOM(Attr|CdataSection|CharacterData|Comment|Document(Fragment)?|Element|EntityReference\n |Implementation|NamedNodeMap|Node(list)?|ProcessingInstruction|Text|XPath)\n|(Error)?Exception|EmptyIterator\n|finfo\n|Ev(Check|Child|Embed|Fork|Idle|Io|Loop|Periodic|Prepare|Signal|Stat|Timer|Watcher)?\n|Event(Base|Buffer(Event)?|SslContext|Http(Request|Connection)?|Config|DnsBase|Util|Listener)?\n|FANNConnection|(Filter|Filesystem)Iterator\n|Gender\\\\Gender|GlobIterator|Gmagick(Draw|Pixel)?\n|Haru(Annotation|Destination|Doc|Encoder|Font|Image|Outline|Page)\n|Http((Inflate|Deflate)?Stream|Message|Request(Pool)?|Response|QueryString)\n|HRTime\\\\(PerformanceCounter|StopWatch)\n|Intl(Calendar|((CodePoint|RuleBased)?Break|Parts)?Iterator|DateFormatter|TimeZone)\n|Imagick(Draw|Pixel(Iterator)?)?\n|InfiniteIterator|InvalidArgumentException|Iterator(Aggregate|Iterator)?\n|JsonSerializable\n|KTaglib_(MPEG_(File|AudioProperties)|Tag|ID3v2_(Tag|(AttachedPicture)?Frame))\n|Lapack|(Length|Locale|Logic)Exception|LimitIterator|Lua(Closure)?\n|Mongo(BinData|Client|Code|Collection|CommandCursor|Cursor(Exception)?|Date|DB(Ref)?|DeleteBatch\n |Grid(FS(Cursor|File)?)|Id|InsertBatch|Int(32|64)|Log|Pool|Regex|ResultException|Timestamp\n |UpdateBatch|Write(Batch|ConcernException))?\n|Memcache(d)?|MessageFormatter|MultipleIterator|Mutex\n|mysqli(_(driver|stmt|warning|result))?\n|MysqlndUh(Connection|PreparedStatement)\n|NoRewindIterator|Normalizer|NumberFormatter\n|OCI-(Collection|Lob)|OuterIterator|(OutOf(Bounds|Range)|Overflow)Exception\n|ParentIterator|PDO(Statement)?|Phar(Data|FileInfo)?|php_user_filter|Pool\n|QuickHash(Int(Set|StringHash)|StringIntHash)\n|Recursive(Array|Caching|Directory|Fallback|Filter|Iterator|Regex|Tree)?Iterator\n|Reflection(Class|Function(Abstract)?|Method|Object|Parameter|Property|(Zend)?Extension)?\n|RangeException|Reflector|RegexIterator|ResourceBundle|RuntimeException|RRD(Creator|Graph|Updater)\n|SAM(Connection|Message)|SCA(_(SoapProxy|LocalProxy))?\n|SDO_(DAS_(ChangeSummary|Data(Factory|Object)|Relational|Setting|XML(_Document)?)\n |Data(Factory|Object)|Exception|List|Model_(Property|ReflectionDataObject|Type)|Sequence)\n|SeekableIterator|Serializable|SessionHandler(Interface)?|SimpleXML(Iterator|Element)|SNMP\n|Soap(Client|Fault|Header|Param|Server|Var)\n|SphinxClient|Spoofchecker\n|Spl(DoublyLinkedList|Enum|File(Info|Object)|FixedArray|(Max|Min)?Heap|Observer|ObjectStorage\n |(Priority)?Queue|Stack|Subject|Type|TempFileObject)\n|SQLite(3(Result|Stmt)?|Database|Result|Unbuffered)\n|stdClass|streamWrapper|SVM(Model)?|Swish(Result(s)?|Search)?|Sync(Event|Mutex|ReaderWriter|Semaphore)\n|Thread(ed)?|tidy(Node)?|TokyoTyrant(Table|Iterator|Query)?|Transliterator|Traversable\n|UConverter|(Underflow|UnexpectedValue)Exception\n|V8Js(Exception)?|Varnish(Admin|Log|Stat)\n|Worker|Weak(Map|Ref)\n|XML(Diff\\\\(Base|DOM|File|Memory)|Reader|Writer)|XsltProcessor\n|Yaf_(Route_(Interface|Map|Regex|Rewrite|Simple|Supervar)\n |Action_Abstract|Application|Config_(Simple|Ini|Abstract)|Controller_Abstract\n |Dispatcher|Exception|Loader|Plugin_Abstract|Registry|Request_(Abstract|Simple|Http)\n |Response_Abstract|Router|Session|View_(Simple|Interface))\n|Yar_(Client(_Exception)?|Concurrent_Client|Server(_Exception)?)\n|ZipArchive|ZMQ(Context|Device|Poll|Socket)?)\n\\b",
+ "name": "support.class.builtin.php",
+ "captures": {
+ "1": {
+ "name": "punctuation.separator.inheritance.php"
+ }
+ }
+ }
+ ]
+ },
+ "class-name": {
+ "patterns": [
+ {
+ "begin": "(?i)(?=\\\\?[a-z_0-9]+\\\\)",
+ "end": "(?i)([a-z_][a-z_0-9]*)?(?![a-z0-9_\\\\])",
+ "endCaptures": {
+ "1": {
+ "name": "support.class.php"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#namespace"
+ }
+ ]
+ },
+ {
+ "include": "#class-builtin"
+ },
+ {
+ "begin": "(?=[\\\\a-zA-Z_])",
+ "end": "(?i)([a-z_][a-z_0-9]*)?(?![a-z0-9_\\\\])",
+ "endCaptures": {
+ "1": {
+ "name": "support.class.php"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#namespace"
+ }
+ ]
+ }
+ ]
+ },
+ "comments": {
+ "patterns": [
+ {
+ "begin": "/\\*\\*(?=\\s)",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.comment.php"
+ }
+ },
+ "end": "\\*/",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.comment.php"
+ }
+ },
+ "name": "comment.block.documentation.phpdoc.php",
+ "patterns": [
+ {
+ "include": "#php_doc"
+ }
+ ]
+ },
+ {
+ "begin": "/\\*",
+ "captures": {
+ "0": {
+ "name": "punctuation.definition.comment.php"
+ }
+ },
+ "end": "\\*/",
+ "name": "comment.block.php"
+ },
+ {
+ "begin": "(^\\s+)?(?=//)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.whitespace.comment.leading.php"
+ }
+ },
+ "end": "(?!\\G)",
+ "patterns": [
+ {
+ "begin": "//",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.comment.php"
+ }
+ },
+ "end": "\\n|(?=\\?>)",
+ "name": "comment.line.double-slash.php"
+ }
+ ]
+ },
+ {
+ "begin": "(^\\s+)?(?=#)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.whitespace.comment.leading.php"
+ }
+ },
+ "end": "(?!\\G)",
+ "patterns": [
+ {
+ "begin": "#",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.comment.php"
+ }
+ },
+ "end": "\\n|(?=\\?>)",
+ "name": "comment.line.number-sign.php"
+ }
+ ]
+ }
+ ]
+ },
+ "constants": {
+ "patterns": [
+ {
+ "match":
+ "(?i)\\b(TRUE|FALSE|NULL|__(FILE|DIR|FUNCTION|CLASS|METHOD|LINE|NAMESPACE)__|ON|OFF|YES|NO|NL|BR|TAB)\\b",
+ "name": "constant.language.php"
+ },
+ {
+ "match":
+ "(?x)\n(\\\\)?\\b\n(DEFAULT_INCLUDE_PATH\n|EAR_(INSTALL|EXTENSION)_DIR\n|E_(ALL|COMPILE_(ERROR|WARNING)|CORE_(ERROR|WARNING)|DEPRECATED|ERROR|NOTICE\n |PARSE|RECOVERABLE_ERROR|STRICT|USER_(DEPRECATED|ERROR|NOTICE|WARNING)|WARNING)\n|PHP_(ROUND_HALF_(DOWN|EVEN|ODD|UP)|(MAJOR|MINOR|RELEASE)_VERSION|MAXPATHLEN\n |BINDIR|SHLIB_SUFFIX|SYSCONFDIR|SAPI|CONFIG_FILE_(PATH|SCAN_DIR)\n |INT_(MAX|SIZE)|ZTS|OS|OUTPUT_HANDLER_(START|CONT|END)|DEBUG|DATADIR\n |URL_(SCHEME|HOST|USER|PORT|PASS|PATH|QUERY|FRAGMENT)|PREFIX\n |EXTRA_VERSION|EXTENSION_DIR|EOL|VERSION(_ID)?\n |WINDOWS_(NT_(SERVER|DOMAIN_CONTROLLER|WORKSTATION)\n |VERSION_(MAJOR|MINOR)|BUILD|SUITEMASK|SP_(MAJOR|MINOR)\n |PRODUCTTYPE|PLATFORM)\n |LIBDIR|LOCALSTATEDIR)\n|STD(ERR|IN|OUT)|ZEND_(DEBUG_BUILD|THREAD_SAFE))\n\\b",
+ "name": "support.constant.core.php",
+ "captures": {
+ "1": {
+ "name": "punctuation.separator.inheritance.php"
+ }
+ }
+ },
+ {
+ "match":
+ "(?x)\n(\\\\)?\\b\n(__COMPILER_HALT_OFFSET__|AB(MON_(1|2|3|4|5|6|7|8|9|10|11|12)|DAY[1-7])\n|AM_STR|ASSERT_(ACTIVE|BAIL|CALLBACK_QUIET_EVAL|WARNING)|ALT_DIGITS\n|CASE_(UPPER|LOWER)|CHAR_MAX|CONNECTION_(ABORTED|NORMAL|TIMEOUT)|CODESET|COUNT_(NORMAL|RECURSIVE)\n|CREDITS_(ALL|DOCS|FULLPAGE|GENERAL|GROUP|MODULES|QA|SAPI)\n|CRYPT_(BLOWFISH|EXT_DES|MD5|SHA(256|512)|SALT_LENGTH|STD_DES)|CURRENCY_SYMBOL\n|D_(T_)?FMT|DATE_(ATOM|COOKIE|ISO8601|RFC(822|850|1036|1123|2822|3339)|RSS|W3C)\n|DAY_[1-7]|DECIMAL_POINT|DIRECTORY_SEPARATOR\n|ENT_(COMPAT|IGNORE|(NO)?QUOTES)|EXTR_(IF_EXISTS|OVERWRITE|PREFIX_(ALL|IF_EXISTS|INVALID|SAME)|REFS|SKIP)\n|ERA(_(D_(T_)?FMT)|T_FMT|YEAR)?|FRAC_DIGITS|GROUPING|HASH_HMAC|HTML_(ENTITIES|SPECIALCHARS)\n|INF|INFO_(ALL|CREDITS|CONFIGURATION|ENVIRONMENT|GENERAL|LICENSEMODULES|VARIABLES)\n|INI_(ALL|CANNER_(NORMAL|RAW)|PERDIR|SYSTEM|USER)|INT_(CURR_SYMBOL|FRAC_DIGITS)\n|LC_(ALL|COLLATE|CTYPE|MESSAGES|MONETARY|NUMERIC|TIME)|LOCK_(EX|NB|SH|UN)\n|LOG_(ALERT|AUTH(PRIV)?|CRIT|CRON|CONS|DAEMON|DEBUG|EMERG|ERR|INFO|LOCAL[1-7]|LPR|KERN|MAIL\n |NEWS|NODELAY|NOTICE|NOWAIT|ODELAY|PID|PERROR|WARNING|SYSLOG|UCP|USER)\n|M_(1_PI|SQRT(1_2|2|3|PI)|2_(SQRT)?PI|PI(_(2|4))?|E(ULER)?|LN(10|2|PI)|LOG(10|2)E)\n|MON_(1|2|3|4|5|6|7|8|9|10|11|12|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)\n|N_(CS_PRECEDES|SEP_BY_SPACE|SIGN_POSN)|NAN|NEGATIVE_SIGN|NO(EXPR|STR)\n|P_(CS_PRECEDES|SEP_BY_SPACE|SIGN_POSN)|PM_STR|POSITIVE_SIGN\n|PATH(_SEPARATOR|INFO_(EXTENSION|(BASE|DIR|FILE)NAME))|RADIXCHAR\n|SEEK_(CUR|END|SET)|SORT_(ASC|DESC|LOCALE_STRING|REGULAR|STRING)|STR_PAD_(BOTH|LEFT|RIGHT)\n|T_FMT(_AMPM)?|THOUSEP|THOUSANDS_SEP\n|UPLOAD_ERR_(CANT_WRITE|EXTENSION|(FORM|INI)_SIZE|NO_(FILE|TMP_DIR)|OK|PARTIAL)\n|YES(EXPR|STR))\n\\b",
+ "name": "support.constant.std.php",
+ "captures": {
+ "1": {
+ "name": "punctuation.separator.inheritance.php"
+ }
+ }
+ },
+ {
+ "match":
+ "(?x)\n(\\\\)?\\b\n(GLOB_(MARK|BRACE|NO(SORT|CHECK|ESCAPE)|ONLYDIR|ERR|AVAILABLE_FLAGS)\n|XML_(SAX_IMPL|(DTD|DOCUMENT(_(FRAG|TYPE))?|HTML_DOCUMENT|NOTATION|NAMESPACE_DECL|PI|COMMENT|DATA_SECTION|TEXT)_NODE\n |OPTION_(SKIP_(TAGSTART|WHITE)|CASE_FOLDING|TARGET_ENCODING)\n |ERROR_((BAD_CHAR|(ATTRIBUTE_EXTERNAL|BINARY|PARAM|RECURSIVE)_ENTITY)_REF|MISPLACED_XML_PI|SYNTAX|NONE\n |NO_(MEMORY|ELEMENTS)|TAG_MISMATCH|INCORRECT_ENCODING|INVALID_TOKEN|DUPLICATE_ATTRIBUTE\n |UNCLOSED_(CDATA_SECTION|TOKEN)|UNDEFINED_ENTITY|UNKNOWN_ENCODING|JUNK_AFTER_DOC_ELEMENT\n |PARTIAL_CHAR|EXTERNAL_ENTITY_HANDLING|ASYNC_ENTITY)\n |ENTITY_(((REF|DECL)_)?NODE)|ELEMENT(_DECL)?_NODE|LOCAL_NAMESPACE|ATTRIBUTE_(NMTOKEN(S)?|NOTATION|NODE)\n |CDATA|ID(REF(S)?)?|DECL_NODE|ENTITY|ENUMERATION)\n|MHASH_(RIPEMD(128|160|256|320)|GOST|MD(2|4|5)|SHA(1|224|256|384|512)|SNEFRU256|HAVAL(128|160|192|224|256)\n |CRC23(B)?|TIGER(128|160)?|WHIRLPOOL|ADLER32)\n|MYSQL_(BOTH|NUM|CLIENT_(SSL|COMPRESS|IGNORE_SPACE|INTERACTIVE|ASSOC))\n|MYSQLI_(REPORT_(STRICT|INDEX|OFF|ERROR|ALL)|REFRESH_(GRANT|MASTER|BACKUP_LOG|STATUS|SLAVE|HOSTS|THREADS|TABLES|LOG)\n |READ_DEFAULT_(FILE|GROUP)|(GROUP|MULTIPLE_KEY|BINARY|BLOB)_FLAG|BOTH\n |STMT_ATTR_(CURSOR_TYPE|UPDATE_MAX_LENGTH|PREFETCH_ROWS)|STORE_RESULT\n |SERVER_QUERY_(NO_((GOOD_)?INDEX_USED)|WAS_SLOW)|SET_(CHARSET_NAME|FLAG)\n |NO_(DEFAULT_VALUE_FLAG|DATA)|NOT_NULL_FLAG|NUM(_FLAG)?\n |CURSOR_TYPE_(READ_ONLY|SCROLLABLE|NO_CURSOR|FOR_UPDATE)\n |CLIENT_(SSL|NO_SCHEMA|COMPRESS|IGNORE_SPACE|INTERACTIVE|FOUND_ROWS)\n |TYPE_(GEOMETRY|((MEDIUM|LONG|TINY)_)?BLOB|BIT|SHORT|STRING|SET|YEAR|NULL|NEWDECIMAL|NEWDATE|CHAR\n |TIME(STAMP)?|TINY|INT24|INTERVAL|DOUBLE|DECIMAL|DATE(TIME)?|ENUM|VAR_STRING|FLOAT|LONG(LONG)?)\n |TIME_STAMP_FLAG|INIT_COMMAND|ZEROFILL_FLAG|ON_UPDATE_NOW_FLAG\n |OPT_(NET_((CMD|READ)_BUFFER_SIZE)|CONNECT_TIMEOUT|INT_AND_FLOAT_NATIVE|LOCAL_INFILE)\n |DEBUG_TRACE_ENABLED|DATA_TRUNCATED|USE_RESULT|(ENUM|(PART|PRI|UNIQUE)_KEY|UNSIGNED)_FLAG\n |ASSOC|ASYNC|AUTO_INCREMENT_FLAG)\n|MCRYPT_(RC(2|6)|RIJNDAEL_(128|192|256)|RAND|GOST|XTEA|MODE_(STREAM|NOFB|CBC|CFB|OFB|ECB)|MARS\n |BLOWFISH(_COMPAT)?|SERPENT|SKIPJACK|SAFER(64|128|PLUS)|CRYPT|CAST_(128|256)|TRIPLEDES|THREEWAY\n |TWOFISH|IDEA|(3)?DES|DECRYPT|DEV_(U)?RANDOM|PANAMA|ENCRYPT|ENIGNA|WAKE|LOKI97|ARCFOUR(_IV)?)\n|STREAM_(REPORT_ERRORS|MUST_SEEK|MKDIR_RECURSIVE|BUFFER_(NONE|FULL|LINE)|SHUT_(RD)?WR\n |SOCK_(RDM|RAW|STREAM|SEQPACKET|DGRAM)|SERVER_(BIND|LISTEN)\n |NOTIFY_(REDIRECTED|RESOLVE|MIME_TYPE_IS|SEVERITY_(INFO|ERR|WARN)|COMPLETED|CONNECT|PROGRESS\n |FILE_SIZE_IS|FAILURE|AUTH_(REQUIRED|RESULT))\n |CRYPTO_METHOD_((SSLv2(3)?|SSLv3|TLS)_(CLIENT|SERVER))|CLIENT_((ASYNC_)?CONNECT|PERSISTENT)\n |CAST_(AS_STREAM|FOR_SELECT)|(IGNORE|IS)_URL|IPPROTO_(RAW|TCP|ICMP|IP|UDP)|OOB\n |OPTION_(READ_(BUFFER|TIMEOUT)|BLOCKING|WRITE_BUFFER)|URL_STAT_(LINK|QUIET)|USE_PATH\n |PEEK|PF_(INET(6)?|UNIX)|ENFORCE_SAFE_MODE|FILTER_(ALL|READ|WRITE))\n|SUNFUNCS_RET_(DOUBLE|STRING|TIMESTAMP)\n|SQLITE_(READONLY|ROW|MISMATCH|MISUSE|BOTH|BUSY|SCHEMA|NOMEM|NOTFOUND|NOTADB|NOLFS|NUM|CORRUPT\n |CONSTRAINT|CANTOPEN|TOOBIG|INTERRUPT|INTERNAL|IOERR|OK|DONE|PROTOCOL|PERM|ERROR|EMPTY\n |FORMAT|FULL|LOCKED|ABORT|ASSOC|AUTH)\n|SQLITE3_(BOTH|BLOB|NUM|NULL|TEXT|INTEGER|OPEN_(READ(ONLY|WRITE)|CREATE)|FLOAT_ASSOC)\n|CURL(M_(BAD_((EASY)?HANDLE)|CALL_MULTI_PERFORM|INTERNAL_ERROR|OUT_OF_MEMORY|OK)\n |MSG_DONE|SSH_AUTH_(HOST|NONE|DEFAULT|PUBLICKEY|PASSWORD|KEYBOARD)\n |CLOSEPOLICY_(SLOWEST|CALLBACK|OLDEST|LEAST_(RECENTLY_USED|TRAFFIC)\n |INFO_(REDIRECT_(COUNT|TIME)|REQUEST_SIZE|SSL_VERIFYRESULT|STARTTRANSFER_TIME\n |(SIZE|SPEED)_(DOWNLOAD|UPLOAD)|HTTP_CODE|HEADER_(OUT|SIZE)|NAMELOOKUP_TIME\n |CONNECT_TIME|CONTENT_(TYPE|LENGTH_(DOWNLOAD|UPLOAD))|CERTINFO|TOTAL_TIME\n |PRIVATE|PRETRANSFER_TIME|EFFECTIVE_URL|FILETIME)\n |OPT_(RESUME_FROM|RETURNTRANSFER|REDIR_PROTOCOLS|REFERER|READ(DATA|FUNCTION)|RANGE|RANDOM_FILE\n |MAX(CONNECTS|REDIRS)|BINARYTRANSFER|BUFFERSIZE\n |SSH_(HOST_PUBLIC_KEY_MD5|(PRIVATE|PUBLIC)_KEYFILE)|AUTH_TYPES)\n |SSL(CERT(TYPE|PASSWD)?|ENGINE(_DEFAULT)?|VERSION|KEY(TYPE|PASSWD)?)\n |SSL_(CIPHER_LIST|VERIFY(HOST|PEER))\n |STDERR|HTTP(GET|HEADER|200ALIASES|_VERSION|PROXYTUNNEL|AUTH)\n |HEADER(FUNCTION)?|NO(BODY|SIGNAL|PROGRESS)|NETRC|CRLF|CONNECTTIMEOUT(_MS)?\n |COOKIE(SESSION|JAR|FILE)?|CUSTOMREQUEST|CERTINFO|CLOSEPOLICY|CA(INFO|PATH)|TRANSFERTEXT\n |TCP_NODELAY|TIME(CONDITION|OUT(_MS)?|VALUE)|INTERFACE|INFILE(SIZE)?|IPRESOLVE\n |DNS_(CACHE_TIMEOUT|USE_GLOBAL_CACHE)|URL|USER(AGENT|PWD)|UNRESTRICTED_AUTH|UPLOAD\n |PRIVATE|PROGRESSFUNCTION|PROXY(TYPE|USERPWD|PORT|AUTH)?|PROTOCOLS|PORT\n |POST(REDIR|QUOTE|FIELDS)?|PUT|EGDSOCKET|ENCODING|VERBOSE|KRB4LEVEL|KEYPASSWD|QUOTE|FRESH_CONNECT\n |FTP(APPEND|LISTONLY|PORT|SSLAUTH)\n |FTP_(SSL|SKIP_PASV_IP|CREATE_MISSING_DIRS|USE_EP(RT|SV)|FILEMETHOD)\n |FILE(TIME)?|FORBID_REUSE|FOLLOWLOCATION|FAILONERROR|WRITE(FUNCTION|HEADER)|LOW_SPEED_(LIMIT|TIME)\n |AUTOREFERER)\n |PROXY_(HTTP|SOCKS(4|5))|PROTO_(SCP|SFTP|HTTP(S)?|TELNET|TFTP|DICT|FTP(S)?|FILE|LDAP(S)?|ALL)\n |E_((RECV|READ)_ERROR|GOT_NOTHING|MALFORMAT_USER\n |BAD_(CONTENT_ENCODING|CALLING_ORDER|PASSWORD_ENTERED|FUNCTION_ARGUMENT)\n |SSH|SSL_(CIPHER|CONNECT_ERROR|CERTPROBLEM|CACERT|PEER_CERTIFICATE|ENGINE_(NOTFOUND|SETFAILED))\n |SHARE_IN_USE|SEND_ERROR|HTTP_(RANGE_ERROR|NOT_FOUND|PORT_FAILED|POST_ERROR)\n |COULDNT_(RESOLVE_(HOST|PROXY)|CONNECT)|TOO_MANY_REDIRECTS|TELNET_OPTION_SYNTAX|OBSOLETE\n |OUT_OF_MEMORY|OPERATION|TIMEOUTED|OK|URL_MALFORMAT(_USER)?|UNSUPPORTED_PROTOCOL\n |UNKNOWN_TELNET_OPTION|PARTIAL_FILE\n |FTP_(BAD_DOWNLOAD_RESUME|SSL_FAILED|COULDNT_(RETR_FILE|GET_SIZE|STOR_FILE|SET_(BINARY|ASCII)|USE_REST)\n |CANT_(GET_HOST|RECONNECT)|USER_PASSWORD_INCORRECT|PORT_FAILED|QUOTE_ERROR|WRITE_ERROR\n |WEIRD_((PASS|PASV|SERVER|USER)_REPLY|227_FORMAT)|ACCESS_DENIED)\n |FILESIZE_EXCEEDED|FILE_COULDNT_READ_FILE|FUNCTION_NOT_FOUND|FAILED_INIT|WRITE_ERROR|LIBRARY_NOT_FOUND\n |LDAP_(SEARCH_FAILED|CANNOT_BIND|INVALID_URL)|ABORTED_BY_CALLBACK)\n |VERSION_NOW\n |FTP(METHOD_(MULTI|SINGLE|NO)CWD|SSL_(ALL|NONE|CONTROL|TRY)|AUTH_(DEFAULT|SSL|TLS))\n |AUTH_(ANY(SAFE)?|BASIC|DIGEST|GSSNEGOTIATE|NTLM))\n|CURL_(HTTP_VERSION_(1_(0|1)|NONE)|NETRC_(REQUIRED|IGNORED|OPTIONAL)|TIMECOND_(IF(UN)?MODSINCE|LASTMOD)\n |IPRESOLVE_(V(4|6)|WHATEVER)|VERSION_(SSL|IPV6|KERBEROS4|LIBZ))\n|IMAGETYPE_(GIF|XBM|BMP|SWF|COUNT|TIFF_(MM|II)|ICO|IFF|UNKNOWN|JB2|JPX|JP2|JPC|JPEG(2000)?|PSD|PNG|WBMP)\n|INPUT_(REQUEST|GET|SERVER|SESSION|COOKIE|POST|ENV)|ICONV_(MIME_DECODE_(STRICT|CONTINUE_ON_ERROR)|IMPL|VERSION)\n|DNS_(MX|SRV|SOA|HINFO|NS|NAPTR|CNAME|TXT|PTR|ANY|ALL|AAAA|A(6)?)\n|DOM(STRING_SIZE_ERR)\n|DOM_((SYNTAX|HIERARCHY_REQUEST|NO_(MODIFICATION_ALLOWED|DATA_ALLOWED)|NOT_(FOUND|SUPPORTED)|NAMESPACE\n |INDEX_SIZE|USE_ATTRIBUTE|VALID_(MODIFICATION|STATE|CHARACTER|ACCESS)|PHP|VALIDATION|WRONG_DOCUMENT)_ERR)\n|JSON_(HEX_(TAG|QUOT|AMP|APOS)|NUMERIC_CHECK|ERROR_(SYNTAX|STATE_MISMATCH|NONE|CTRL_CHAR|DEPTH|UTF8)|FORCE_OBJECT)\n|PREG_((D_UTF8(_OFFSET)?|NO|INTERNAL|(BACKTRACK|RECURSION)_LIMIT)_ERROR|GREP_INVERT\n |SPLIT_(NO_EMPTY|(DELIM|OFFSET)_CAPTURE)|SET_ORDER|OFFSET_CAPTURE|PATTERN_ORDER)\n|PSFS_(PASS_ON|ERR_FATAL|FEED_ME|FLAG_(NORMAL|FLUSH_(CLOSE|INC)))\n|PCRE_VERSION|POSIX_((F|R|W|X)_OK|S_IF(REG|BLK|SOCK|CHR|IFO))\n|FNM_(NOESCAPE|CASEFOLD|PERIOD|PATHNAME)\n|FILTER_(REQUIRE_(SCALAR|ARRAY)|NULL_ON_FAILURE|CALLBACK|DEFAULT|UNSAFE_RAW\n |SANITIZE_(MAGIC_QUOTES|STRING|STRIPPED|SPECIAL_CHARS|NUMBER_(INT|FLOAT)|URL\n |EMAIL|ENCODED|FULL_SPCIAL_CHARS)\n |VALIDATE_(REGEXP|BOOLEAN|INT|IP|URL|EMAIL|FLOAT)\n |FORCE_ARRAY\n |FLAG_(SCHEME_REQUIRED|STRIP_(BACKTICK|HIGH|LOW)|HOST_REQUIRED|NONE|NO_(RES|PRIV)_RANGE|ENCODE_QUOTES\n |IPV(4|6)|PATH_REQUIRED|EMPTY_STRING_NULL|ENCODE_(HIGH|LOW|AMP)|QUERY_REQUIRED\n |ALLOW_(SCIENTIFIC|HEX|THOUSAND|OCTAL|FRACTION)))\n|FILE_(BINARY|SKIP_EMPTY_LINES|NO_DEFAULT_CONTEXT|TEXT|IGNORE_NEW_LINES|USE_INCLUDE_PATH|APPEND)\n|FILEINFO_(RAW|MIME(_(ENCODING|TYPE))?|SYMLINK|NONE|CONTINUE|DEVICES|PRESERVE_ATIME)\n|FORCE_(DEFLATE|GZIP)\n|LIBXML_(XINCLUDE|NSCLEAN|NO(XMLDECL|BLANKS|NET|CDATA|ERROR|EMPTYTAG|ENT|WARNING)\n |COMPACT|DTD(VALID|LOAD|ATTR)|((DOTTED|LOADED)_)?VERSION|PARSEHUGE|ERR_(NONE|ERROR|FATAL|WARNING)))\n\\b",
+ "name": "support.constant.ext.php",
+ "captures": {
+ "1": {
+ "name": "punctuation.separator.inheritance.php"
+ }
+ }
+ },
+ {
+ "match":
+ "(?x)\n(\\\\)?\\b\n(T_(RETURN|REQUIRE(_ONCE)?|GOTO|GLOBAL|(MINUS|MOD|MUL|XOR)_EQUAL|METHOD_C|ML_COMMENT|BREAK\n |BOOL_CAST|BOOLEAN_(AND|OR)|BAD_CHARACTER|SR(_EQUAL)?|STRING(_CAST|VARNAME)?|START_HEREDOC|STATIC\n |SWITCH|SL(_EQUAL)?|HALT_COMPILER|NS_(C|SEPARATOR)|NUM_STRING|NEW|NAMESPACE|CHARACTER|COMMENT\n |CONSTANT(_ENCAPSED_STRING)?|CONCAT_EQUAL|CONTINUE|CURLY_OPEN|CLOSE_TAG|CLONE|CLASS(_C)?\n |CASE|CATCH|TRY|THROW|IMPLEMENTS|ISSET|IS_((GREATER|SMALLER)_OR_EQUAL|(NOT_)?(IDENTICAL|EQUAL))\n |INSTANCEOF|INCLUDE(_ONCE)?|INC|INT_CAST|INTERFACE|INLINE_HTML|IF|OR_EQUAL|OBJECT_(CAST|OPERATOR)\n |OPEN_TAG(_WITH_ECHO)?|OLD_FUNCTION|DNUMBER|DIR|DIV_EQUAL|DOC_COMMENT|DOUBLE_(ARROW|CAST|COLON)\n |DOLLAR_OPEN_CURLY_BRACES|DO|DEC|DECLARE|DEFAULT|USE|UNSET(_CAST)?|PRINT|PRIVATE|PROTECTED|PUBLIC\n |PLUS_EQUAL|PAAMAYIM_NEKUDOTAYIM|EXTENDS|EXIT|EMPTY|ENCAPSED_AND_WHITESPACE\n |END(SWITCH|IF|DECLARE|FOR(EACH)?|WHILE)|END_HEREDOC|ECHO|EVAL|ELSE(IF)?|VAR(IABLE)?|FINAL|FILE\n |FOR(EACH)?|FUNC_C|FUNCTION|WHITESPACE|WHILE|LNUMBER|LIST|LINE|LOGICAL_(AND|OR|XOR)\n |ARRAY_(CAST)?|ABSTRACT|AS|AND_EQUAL))\n\\b",
+ "name": "support.constant.parser-token.php",
+ "captures": {
+ "1": {
+ "name": "punctuation.separator.inheritance.php"
+ }
+ }
+ },
+ {
+ "match": "(?i)[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*",
+ "name": "constant.other.php"
+ }
+ ]
+ },
+ "function-parameters": {
+ "patterns": [
+ {
+ "include": "#comments"
+ },
+ {
+ "match": ",",
+ "name": "punctuation.separator.delimiter.php"
+ },
+ {
+ "begin":
+ "(?xi)\n(?:(\\?)\\s*)?(array) # Typehint\n\\s+((&)?\\s*(\\$+)[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*) # Variable name with possible reference\n\\s*(=)\\s*(array)\\s*(\\() # Default value",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.operator.nullable-type.php"
+ },
+ "2": {
+ "name": "storage.type.php"
+ },
+ "3": {
+ "name": "variable.other.php"
+ },
+ "4": {
+ "name": "storage.modifier.reference.php"
+ },
+ "5": {
+ "name": "punctuation.definition.variable.php"
+ },
+ "6": {
+ "name": "keyword.operator.assignment.php"
+ },
+ "7": {
+ "name": "support.function.construct.php"
+ },
+ "8": {
+ "name": "punctuation.definition.array.begin.bracket.round.php"
+ }
+ },
+ "contentName": "meta.array.php",
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.array.end.bracket.round.php"
+ }
+ },
+ "name": "meta.function.parameter.array.php",
+ "patterns": [
+ {
+ "include": "#comments"
+ },
+ {
+ "include": "#strings"
+ },
+ {
+ "include": "#numbers"
+ }
+ ]
+ },
+ {
+ "match":
+ "(?xi)\n(?:(\\?)\\s*)?(array|callable) # Typehint\n\\s+((&)?\\s*(\\$+)[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*) # Variable name with possible reference\n(?: # Optional default value\n \\s*(=)\\s*\n (?:\n (null)\n |\n (\\[)((?>[^\\[\\]]+|\\[\\g<8>\\])*)(\\])\n |((?:\\S*?\\(\\))|(?:\\S*?))\n )\n)?\n\\s*(?=,|\\)|/[/*]|\\#|$) # A closing parentheses (end of argument list) or a comma or a comment",
+ "name": "meta.function.parameter.array.php",
+ "captures": {
+ "1": {
+ "name": "keyword.operator.nullable-type.php"
+ },
+ "2": {
+ "name": "storage.type.php"
+ },
+ "3": {
+ "name": "variable.other.php"
+ },
+ "4": {
+ "name": "storage.modifier.reference.php"
+ },
+ "5": {
+ "name": "punctuation.definition.variable.php"
+ },
+ "6": {
+ "name": "keyword.operator.assignment.php"
+ },
+ "7": {
+ "name": "constant.language.php"
+ },
+ "8": {
+ "name": "punctuation.section.array.begin.php"
+ },
+ "9": {
+ "patterns": [
+ {
+ "include": "#parameter-default-types"
+ }
+ ]
+ },
+ "10": {
+ "name": "punctuation.section.array.end.php"
+ },
+ "11": {
+ "name": "invalid.illegal.non-null-typehinted.php"
+ }
+ }
+ },
+ {
+ "begin":
+ "(?xi)\n(?:(\\?)\\s*)?\n(\\\\?(?:[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*\\\\)*) # Optional namespace\n([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*) # Typehinted class name\n\\s+((&)?\\s*(\\.\\.\\.)?(\\$+)[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*) # Variable name with possible reference",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.operator.nullable-type.php"
+ },
+ "2": {
+ "name": "support.other.namespace.php",
+ "patterns": [
+ {
+ "match":
+ "(?i)[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*",
+ "name": "storage.type.php"
+ },
+ {
+ "match": "\\\\",
+ "name": "punctuation.separator.inheritance.php"
+ }
+ ]
+ },
+ "3": {
+ "name": "storage.type.php"
+ },
+ "4": {
+ "name": "variable.other.php"
+ },
+ "5": {
+ "name": "storage.modifier.reference.php"
+ },
+ "6": {
+ "name": "keyword.operator.variadic.php"
+ },
+ "7": {
+ "name": "punctuation.definition.variable.php"
+ }
+ },
+ "end": "(?=,|\\)|/[/*]|\\#)",
+ "name": "meta.function.parameter.typehinted.php",
+ "patterns": [
+ {
+ "begin": "=",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.assignment.php"
+ }
+ },
+ "end": "(?=,|\\)|/[/*]|\\#)",
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "variable.other.php"
+ },
+ "2": {
+ "name": "storage.modifier.reference.php"
+ },
+ "3": {
+ "name": "keyword.operator.variadic.php"
+ },
+ "4": {
+ "name": "punctuation.definition.variable.php"
+ }
+ },
+ "match":
+ "(?xi)\n((&)?\\s*(\\.\\.\\.)?(\\$+)[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*) # Variable name with possible reference\n\\s*(?=,|\\)|/[/*]|\\#|$) # A closing parentheses (end of argument list) or a comma or a comment",
+ "name": "meta.function.parameter.no-default.php"
+ },
+ {
+ "begin":
+ "(?xi)\n((&)?\\s*(\\.\\.\\.)?(\\$+)[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*) # Variable name with possible reference\n\\s*(=)\\s*\n(?:(\\[)((?>[^\\[\\]]+|\\[\\g<6>\\])*)(\\]))? # Optional default type",
+ "beginCaptures": {
+ "1": {
+ "name": "variable.other.php"
+ },
+ "2": {
+ "name": "storage.modifier.reference.php"
+ },
+ "3": {
+ "name": "keyword.operator.variadic.php"
+ },
+ "4": {
+ "name": "punctuation.definition.variable.php"
+ },
+ "5": {
+ "name": "keyword.operator.assignment.php"
+ },
+ "6": {
+ "name": "punctuation.section.array.begin.php"
+ },
+ "7": {
+ "patterns": [
+ {
+ "include": "#parameter-default-types"
+ }
+ ]
+ },
+ "8": {
+ "name": "punctuation.section.array.end.php"
+ }
+ },
+ "end": "(?=,|\\)|/[/*]|\\#)",
+ "name": "meta.function.parameter.default.php",
+ "patterns": [
+ {
+ "include": "#parameter-default-types"
+ }
+ ]
+ }
+ ]
+ },
+ "function-call": {
+ "patterns": [
+ {
+ "begin":
+ "(?xi)\n(\n \\\\?(?)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.arguments.end.bracket.round.php"
+ }
+ },
+ "name": "meta.function-call.php",
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ {
+ "begin":
+ "(?i)(\\\\)?(?)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.arguments.end.bracket.round.php"
+ }
+ },
+ "name": "meta.function-call.php",
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ {
+ "match": "(?i)\\b(print|echo)\\b",
+ "name": "support.function.construct.output.php"
+ }
+ ]
+ },
+ "heredoc": {
+ "patterns": [
+ {
+ "begin":
+ "(?i)(?=<<<\\s*(\"?)([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)(\\1)\\s*$)",
+ "end": "(?!\\G)",
+ "name": "string.unquoted.heredoc.php",
+ "patterns": [
+ {
+ "include": "#heredoc_interior"
+ }
+ ]
+ },
+ {
+ "begin": "(?=<<<\\s*'([a-zA-Z_]+[a-zA-Z0-9_]*)'\\s*$)",
+ "end": "(?!\\G)",
+ "name": "string.unquoted.nowdoc.php",
+ "patterns": [
+ {
+ "include": "#nowdoc_interior"
+ }
+ ]
+ }
+ ]
+ },
+ "heredoc_interior": {
+ "patterns": [
+ {
+ "begin": "(<<<)\\s*(\"?)(HTML)(\\2)(\\s*)$",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.begin.php"
+ },
+ "1": {
+ "name": "punctuation.definition.string.php"
+ },
+ "3": {
+ "name": "keyword.operator.heredoc.php"
+ },
+ "5": {
+ "name": "invalid.illegal.trailing-whitespace.php"
+ }
+ },
+ "contentName": "text.html",
+ "end": "^(\\3)(?=;?$)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.end.php"
+ },
+ "1": {
+ "name": "keyword.operator.heredoc.php"
+ }
+ },
+ "name": "meta.embedded.html",
+ "patterns": [
+ {
+ "include": "#interpolation"
+ },
+ {
+ "include": "text.html.basic"
+ }
+ ]
+ },
+ {
+ "begin": "(<<<)\\s*(\"?)(XML)(\\2)(\\s*)$",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.begin.php"
+ },
+ "1": {
+ "name": "punctuation.definition.string.php"
+ },
+ "3": {
+ "name": "keyword.operator.heredoc.php"
+ },
+ "5": {
+ "name": "invalid.illegal.trailing-whitespace.php"
+ }
+ },
+ "contentName": "text.xml",
+ "end": "^(\\3)(?=;?$)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.end.php"
+ },
+ "1": {
+ "name": "keyword.operator.heredoc.php"
+ }
+ },
+ "name": "meta.embedded.xml",
+ "patterns": [
+ {
+ "include": "#interpolation"
+ },
+ {
+ "include": "text.xml"
+ }
+ ]
+ },
+ {
+ "begin": "(<<<)\\s*(\"?)(SQL)(\\2)(\\s*)$",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.begin.php"
+ },
+ "1": {
+ "name": "punctuation.definition.string.php"
+ },
+ "3": {
+ "name": "keyword.operator.heredoc.php"
+ },
+ "5": {
+ "name": "invalid.illegal.trailing-whitespace.php"
+ }
+ },
+ "contentName": "source.sql",
+ "end": "^(\\3)(?=;?$)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.end.php"
+ },
+ "1": {
+ "name": "keyword.operator.heredoc.php"
+ }
+ },
+ "name": "meta.embedded.sql",
+ "patterns": [
+ {
+ "include": "#interpolation"
+ },
+ {
+ "include": "source.sql"
+ }
+ ]
+ },
+ {
+ "begin": "(<<<)\\s*(\"?)(JAVASCRIPT|JS)(\\2)(\\s*)$",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.begin.php"
+ },
+ "1": {
+ "name": "punctuation.definition.string.php"
+ },
+ "3": {
+ "name": "keyword.operator.heredoc.php"
+ },
+ "5": {
+ "name": "invalid.illegal.trailing-whitespace.php"
+ }
+ },
+ "contentName": "source.js",
+ "end": "^(\\3)(?=;?$)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.end.php"
+ },
+ "1": {
+ "name": "keyword.operator.heredoc.php"
+ }
+ },
+ "name": "meta.embedded.js",
+ "patterns": [
+ {
+ "include": "#interpolation"
+ },
+ {
+ "include": "source.js"
+ }
+ ]
+ },
+ {
+ "begin": "(<<<)\\s*(\"?)(JSON)(\\2)(\\s*)$",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.begin.php"
+ },
+ "1": {
+ "name": "punctuation.definition.string.php"
+ },
+ "3": {
+ "name": "keyword.operator.heredoc.php"
+ },
+ "5": {
+ "name": "invalid.illegal.trailing-whitespace.php"
+ }
+ },
+ "contentName": "source.json",
+ "end": "^(\\3)(?=;?$)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.end.php"
+ },
+ "1": {
+ "name": "keyword.operator.heredoc.php"
+ }
+ },
+ "name": "meta.embedded.json",
+ "patterns": [
+ {
+ "include": "#interpolation"
+ },
+ {
+ "include": "source.json"
+ }
+ ]
+ },
+ {
+ "begin": "(<<<)\\s*(\"?)(CSS)(\\2)(\\s*)$",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.begin.php"
+ },
+ "1": {
+ "name": "punctuation.definition.string.php"
+ },
+ "3": {
+ "name": "keyword.operator.heredoc.php"
+ },
+ "5": {
+ "name": "invalid.illegal.trailing-whitespace.php"
+ }
+ },
+ "contentName": "source.css",
+ "end": "^(\\3)(?=;?$)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.end.php"
+ },
+ "1": {
+ "name": "keyword.operator.heredoc.php"
+ }
+ },
+ "name": "meta.embedded.css",
+ "patterns": [
+ {
+ "include": "#interpolation"
+ },
+ {
+ "include": "source.css"
+ }
+ ]
+ },
+ {
+ "begin": "(<<<)\\s*(\"?)(REGEXP?)(\\2)(\\s*)$",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.begin.php"
+ },
+ "1": {
+ "name": "punctuation.definition.string.php"
+ },
+ "3": {
+ "name": "keyword.operator.heredoc.php"
+ },
+ "5": {
+ "name": "invalid.illegal.trailing-whitespace.php"
+ }
+ },
+ "contentName": "string.regexp.heredoc.php",
+ "end": "^(\\3)(?=;?$)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.end.php"
+ },
+ "1": {
+ "name": "keyword.operator.heredoc.php"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#interpolation"
+ },
+ {
+ "match": "(\\\\){1,2}[.$^\\[\\]{}]",
+ "name": "constant.character.escape.regex.php"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.arbitrary-repitition.php"
+ },
+ "3": {
+ "name": "punctuation.definition.arbitrary-repitition.php"
+ }
+ },
+ "match": "({)\\d+(,\\d+)?(})",
+ "name": "string.regexp.arbitrary-repitition.php"
+ },
+ {
+ "begin": "\\[(?:\\^?\\])?",
+ "captures": {
+ "0": {
+ "name": "punctuation.definition.character-class.php"
+ }
+ },
+ "end": "\\]",
+ "name": "string.regexp.character-class.php",
+ "patterns": [
+ {
+ "match": "\\\\[\\\\'\\[\\]]",
+ "name": "constant.character.escape.php"
+ }
+ ]
+ },
+ {
+ "match": "[$^+*]",
+ "name": "keyword.operator.regexp.php"
+ },
+ {
+ "begin":
+ "(?i)(?<=^|\\s)(#)\\s(?=[[a-z0-9_\\x{7f}-\\x{7fffffff},. \\t?!-][^\\x{00}-\\x{7f}]]*$)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.comment.php"
+ }
+ },
+ "end": "$",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.comment.php"
+ }
+ },
+ "name": "comment.line.number-sign.php"
+ }
+ ]
+ },
+ {
+ "begin":
+ "(?i)(<<<)\\s*(\"?)([a-z_\\x{7f}-\\x{7fffffff}]+[a-z0-9_\\x{7f}-\\x{7fffffff}]*)(\\2)(\\s*)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.string.php"
+ },
+ "3": {
+ "name": "keyword.operator.heredoc.php"
+ },
+ "5": {
+ "name": "invalid.illegal.trailing-whitespace.php"
+ }
+ },
+ "end": "^(\\3)(?=;?$)",
+ "endCaptures": {
+ "1": {
+ "name": "keyword.operator.heredoc.php"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#interpolation"
+ }
+ ]
+ }
+ ]
+ },
+ "nowdoc_interior": {
+ "patterns": [
+ {
+ "begin": "(<<<)\\s*'(HTML)'(\\s*)$",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.begin.php"
+ },
+ "1": {
+ "name": "punctuation.definition.string.php"
+ },
+ "2": {
+ "name": "keyword.operator.nowdoc.php"
+ },
+ "3": {
+ "name": "invalid.illegal.trailing-whitespace.php"
+ }
+ },
+ "contentName": "text.html",
+ "end": "^(\\2)(?=;?$)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.end.php"
+ },
+ "1": {
+ "name": "keyword.operator.nowdoc.php"
+ }
+ },
+ "name": "meta.embedded.html",
+ "patterns": [
+ {
+ "include": "text.html.basic"
+ }
+ ]
+ },
+ {
+ "begin": "(<<<)\\s*'(XML)'(\\s*)$",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.begin.php"
+ },
+ "1": {
+ "name": "punctuation.definition.string.php"
+ },
+ "2": {
+ "name": "keyword.operator.nowdoc.php"
+ },
+ "3": {
+ "name": "invalid.illegal.trailing-whitespace.php"
+ }
+ },
+ "contentName": "text.xml",
+ "end": "^(\\2)(?=;?$)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.end.php"
+ },
+ "1": {
+ "name": "keyword.operator.nowdoc.php"
+ }
+ },
+ "name": "meta.embedded.xml",
+ "patterns": [
+ {
+ "include": "text.xml"
+ }
+ ]
+ },
+ {
+ "begin": "(<<<)\\s*'(SQL)'(\\s*)$",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.begin.php"
+ },
+ "1": {
+ "name": "punctuation.definition.string.php"
+ },
+ "2": {
+ "name": "keyword.operator.nowdoc.php"
+ },
+ "3": {
+ "name": "invalid.illegal.trailing-whitespace.php"
+ }
+ },
+ "contentName": "source.sql",
+ "end": "^(\\2)(?=;?$)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.end.php"
+ },
+ "1": {
+ "name": "keyword.operator.nowdoc.php"
+ }
+ },
+ "name": "meta.embedded.sql",
+ "patterns": [
+ {
+ "include": "source.sql"
+ }
+ ]
+ },
+ {
+ "begin": "(<<<)\\s*'(JAVASCRIPT|JS)'(\\s*)$",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.begin.php"
+ },
+ "1": {
+ "name": "punctuation.definition.string.php"
+ },
+ "2": {
+ "name": "keyword.operator.nowdoc.php"
+ },
+ "3": {
+ "name": "invalid.illegal.trailing-whitespace.php"
+ }
+ },
+ "contentName": "source.js",
+ "end": "^(\\2)(?=;?$)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.end.php"
+ },
+ "1": {
+ "name": "keyword.operator.nowdoc.php"
+ }
+ },
+ "name": "meta.embedded.js",
+ "patterns": [
+ {
+ "include": "source.js"
+ }
+ ]
+ },
+ {
+ "begin": "(<<<)\\s*'(JSON)'(\\s*)$",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.begin.php"
+ },
+ "1": {
+ "name": "punctuation.definition.string.php"
+ },
+ "2": {
+ "name": "keyword.operator.nowdoc.php"
+ },
+ "3": {
+ "name": "invalid.illegal.trailing-whitespace.php"
+ }
+ },
+ "contentName": "source.json",
+ "end": "^(\\2)(?=;?$)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.end.php"
+ },
+ "1": {
+ "name": "keyword.operator.nowdoc.php"
+ }
+ },
+ "name": "meta.embedded.json",
+ "patterns": [
+ {
+ "include": "source.json"
+ }
+ ]
+ },
+ {
+ "begin": "(<<<)\\s*'(CSS)'(\\s*)$",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.begin.php"
+ },
+ "1": {
+ "name": "punctuation.definition.string.php"
+ },
+ "2": {
+ "name": "keyword.operator.nowdoc.php"
+ },
+ "3": {
+ "name": "invalid.illegal.trailing-whitespace.php"
+ }
+ },
+ "contentName": "source.css",
+ "end": "^(\\2)(?=;?$)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.end.php"
+ },
+ "1": {
+ "name": "keyword.operator.nowdoc.php"
+ }
+ },
+ "name": "meta.embedded.css",
+ "patterns": [
+ {
+ "include": "source.css"
+ }
+ ]
+ },
+ {
+ "begin": "(<<<)\\s*'(REGEXP?)'(\\s*)$",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.begin.php"
+ },
+ "1": {
+ "name": "punctuation.definition.string.php"
+ },
+ "2": {
+ "name": "keyword.operator.nowdoc.php"
+ },
+ "3": {
+ "name": "invalid.illegal.trailing-whitespace.php"
+ }
+ },
+ "contentName": "string.regexp.nowdoc.php",
+ "end": "^(\\2)(?=;?$)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.end.php"
+ },
+ "1": {
+ "name": "keyword.operator.nowdoc.php"
+ }
+ },
+ "patterns": [
+ {
+ "match": "(\\\\){1,2}[.$^\\[\\]{}]",
+ "name": "constant.character.escape.regex.php"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.arbitrary-repitition.php"
+ },
+ "3": {
+ "name": "punctuation.definition.arbitrary-repitition.php"
+ }
+ },
+ "match": "({)\\d+(,\\d+)?(})",
+ "name": "string.regexp.arbitrary-repitition.php"
+ },
+ {
+ "begin": "\\[(?:\\^?\\])?",
+ "captures": {
+ "0": {
+ "name": "punctuation.definition.character-class.php"
+ }
+ },
+ "end": "\\]",
+ "name": "string.regexp.character-class.php",
+ "patterns": [
+ {
+ "match": "\\\\[\\\\'\\[\\]]",
+ "name": "constant.character.escape.php"
+ }
+ ]
+ },
+ {
+ "match": "[$^+*]",
+ "name": "keyword.operator.regexp.php"
+ },
+ {
+ "begin":
+ "(?i)(?<=^|\\s)(#)\\s(?=[[a-z0-9_\\x{7f}-\\x{7fffffff},. \\t?!-][^\\x{00}-\\x{7f}]]*$)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.comment.php"
+ }
+ },
+ "end": "$",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.comment.php"
+ }
+ },
+ "name": "comment.line.number-sign.php"
+ }
+ ]
+ },
+ {
+ "begin":
+ "(?i)(<<<)\\s*'([a-z_\\x{7f}-\\x{7fffffff}]+[a-z0-9_\\x{7f}-\\x{7fffffff}]*)'(\\s*)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.string.php"
+ },
+ "2": {
+ "name": "keyword.operator.nowdoc.php"
+ },
+ "3": {
+ "name": "invalid.illegal.trailing-whitespace.php"
+ }
+ },
+ "end": "^(\\2)(?=;?$)",
+ "endCaptures": {
+ "1": {
+ "name": "keyword.operator.nowdoc.php"
+ }
+ }
+ }
+ ]
+ },
+ "instantiation": {
+ "begin": "(?i)(new)\\s+",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.new.php"
+ }
+ },
+ "end": "(?i)(?=[^a-z0-9_\\x{7f}-\\x{7fffffff}\\\\])",
+ "patterns": [
+ {
+ "match": "(?i)(parent|static|self)(?![a-z0-9_\\x{7f}-\\x{7fffffff}])",
+ "name": "storage.type.php"
+ },
+ {
+ "include": "#class-name"
+ },
+ {
+ "include": "#variable-name"
+ }
+ ]
+ },
+ "interpolation": {
+ "patterns": [
+ {
+ "match": "\\\\[0-7]{1,3}",
+ "name": "constant.character.escape.octal.php"
+ },
+ {
+ "match": "\\\\x[0-9A-Fa-f]{1,2}",
+ "name": "constant.character.escape.hex.php"
+ },
+ {
+ "match": "\\\\u{[0-9A-Fa-f]+}",
+ "name": "constant.character.escape.unicode.php"
+ },
+ {
+ "match": "\\\\[nrtvef$\\\\]",
+ "name": "constant.character.escape.php"
+ },
+ {
+ "begin": "{(?=\\$.*?})",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.variable.php"
+ }
+ },
+ "end": "}",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.variable.php"
+ }
+ },
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ {
+ "include": "#variable-name"
+ }
+ ]
+ },
+ "interpolation_double_quoted": {
+ "patterns": [
+ {
+ "match": "\\\\\"",
+ "name": "constant.character.escape.php"
+ },
+ {
+ "include": "#interpolation"
+ }
+ ]
+ },
+ "invoke-call": {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.variable.php"
+ },
+ "2": {
+ "name": "variable.other.php"
+ }
+ },
+ "match":
+ "(?i)(\\$+)([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)(?=\\s*\\()",
+ "name": "meta.function-call.invoke.php"
+ },
+ "namespace": {
+ "begin":
+ "(?i)(?:(namespace)|[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)?(\\\\)",
+ "beginCaptures": {
+ "1": {
+ "name": "variable.language.namespace.php"
+ },
+ "2": {
+ "name": "punctuation.separator.inheritance.php"
+ }
+ },
+ "end": "(?i)(?![a-z0-9_\\x{7f}-\\x{7fffffff}]*\\\\)",
+ "name": "support.other.namespace.php",
+ "patterns": [
+ {
+ "match": "\\\\",
+ "name": "punctuation.separator.inheritance.php"
+ }
+ ]
+ },
+ "numbers": {
+ "patterns": [
+ {
+ "match": "0[xX][0-9a-fA-F]+",
+ "name": "constant.numeric.hex.php"
+ },
+ {
+ "match": "0[bB][01]+",
+ "name": "constant.numeric.binary.php"
+ },
+ {
+ "match": "0[0-7]+",
+ "name": "constant.numeric.octal.php"
+ },
+ {
+ "match":
+ "(?x)\n(?:\n [0-9]*(\\.)[0-9]+(?:[eE][+-]?[0-9]+)?|\n [0-9]+(\\.)[0-9]*(?:[eE][+-]?[0-9]+)?|\n [0-9]+[eE][+-]?[0-9]+\n)",
+ "name": "constant.numeric.decimal.php",
+ "captures": {
+ "1": {
+ "name": "punctuation.separator.decimal.period.php"
+ },
+ "2": {
+ "name": "punctuation.separator.decimal.period.php"
+ }
+ }
+ },
+ {
+ "match": "0|[1-9][0-9]*",
+ "name": "constant.numeric.decimal.php"
+ }
+ ]
+ },
+ "object": {
+ "patterns": [
+ {
+ "begin": "(->)(\\$?{)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.operator.class.php"
+ },
+ "2": {
+ "name": "punctuation.definition.variable.php"
+ }
+ },
+ "end": "}",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.variable.php"
+ }
+ },
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ {
+ "begin":
+ "(?i)(->)([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)\\s*(\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.operator.class.php"
+ },
+ "2": {
+ "name": "entity.name.function.php"
+ },
+ "3": {
+ "name": "punctuation.definition.arguments.begin.bracket.round.php"
+ }
+ },
+ "end": "\\)|(?=\\?>)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.arguments.end.bracket.round.php"
+ }
+ },
+ "name": "meta.method-call.php",
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "keyword.operator.class.php"
+ },
+ "2": {
+ "name": "variable.other.property.php"
+ },
+ "3": {
+ "name": "punctuation.definition.variable.php"
+ }
+ },
+ "match":
+ "(?i)(->)((\\$+)?[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)?"
+ }
+ ]
+ },
+ "parameter-default-types": {
+ "patterns": [
+ {
+ "include": "#strings"
+ },
+ {
+ "include": "#numbers"
+ },
+ {
+ "include": "#string-backtick"
+ },
+ {
+ "include": "#variables"
+ },
+ {
+ "match": "=>",
+ "name": "keyword.operator.key.php"
+ },
+ {
+ "match": "=",
+ "name": "keyword.operator.assignment.php"
+ },
+ {
+ "match": "&(?=\\s*\\$)",
+ "name": "storage.modifier.reference.php"
+ },
+ {
+ "begin": "(array)\\s*(\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "support.function.construct.php"
+ },
+ "2": {
+ "name": "punctuation.definition.array.begin.bracket.round.php"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.array.end.bracket.round.php"
+ }
+ },
+ "name": "meta.array.php",
+ "patterns": [
+ {
+ "include": "#parameter-default-types"
+ }
+ ]
+ },
+ {
+ "include": "#instantiation"
+ },
+ {
+ "begin":
+ "(?xi)\n(?=[a-z0-9_\\x{7f}-\\x{7fffffff}\\\\]+(::)\n ([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)?\n)",
+ "end": "(?i)(::)([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)?",
+ "endCaptures": {
+ "1": {
+ "name": "keyword.operator.class.php"
+ },
+ "2": {
+ "name": "constant.other.class.php"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#class-name"
+ }
+ ]
+ },
+ {
+ "include": "#constants"
+ }
+ ]
+ },
+ "php_doc": {
+ "patterns": [
+ {
+ "match": "^(?!\\s*\\*).*?(?:(?=\\*\\/)|$\\n?)",
+ "name": "invalid.illegal.missing-asterisk.phpdoc.php"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "keyword.other.phpdoc.php"
+ },
+ "3": {
+ "name": "storage.modifier.php"
+ },
+ "4": {
+ "name": "invalid.illegal.wrong-access-type.phpdoc.php"
+ }
+ },
+ "match": "^\\s*\\*\\s*(@access)\\s+((public|private|protected)|(.+))\\s*$"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "keyword.other.phpdoc.php"
+ },
+ "2": {
+ "name": "markup.underline.link.php"
+ }
+ },
+ "match": "(@xlink)\\s+(.+)\\s*$"
+ },
+ {
+ "begin":
+ "(@(?:global|param|property(-(read|write))?|return|throws|var))\\s+(?=[A-Za-z_\\x{7f}-\\x{7fffffff}\\\\]|\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.phpdoc.php"
+ }
+ },
+ "end": "(?=\\s|\\*/)",
+ "contentName": "meta.other.type.phpdoc.php",
+ "patterns": [
+ {
+ "include": "#php_doc_types_array_multiple"
+ },
+ {
+ "include": "#php_doc_types_array_single"
+ },
+ {
+ "include": "#php_doc_types"
+ }
+ ]
+ },
+ {
+ "match":
+ "(?x)\n@\n(\n api|abstract|author|category|copyright|example|global|inherit[Dd]oc|internal|\n license|link|method|property(-(read|write))?|package|param|return|see|since|source|\n static|subpackage|throws|todo|var|version|uses|deprecated|final|ignore\n)\\b",
+ "name": "keyword.other.phpdoc.php"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "keyword.other.phpdoc.php"
+ }
+ },
+ "match": "{(@(link|inherit[Dd]oc)).+?}",
+ "name": "meta.tag.inline.phpdoc.php"
+ }
+ ]
+ },
+ "php_doc_types": {
+ "match":
+ "(?i)[a-z_\\x{7f}-\\x{7fffffff}\\\\][a-z0-9_\\x{7f}-\\x{7fffffff}\\\\]*(\\|[a-z_\\x{7f}-\\x{7fffffff}\\\\][a-z0-9_\\x{7f}-\\x{7fffffff}\\\\]*)*",
+ "captures": {
+ "0": {
+ "patterns": [
+ {
+ "match":
+ "(?x)\\b\n(string|integer|int|boolean|bool|float|double|object|mixed\n|array|resource|void|null|callback|false|true|self)\\b",
+ "name": "keyword.other.type.php"
+ },
+ {
+ "include": "#class-name"
+ },
+ {
+ "match": "\\|",
+ "name": "punctuation.separator.delimiter.php"
+ }
+ ]
+ }
+ }
+ },
+ "php_doc_types_array_multiple": {
+ "begin": "\\(",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.type.begin.bracket.round.phpdoc.php"
+ }
+ },
+ "end": "(\\))(\\[\\])|(?=\\*/)",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.definition.type.end.bracket.round.phpdoc.php"
+ },
+ "2": {
+ "name": "keyword.other.array.phpdoc.php"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#php_doc_types_array_multiple"
+ },
+ {
+ "include": "#php_doc_types_array_single"
+ },
+ {
+ "include": "#php_doc_types"
+ },
+ {
+ "match": "\\|",
+ "name": "punctuation.separator.delimiter.php"
+ }
+ ]
+ },
+ "php_doc_types_array_single": {
+ "match":
+ "(?i)([a-z_\\x{7f}-\\x{7fffffff}\\\\][a-z0-9_\\x{7f}-\\x{7fffffff}\\\\]*)(\\[\\])",
+ "captures": {
+ "1": {
+ "patterns": [
+ {
+ "include": "#php_doc_types"
+ }
+ ]
+ },
+ "2": {
+ "name": "keyword.other.array.phpdoc.php"
+ }
+ }
+ },
+ "regex-double-quoted": {
+ "begin": "\"/(?=(\\\\.|[^\"/])++/[imsxeADSUXu]*\")",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.php"
+ }
+ },
+ "end": "(/)([imsxeADSUXu]*)(\")",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.php"
+ }
+ },
+ "name": "string.regexp.double-quoted.php",
+ "patterns": [
+ {
+ "match": "(\\\\){1,2}[.$^\\[\\]{}]",
+ "name": "constant.character.escape.regex.php"
+ },
+ {
+ "include": "#interpolation_double_quoted"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.arbitrary-repetition.php"
+ },
+ "3": {
+ "name": "punctuation.definition.arbitrary-repetition.php"
+ }
+ },
+ "match": "({)\\d+(,\\d+)?(})",
+ "name": "string.regexp.arbitrary-repetition.php"
+ },
+ {
+ "begin": "\\[(?:\\^?\\])?",
+ "captures": {
+ "0": {
+ "name": "punctuation.definition.character-class.php"
+ }
+ },
+ "end": "\\]",
+ "name": "string.regexp.character-class.php",
+ "patterns": [
+ {
+ "include": "#interpolation_double_quoted"
+ }
+ ]
+ },
+ {
+ "match": "[$^+*]",
+ "name": "keyword.operator.regexp.php"
+ }
+ ]
+ },
+ "regex-single-quoted": {
+ "begin": "'/(?=(\\\\(?:\\\\(?:\\\\[\\\\']?|[^'])|.)|[^'/])++/[imsxeADSUXu]*')",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.php"
+ }
+ },
+ "end": "(/)([imsxeADSUXu]*)(')",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.php"
+ }
+ },
+ "name": "string.regexp.single-quoted.php",
+ "patterns": [
+ {
+ "include": "#single_quote_regex_escape"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.arbitrary-repetition.php"
+ },
+ "3": {
+ "name": "punctuation.definition.arbitrary-repetition.php"
+ }
+ },
+ "match": "({)\\d+(,\\d+)?(})",
+ "name": "string.regexp.arbitrary-repetition.php"
+ },
+ {
+ "begin": "\\[(?:\\^?\\])?",
+ "captures": {
+ "0": {
+ "name": "punctuation.definition.character-class.php"
+ }
+ },
+ "end": "\\]",
+ "name": "string.regexp.character-class.php"
+ },
+ {
+ "match": "[$^+*]",
+ "name": "keyword.operator.regexp.php"
+ }
+ ]
+ },
+ "scope-resolution": {
+ "patterns": [
+ {
+ "match":
+ "([A-Za-z_\\x{7f}-\\x{7fffffff}\\\\][A-Za-z0-9_\\x{7f}-\\x{7fffffff}\\\\]*)(?=\\s*::)",
+ "captures": {
+ "1": {
+ "patterns": [
+ {
+ "match": "\\b(self|static|parent)\\b",
+ "name": "storage.type.php"
+ },
+ {
+ "include": "#class-name"
+ },
+ {
+ "include": "#variable-name"
+ }
+ ]
+ }
+ }
+ },
+ {
+ "begin":
+ "(?i)(::)\\s*([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)\\s*(\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.operator.class.php"
+ },
+ "2": {
+ "name": "entity.name.function.php"
+ },
+ "3": {
+ "name": "punctuation.definition.arguments.begin.bracket.round.php"
+ }
+ },
+ "end": "\\)|(?=\\?>)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.arguments.end.bracket.round.php"
+ }
+ },
+ "name": "meta.method-call.static.php",
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ {
+ "match": "(?i)(::)\\s*(class)\\b",
+ "captures": {
+ "1": {
+ "name": "keyword.operator.class.php"
+ },
+ "2": {
+ "name": "keyword.other.class.php"
+ }
+ }
+ },
+ {
+ "match":
+ "(?xi)\n(::)\\s*\n(?:\n ((\\$+)[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*) # Variable\n |\n ([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*) # Constant\n)?",
+ "captures": {
+ "1": {
+ "name": "keyword.operator.class.php"
+ },
+ "2": {
+ "name": "variable.other.class.php"
+ },
+ "3": {
+ "name": "punctuation.definition.variable.php"
+ },
+ "4": {
+ "name": "constant.other.class.php"
+ }
+ }
+ }
+ ]
+ },
+ "single_quote_regex_escape": {
+ "match": "\\\\(?:\\\\(?:\\\\[\\\\']?|[^'])|.)",
+ "name": "constant.character.escape.php"
+ },
+ "sql-string-double-quoted": {
+ "begin": "\"\\s*(?=(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER|AND)\\b)",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.php"
+ }
+ },
+ "contentName": "source.sql.embedded.php",
+ "end": "\"",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.php"
+ }
+ },
+ "name": "string.quoted.double.sql.php",
+ "patterns": [
+ {
+ "match": "(#)(\\\\\"|[^\"])*(?=\"|$)",
+ "name": "comment.line.number-sign.sql",
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.comment.sql"
+ }
+ }
+ },
+ {
+ "match": "(--)(\\\\\"|[^\"])*(?=\"|$)",
+ "name": "comment.line.double-dash.sql",
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.comment.sql"
+ }
+ }
+ },
+ {
+ "match": "\\\\[\\\\\"`']",
+ "name": "constant.character.escape.php"
+ },
+ {
+ "match": "'(?=((\\\\')|[^'\"])*(\"|$))",
+ "name": "string.quoted.single.unclosed.sql"
+ },
+ {
+ "match": "`(?=((\\\\`)|[^`\"])*(\"|$))",
+ "name": "string.quoted.other.backtick.unclosed.sql"
+ },
+ {
+ "begin": "'",
+ "end": "'",
+ "name": "string.quoted.single.sql",
+ "patterns": [
+ {
+ "include": "#interpolation_double_quoted"
+ }
+ ]
+ },
+ {
+ "begin": "`",
+ "end": "`",
+ "name": "string.quoted.other.backtick.sql",
+ "patterns": [
+ {
+ "include": "#interpolation_double_quoted"
+ }
+ ]
+ },
+ {
+ "include": "#interpolation_double_quoted"
+ },
+ {
+ "include": "source.sql"
+ }
+ ]
+ },
+ "sql-string-single-quoted": {
+ "begin": "'\\s*(?=(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER|AND)\\b)",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.php"
+ }
+ },
+ "contentName": "source.sql.embedded.php",
+ "end": "'",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.php"
+ }
+ },
+ "name": "string.quoted.single.sql.php",
+ "patterns": [
+ {
+ "match": "(#)(\\\\'|[^'])*(?='|$)",
+ "name": "comment.line.number-sign.sql",
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.comment.sql"
+ }
+ }
+ },
+ {
+ "match": "(--)(\\\\'|[^'])*(?='|$)",
+ "name": "comment.line.double-dash.sql",
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.comment.sql"
+ }
+ }
+ },
+ {
+ "match": "\\\\[\\\\'`\"]",
+ "name": "constant.character.escape.php"
+ },
+ {
+ "match": "`(?=((\\\\`)|[^`'])*('|$))",
+ "name": "string.quoted.other.backtick.unclosed.sql"
+ },
+ {
+ "match": "\"(?=((\\\\\")|[^\"'])*('|$))",
+ "name": "string.quoted.double.unclosed.sql"
+ },
+ {
+ "include": "source.sql"
+ }
+ ]
+ },
+ "string-backtick": {
+ "begin": "`",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.php"
+ }
+ },
+ "end": "`",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.php"
+ }
+ },
+ "name": "string.interpolated.php",
+ "patterns": [
+ {
+ "match": "\\\\`",
+ "name": "constant.character.escape.php"
+ },
+ {
+ "include": "#interpolation"
+ }
+ ]
+ },
+ "string-double-quoted": {
+ "begin": "\"",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.php"
+ }
+ },
+ "end": "\"",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.php"
+ }
+ },
+ "name": "string.quoted.double.php",
+ "patterns": [
+ {
+ "include": "#interpolation_double_quoted"
+ }
+ ]
+ },
+ "string-single-quoted": {
+ "begin": "'",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.php"
+ }
+ },
+ "end": "'",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.php"
+ }
+ },
+ "name": "string.quoted.single.php",
+ "patterns": [
+ {
+ "match": "\\\\[\\\\']",
+ "name": "constant.character.escape.php"
+ }
+ ]
+ },
+ "strings": {
+ "patterns": [
+ {
+ "include": "#regex-double-quoted"
+ },
+ {
+ "include": "#sql-string-double-quoted"
+ },
+ {
+ "include": "#string-double-quoted"
+ },
+ {
+ "include": "#regex-single-quoted"
+ },
+ {
+ "include": "#sql-string-single-quoted"
+ },
+ {
+ "include": "#string-single-quoted"
+ }
+ ]
+ },
+ "support": {
+ "patterns": [
+ {
+ "match":
+ "(?xi)\n\\b\napc_(\n store|sma_info|compile_file|clear_cache|cas|cache_info|inc|dec|define_constants|delete(_file)?|\n exists|fetch|load_constants|add|bin_(dump|load)(file)?\n)\\b",
+ "name": "support.function.apc.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n shuffle|sizeof|sort|next|nat(case)?sort|count|compact|current|in_array|usort|uksort|uasort|\n pos|prev|end|each|extract|ksort|key(_exists)?|krsort|list|asort|arsort|rsort|reset|range|\n array(_(shift|sum|splice|search|slice|chunk|change_key_case|count_values|column|combine|\n (diff|intersect)(_(u)?(key|assoc))?|u(diff|intersect)(_(u)?assoc)?|unshift|unique|\n pop|push|pad|product|values|keys|key_exists|filter|fill(_keys)?|flip|walk(_recursive)?|\n reduce|replace(_recursive)?|reverse|rand|multisort|merge(_recursive)?|map)?)\n)\\b",
+ "name": "support.function.array.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n show_source|sys_getloadavg|sleep|highlight_(file|string)|constant|connection_(aborted|status)|\n time_(nanosleep|sleep_until)|ignore_user_abort|die|define(d)?|usleep|uniqid|unpack|__halt_compiler|\n php_(check_syntax|strip_whitespace)|pack|eval|exit|get_browser\n)\\b",
+ "name": "support.function.basic_functions.php"
+ },
+ {
+ "match": "(?i)\\bbc(scale|sub|sqrt|comp|div|pow(mod)?|add|mod|mul)\\b",
+ "name": "support.function.bcmath.php"
+ },
+ {
+ "match": "(?i)\\bblenc_encrypt\\b",
+ "name": "support.function.blenc.php"
+ },
+ {
+ "match":
+ "(?i)\\bbz(compress|close|open|decompress|errstr|errno|error|flush|write|read)\\b",
+ "name": "support.function.bz2.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n (French|Gregorian|Jewish|Julian)ToJD|cal_(to_jd|info|days_in_month|from_jd)|unixtojd|\n jdto(unix|jewish)|easter_(date|days)|JD(MonthName|To(Gregorian|Julian|French)|DayOfWeek)\n)\\b",
+ "name": "support.function.calendar.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n class_alias|all_user_method(_array)?|is_(a|subclass_of)|__autoload|(class|interface|method|property|trait)_exists|\n get_(class(_(vars|methods))?|(called|parent)_class|object_vars|declared_(classes|interfaces|traits))\n)\\b",
+ "name": "support.function.classobj.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n com_(create_guid|print_typeinfo|event_sink|load_typelib|get_active_object|message_pump)|\n variant_(sub|set(_type)?|not|neg|cast|cat|cmp|int|idiv|imp|or|div|date_(from|to)_timestamp|\n pow|eqv|fix|and|add|abs|round|get_type|xor|mod|mul)\n)\\b",
+ "name": "support.function.com.php"
+ },
+ {
+ "begin": "(?i)\\b(isset|unset|eval|empty|list)\\b",
+ "name": "support.function.construct.php"
+ },
+ {
+ "match": "(?i)\\b(print|echo)\\b",
+ "name": "support.function.construct.output.php"
+ },
+ {
+ "match":
+ "(?i)\\bctype_(space|cntrl|digit|upper|punct|print|lower|alnum|alpha|graph|xdigit)\\b",
+ "name": "support.function.ctype.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\ncurl_(\n share_(close|init|setopt)|strerror|setopt(_array)?|copy_handle|close|init|unescape|pause|escape|\n errno|error|exec|version|file_create|reset|getinfo|\n multi_(strerror|setopt|select|close|init|info_read|(add|remove)_handle|getcontent|exec)\n)\\b",
+ "name": "support.function.curl.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n strtotime|str[fp]time|checkdate|time|timezone_name_(from_abbr|get)|idate|\n timezone_((location|offset|transitions|version)_get|(abbreviations|identifiers)_list|open)|\n date(_(sun(rise|set)|sun_info|sub|create(_(immutable_)?from_format)?|timestamp_(get|set)|timezone_(get|set)|time_set|\n isodate_set|interval_(create_from_date_string|format)|offset_get|diff|default_timezone_(get|set)|date_set|\n parse(_from_format)?|format|add|get_last_errors|modify))?|\n localtime|get(date|timeofday)|gm(strftime|date|mktime)|microtime|mktime\n)\\b",
+ "name": "support.function.datetime.php"
+ },
+ {
+ "match":
+ "(?i)\\bdba_(sync|handlers|nextkey|close|insert|optimize|open|delete|popen|exists|key_split|firstkey|fetch|list|replace)\\b",
+ "name": "support.function.dba.php"
+ },
+ {
+ "match":
+ "(?i)\\bdbx_(sort|connect|compare|close|escape_string|error|query|fetch_row)\\b",
+ "name": "support.function.dbx.php"
+ },
+ {
+ "match":
+ "(?i)\\b(scandir|chdir|chroot|closedir|opendir|dir|rewinddir|readdir|getcwd)\\b",
+ "name": "support.function.dir.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\neio_(\n sync(fs)?|sync_file_range|symlink|stat(vfs)?|sendfile|set_min_parallel|set_max_(idle|poll_(reqs|time)|parallel)|\n seek|n(threads|op|pending|reqs|ready)|chown|chmod|custom|close|cancel|truncate|init|open|dup2|unlink|utime|poll|\n event_loop|f(sync|stat(vfs)?|chown|chmod|truncate|datasync|utime|allocate)|write|lstat|link|rename|realpath|\n read(ahead|dir|link)?|rmdir|get_(event_stream|last_error)|grp(_(add|cancel|limit))?|mknod|mkdir|busy\n)\\b",
+ "name": "support.function.eio.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\nenchant_(\n dict_(store_replacement|suggest|check|is_in_session|describe|quick_check|add_to_(personal|session)|get_error)|\n broker_(set_ordering|init|dict_exists|describe|free(_dict)?|list_dicts|request_(pwl_)?dict|get_error)\n)\\b",
+ "name": "support.function.enchant.php"
+ },
+ {
+ "match": "(?i)\\bsplit(i)?|sql_regcase|ereg(i)?(_replace)?\\b",
+ "name": "support.function.ereg.php"
+ },
+ {
+ "match":
+ "(?i)\\b((restore|set)_(error_handler|exception_handler)|trigger_error|debug_(print_)?backtrace|user_error|error_(log|reporting|get_last))\\b",
+ "name": "support.function.errorfunc.php"
+ },
+ {
+ "match":
+ "(?i)\\bshell_exec|system|passthru|proc_(nice|close|terminate|open|get_status)|escapeshell(arg|cmd)|exec\\b",
+ "name": "support.function.exec.php"
+ },
+ {
+ "match":
+ "(?i)\\b(exif_(thumbnail|tagname|imagetype|read_data)|read_exif_data)\\b",
+ "name": "support.function.exif.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\nfann_(\n (duplicate|length|merge|shuffle|subset)_train_data|scale_(train(_data)?|(input|output)(_train_data)?)|\n set_(scaling_params|sarprop_(step_error_(shift|threshold_factor)|temperature|weight_decay_shift)|\n cascade_(num_candidate_groups|candidate_(change_fraction|limit|stagnation_epochs)|\n output_(change_fraction|stagnation_epochs)|weight_multiplier|activation_(functions|steepnesses)|\n (max|min)_(cand|out)_epochs)|\n callback|training_algorithm|train_(error|stop)_function|(input|output)_scaling_params|error_log|\n quickprop_(decay|mu)|weight(_array)?|learning_(momentum|rate)|bit_fail_limit|\n activation_(function|steepness)(_(hidden|layer|output))?|\n rprop_((decrease|increase)_factor|delta_(max|min|zero)))|\n save(_train)?|num_(input|output)_train_data|copy|clear_scaling_params|cascadetrain_on_(file|data)|\n create_((sparse|shortcut|standard)(_array)?|train(_from_callback)?|from_file)|\n test(_data)?|train(_(on_(file|data)|epoch))?|init_weights|descale_(input|output|train)|destroy(_train)?|\n print_error|run|reset_(MSE|err(no|str))|read_train_from_file|randomize_weights|\n get_(sarprop_(step_error_(shift|threshold_factor)|temperature|weight_decay_shift)|num_(input|output|layers)|\n network_type|MSE|connection_(array|rate)|bias_array|bit_fail(_limit)?|\n cascade_(num_(candidates|candidate_groups)|(candidate|output)_(change_fraction|limit|stagnation_epochs)|\n weight_multiplier|activation_(functions|steepnesses)(_count)?|(max|min)_(cand|out)_epochs)|\n total_(connections|neurons)|training_algorithm|train_(error|stop)_function|err(no|str)|\n quickprop_(decay|mu)|learning_(momentum|rate)|layer_array|activation_(function|steepness)|\n rprop_((decrease|increase)_factor|delta_(max|min|zero)))\n)\\b",
+ "name": "support.function.fann.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n symlink|stat|set_file_buffer|chown|chgrp|chmod|copy|clearstatcache|touch|tempnam|tmpfile|\n is_(dir|(uploaded_)?file|executable|link|readable|writ(e)?able)|disk_(free|total)_space|diskfreespace|\n dirname|delete|unlink|umask|pclose|popen|pathinfo|parse_ini_(file|string)|fscanf|fstat|fseek|fnmatch|\n fclose|ftell|ftruncate|file(size|[acm]time|type|inode|owner|perms|group)?|file_(exists|(get|put)_contents)|\n f(open|puts|putcsv|passthru|eof|flush|write|lock|read|gets(s)?|getc(sv)?)|lstat|lchown|lchgrp|link(info)?|\n rename|rewind|read(file|link)|realpath(_cache_(get|size))?|rmdir|glob|move_uploaded_file|mkdir|basename\n)\\b",
+ "name": "support.function.file.php"
+ },
+ {
+ "match":
+ "(?i)\\b(finfo_(set_flags|close|open|file|buffer)|mime_content_type)\\b",
+ "name": "support.function.fileinfo.php"
+ },
+ {
+ "match": "(?i)\\bfilter_(has_var|input(_array)?|id|var(_array)?|list)\\b",
+ "name": "support.function.filter.php"
+ },
+ {
+ "match": "(?i)\\bfastcgi_finish_request\\b",
+ "name": "support.function.fpm.php"
+ },
+ {
+ "match":
+ "(?i)\\b(call_user_(func|method)(_array)?|create_function|unregister_tick_function|forward_static_call(_array)?|function_exists|func_(num_args|get_arg(s)?)|register_(shutdown|tick)_function|get_defined_functions)\\b",
+ "name": "support.function.funchand.php"
+ },
+ {
+ "match":
+ "(?i)\\b((n)?gettext|textdomain|d((n)?gettext|c(n)?gettext)|bind(textdomain|_textdomain_codeset))\\b",
+ "name": "support.function.gettext.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\ngmp_(\n scan[01]|strval|sign|sub|setbit|sqrt(rem)?|hamdist|neg|nextprime|com|clrbit|cmp|testbit|\n intval|init|invert|import|or|div(exact)?|div_(q|qr|r)|jacobi|popcount|pow(m)?|perfect_square|\n prob_prime|export|fact|legendre|and|add|abs|root(rem)?|random(_(bits|range))?|gcd(ext)?|xor|mod|mul\n)\\b",
+ "name": "support.function.gmp.php"
+ },
+ {
+ "match":
+ "(?i)\\bhash(_(hmac(_file)?|copy|init|update(_(file|stream))?|pbkdf2|equals|file|final|algos))?\\b",
+ "name": "support.function.hash.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n http_(support|send_(status|stream|content_(disposition|type)|data|file|last_modified)|head|\n negotiate_(charset|content_type|language)|chunked_decode|cache_(etag|last_modified)|throttle|\n inflate|deflate|date|post_(data|fields)|put_(data|file|stream)|persistent_handles_(count|clean|ident)|\n parse_(cookie|headers|message|params)|redirect|request(_(method_(exists|name|(un)?register)|body_encode))?|\n get(_request_(headers|body(_stream)?))?|match_(etag|modified|request_header)|build_(cookie|str|url))|\n ob_(etag|deflate|inflate)handler\n)\\b",
+ "name": "support.function.http.php"
+ },
+ {
+ "match":
+ "(?i)\\b(iconv(_(str(pos|len|rpos)|substr|(get|set)_encoding|mime_(decode(_headers)?|encode)))?|ob_iconv_handler)\\b",
+ "name": "support.function.iconv.php"
+ },
+ {
+ "match":
+ "(?i)\\biis_((start|stop)_(service|server)|set_(script_map|server_rights|dir_security|app_settings)|(add|remove)_server|get_(script_map|service_state|server_(rights|by_(comment|path))|dir_security))\\b",
+ "name": "support.function.iisfunc.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n iptc(embed|parse)|(jpeg|png)2wbmp|gd_info|getimagesize(fromstring)?|\n image(s[xy]|scale|(char|string)(up)?|set(style|thickness|tile|interpolation|pixel|brush)|savealpha|\n convolution|copy(resampled|resized|merge(gray)?)?|colors(forindex|total)|\n color(set|closest(alpha|hwb)?|transparent|deallocate|(allocate|exact|resolve)(alpha)?|at|match)|\n crop(auto)?|create(truecolor|from(string|jpeg|png|wbmp|webp|gif|gd(2(part)?)?|xpm|xbm))?|\n types|ttf(bbox|text)|truecolortopalette|istruecolor|interlace|2wbmp|destroy|dashedline|jpeg|\n _type_to_(extension|mime_type)|ps(slantfont|text|(encode|extend|free|load)font|bbox)|png|polygon|\n palette(copy|totruecolor)|ellipse|ft(text|bbox)|filter|fill|filltoborder|\n filled(arc|ellipse|polygon|rectangle)|font(height|width)|flip|webp|wbmp|line|loadfont|layereffect|\n antialias|affine(matrix(concat|get))?|alphablending|arc|rotate|rectangle|gif|gd(2)?|gammacorrect|\n grab(screen|window)|xbm)\n)\\b",
+ "name": "support.function.image.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n sys_get_temp_dir|set_(time_limit|include_path|magic_quotes_runtime)|cli_(get|set)_process_title|\n ini_(alter|get(_all)?|restore|set)|zend_(thread_id|version|logo_guid)|dl|php(credits|info|version)|\n php_(sapi_name|ini_(scanned_files|loaded_file)|uname|logo_guid)|putenv|extension_loaded|version_compare|\n assert(_options)?|restore_include_path|gc_(collect_cycles|disable|enable(d)?)|getopt|\n get_(cfg_var|current_user|defined_constants|extension_funcs|include_path|included_files|loaded_extensions|\n magic_quotes_(gpc|runtime)|required_files|resources)|\n get(env|lastmod|rusage|my(inode|[gup]id))|\n memory_get_(peak_)?usage|main|magic_quotes_runtime\n)\\b",
+ "name": "support.function.info.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\nibase_(\n set_event_handler|service_(attach|detach)|server_info|num_(fields|params)|name_result|connect|\n commit(_ret)?|close|trans|delete_user|drop_db|db_info|pconnect|param_info|prepare|err(code|msg)|\n execute|query|field_info|fetch_(assoc|object|row)|free_(event_handler|query|result)|wait_event|\n add_user|affected_rows|rollback(_ret)?|restore|gen_id|modify_user|maintain_db|backup|\n blob_(cancel|close|create|import|info|open|echo|add|get)\n)\\b",
+ "name": "support.function.interbase.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n normalizer_(normalize|is_normalized)|idn_to_(unicode|utf8|ascii)|\n numfmt_(set_(symbol|(text_)?attribute|pattern)|create|(parse|format)(_currency)?|\n get_(symbol|(text_)?attribute|pattern|error_(code|message)|locale))|\n collator_(sort(_with_sort_keys)?|set_(attribute|strength)|compare|create|asort|\n get_(strength|sort_key|error_(code|message)|locale|attribute))|\n transliterator_(create(_(inverse|from_rules))?|transliterate|list_ids|get_error_(code|message))|\n intl(cal|tz)_get_error_(code|message)|intl_(is_failure|error_name|get_error_(code|message))|\n datefmt_(set_(calendar|lenient|pattern|timezone(_id)?)|create|is_lenient|parse|format(_object)?|localtime|\n get_(calendar(_object)?|time(type|zone(_id)?)|datetype|pattern|error_(code|message)|locale))|\n locale_(set_default|compose|canonicalize|parse|filter_matches|lookup|accept_from_http|\n get_(script|display_(script|name|variant|language|region)|default|primary_language|keywords|all_variants|region))|\n resourcebundle_(create|count|locales|get(_(error_(code|message)))?)|\n grapheme_(str(i?str|r?i?pos|len)|substr|extract)|\n msgfmt_(set_pattern|create|(format|parse)(_message)?|get_(pattern|error_(code|message)|locale))\n)\\b",
+ "name": "support.function.intl.php"
+ },
+ {
+ "match": "(?i)\\bjson_(decode|encode|last_error(_msg)?)\\b",
+ "name": "support.function.json.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\nldap_(\n start|tls|sort|search|sasl_bind|set_(option|rebind_proc)|(first|next)_(attribute|entry|reference)|\n connect|control_paged_result(_response)?|count_entries|compare|close|t61_to_8859|8859_to_t61|\n dn2ufn|delete|unbind|parse_(reference|result)|escape|errno|err2str|error|explode_dn|bind|\n free_result|list|add|rename|read|get_(option|dn|entries|values(_len)?|attributes)|modify(_batch)?|\n mod_(add|del|replace)\n)\\b",
+ "name": "support.function.ldap.php"
+ },
+ {
+ "match":
+ "(?i)\\blibxml_(set_(streams_context|external_entity_loader)|clear_errors|disable_entity_loader|use_internal_errors|get_(errors|last_error))\\b",
+ "name": "support.function.libxml.php"
+ },
+ {
+ "match": "(?i)\\b(ezmlm_hash|mail)\\b",
+ "name": "support.function.mail.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n (a)?(cos|sin|tan)(h)?|sqrt|srand|hypot|hexdec|ceil|is_(nan|(in)?finite)|octdec|dec(hex|oct|bin)|deg2rad|\n pi|pow|exp(m1)?|floor|fmod|lcg_value|log(1(p|0))?|atan2|abs|round|rand|rad2deg|getrandmax|\n mt_(srand|rand|getrandmax)|max|min|bindec|base_convert\n)\\b",
+ "name": "support.function.math.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\nmb_(\n str(cut|str|to(lower|upper)|istr|ipos|imwidth|pos|width|len|rchr|richr|ripos|rpos)|\n substitute_character|substr(_count)?|split|send_mail|http_(input|output)|check_encoding|\n convert_(case|encoding|kana|variables)|internal_encoding|output_handler|decode_(numericentity|mimeheader)|\n detect_(encoding|order)|parse_str|preferred_mime_name|encoding_aliases|encode_(numericentity|mimeheader)|\n ereg(i(_replace)?)?|ereg_(search(_(get(pos|regs)|init|regs|(set)?pos))?|replace(_callback)?|match)|\n list_encodings|language|regex_(set_options|encoding)|get_info\n)\\b",
+ "name": "support.function.mbstring.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n mcrypt_(\n cfb|create_iv|cbc|ofb|decrypt|encrypt|ecb|list_(algorithms|modes)|generic(_((de)?init|end))?|\n enc_(self_test|is_block_(algorithm|algorithm_mode|mode)|\n get_(supported_key_sizes|(block|iv|key)_size|(algorithms|modes)_name))|\n get_(cipher_name|(block|iv|key)_size)|\n module_(close|self_test|is_block_(algorithm|algorithm_mode|mode)|open|\n get_(supported_key_sizes|algo_(block|key)_size)))|\n mdecrypt_generic\n)\\b",
+ "name": "support.function.mcrypt.php"
+ },
+ {
+ "match": "(?i)\\bmemcache_debug\\b",
+ "name": "support.function.memcache.php"
+ },
+ {
+ "match": "(?i)\\bmhash(_(count|keygen_s2k|get_(hash_name|block_size)))?\\b",
+ "name": "support.function.mhash.php"
+ },
+ {
+ "match":
+ "(?i)\\b(log_(cmd_(insert|delete|update)|killcursor|write_batch|reply|getmore)|bson_(decode|encode))\\b",
+ "name": "support.function.mongo.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\nmysql_(\n stat|set_charset|select_db|num_(fields|rows)|connect|client_encoding|close|create_db|escape_string|\n thread_id|tablename|insert_id|info|data_seek|drop_db|db_(name|query)|unbuffered_query|pconnect|ping|\n errno|error|query|field_(seek|name|type|table|flags|len)|fetch_(object|field|lengths|assoc|array|row)|\n free_result|list_(tables|dbs|processes|fields)|affected_rows|result|real_escape_string|\n get_(client|host|proto|server)_info\n)\\b",
+ "name": "support.function.mysql.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\nmysqli_(\n ssl_set|store_result|stat|send_(query|long_data)|set_(charset|opt|local_infile_(default|handler))|\n stmt_(store_result|send_long_data|next_result|close|init|data_seek|prepare|execute|fetch|free_result|\n attr_(get|set)|result_metadata|reset|get_(result|warnings)|more_results|bind_(param|result))|\n select_db|slave_query|savepoint|next_result|change_user|character_set_name|connect|commit|\n client_encoding|close|thread_safe|init|options|(enable|disable)_(reads_from_master|rpl_parse)|\n dump_debug_info|debug|data_seek|use_result|ping|poll|param_count|prepare|escape_string|execute|\n embedded_server_(start|end)|kill|query|field_seek|free_result|autocommit|rollback|report|refresh|\n fetch(_(object|fields|field(_direct)?|assoc|all|array|row))?|rpl_(parse_enabled|probe|query_type)|\n release_savepoint|reap_async_query|real_(connect|escape_string|query)|more_results|multi_query|\n get_(charset|connection_stats|client_(stats|info|version)|cache_stats|warnings|links_stats|metadata)|\n master_query|bind_(param|result)|begin_transaction\n)\\b",
+ "name": "support.function.mysqli.php"
+ },
+ {
+ "match": "(?i)\\bmysqlnd_memcache_(set|get_config)\\b",
+ "name": "support.function.mysqlnd-memcache.php"
+ },
+ {
+ "match":
+ "(?i)\\bmysqlnd_ms_(set_(user_pick_server|qos)|dump_servers|query_is_select|fabric_select_(shard|global)|get_(stats|last_(used_connection|gtid))|xa_(commit|rollback|gc|begin)|match_wild)\\b",
+ "name": "support.function.mysqlnd-ms.php"
+ },
+ {
+ "match":
+ "(?i)\\bmysqlnd_qc_(set_(storage_handler|cache_condition|is_select|user_handlers)|clear_cache|get_(normalized_query_trace_log|core_stats|cache_info|query_trace_log|available_handlers))\\b",
+ "name": "support.function.mysqlnd-qc.php"
+ },
+ {
+ "match":
+ "(?i)\\bmysqlnd_uh_(set_(statement|connection)_proxy|convert_to_mysqlnd)\\b",
+ "name": "support.function.mysqlnd-uh.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n syslog|socket_(set_(blocking|timeout)|get_status)|set(raw)?cookie|http_response_code|openlog|\n headers_(list|sent)|header(_(register_callback|remove))?|checkdnsrr|closelog|inet_(ntop|pton)|ip2long|\n openlog|dns_(check_record|get_(record|mx))|define_syslog_variables|(p)?fsockopen|long2ip|\n get(servby(name|port)|host(name|by(name(l)?|addr))|protoby(name|number)|mxrr)\n)\\b",
+ "name": "support.function.network.php"
+ },
+ {
+ "match": "(?i)\\bnsapi_(virtual|response_headers|request_headers)\\b",
+ "name": "support.function.nsapi.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n oci(statementtype|setprefetch|serverversion|savelob(file)?|numcols|new(collection|cursor|descriptor)|nlogon|\n column(scale|size|name|type(raw)?|isnull|precision)|coll(size|trim|assign(elem)?|append|getelem|max)|commit|\n closelob|cancel|internaldebug|definebyname|plogon|parse|error|execute|fetch(statement|into)?|\n free(statement|collection|cursor|desc)|write(temporarylob|lobtofile)|loadlob|log(on|off)|rowcount|rollback|\n result|bindbyname)|\n oci_(statement_type|set_(client_(info|identifier)|prefetch|edition|action|module_name)|server_version|\n num_(fields|rows)|new_(connect|collection|cursor|descriptor)|connect|commit|client_version|close|cancel|\n internal_debug|define_by_name|pconnect|password_change|parse|error|execute|bind_(array_)?by_name|\n field_(scale|size|name|type(_raw)?|is_null|precision)|fetch(_(object|assoc|all|array|row))?|\n free_(statement|descriptor)|lob_(copy|is_equal)|rollback|result|get_implicit_resultset)\n)\\b",
+ "name": "support.function.oci8.php"
+ },
+ {
+ "match":
+ "(?i)\\bopcache_(compile_file|invalidate|reset|get_(status|configuration))\\b",
+ "name": "support.function.opcache.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\nopenssl_(\n sign|spki_(new|export(_challenge)?|verify)|seal|csr_(sign|new|export(_to_file)?|get_(subject|public_key))|\n cipher_iv_length|open|dh_compute_key|digest|decrypt|public_(decrypt|encrypt)|encrypt|error_string|\n pkcs12_(export(_to_file)?|read)|pkcs7_(sign|decrypt|encrypt|verify)|verify|free_key|random_pseudo_bytes|\n pkey_(new|export(_to_file)?|free|get_(details|public|private))|private_(decrypt|encrypt)|pbkdf2|\n get_((cipher|md)_methods|cert_locations|(public|private)key)|\n x509_(check_private_key|checkpurpose|parse|export(_to_file)?|fingerprint|free|read)\n)\\b",
+ "name": "support.function.openssl.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n output_(add_rewrite_var|reset_rewrite_vars)|flush|\n ob_(start|clean|implicit_flush|end_(clean|flush)|flush|list_handlers|gzhandler|\n get_(status|contents|clean|flush|length|level))\n)\\b",
+ "name": "support.function.output.php"
+ },
+ {
+ "match": "(?i)\\bpassword_(hash|needs_rehash|verify|get_info)\\b",
+ "name": "support.function.password.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\npcntl_(\n strerror|signal(_dispatch)?|sig(timedwait|procmask|waitinfo)|setpriority|errno|exec|fork|\n w(stopsig|termsig|if(stopped|signaled|exited))|wait(pid)?|alarm|getpriority|get_last_error\n)\\b",
+ "name": "support.function.pcntl.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\npg_(\n socket|send_(prepare|execute|query(_params)?)|set_(client_encoding|error_verbosity)|select|host|\n num_(fields|rows)|consume_input|connection_(status|reset|busy)|connect(_poll)?|convert|copy_(from|to)|\n client_encoding|close|cancel_query|tty|transaction_status|trace|insert|options|delete|dbname|untrace|\n unescape_bytea|update|pconnect|ping|port|put_line|parameter_status|prepare|version|query(_params)?|\n escape_(string|identifier|literal|bytea)|end_copy|execute|flush|free_result|last_(notice|error|oid)|\n field_(size|num|name|type(_oid)?|table|is_null|prtlen)|affected_rows|result_(status|seek|error(_field)?)|\n fetch_(object|assoc|all(_columns)?|array|row|result)|get_(notify|pid|result)|meta_data|\n lo_(seek|close|create|tell|truncate|import|open|unlink|export|write|read(_all)?)|\n)\\b",
+ "name": "support.function.pgsql.php"
+ },
+ {
+ "match":
+ "(?i)\\b(virtual|getallheaders|apache_((get|set)env|note|child_terminate|lookup_uri|response_headers|reset_timeout|request_headers|get_(version|modules)))\\b",
+ "name": "support.function.php_apache.php"
+ },
+ {
+ "match": "(?i)\\bdom_import_simplexml\\b",
+ "name": "support.function.php_dom.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\nftp_(\n ssl_connect|systype|site|size|set_option|nlist|nb_(continue|f?(put|get))|ch(dir|mod)|connect|cdup|close|\n delete|put|pwd|pasv|exec|quit|f(put|get)|login|alloc|rename|raw(list)?|rmdir|get(_option)?|mdtm|mkdir\n)\\b",
+ "name": "support.function.php_ftp.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\nimap_(\n (create|delete|list|rename|scan)(mailbox)?|status|sort|subscribe|set_quota|set(flag_full|acl)|search|savebody|\n num_(recent|msg)|check|close|clearflag_full|thread|timeout|open|header(info)?|headers|append|alerts|reopen|\n 8bit|unsubscribe|undelete|utf7_(decode|encode)|utf8|uid|ping|errors|expunge|qprint|gc|\n fetch(structure|header|text|mime|body)|fetch_overview|lsub|list(scan|subscribed)|last_error|\n rfc822_(parse_(headers|adrlist)|write_address)|get(subscribed|acl|mailboxes)|get_quota(root)?|\n msgno|mime_header_decode|mail_(copy|compose|move)|mail|mailboxmsginfo|binary|body(struct)?|base64\n)\\b",
+ "name": "support.function.php_imap.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\nmssql_(\n select_db|num_(fields|rows)|next_result|connect|close|init|data_seek|pconnect|execute|query|\n field_(seek|name|type|length)|fetch_(object|field|assoc|array|row|batch)|free_(statement|result)|\n rows_affected|result|guid_string|get_last_message|min_(error|message)_severity|bind\n)\\b",
+ "name": "support.function.php_mssql.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\nodbc_(\n statistics|specialcolumns|setoption|num_(fields|rows)|next_result|connect|columns|columnprivileges|commit|\n cursor|close(_all)?|tables|tableprivileges|do|data_source|pconnect|primarykeys|procedures|procedurecolumns|\n prepare|error(msg)?|exec(ute)?|field_(scale|num|name|type|precision|len)|foreignkeys|free_result|\n fetch_(into|object|array|row)|longreadlen|autocommit|rollback|result(_all)?|gettypeinfo|binmode\n)\\b",
+ "name": "support.function.php_odbc.php"
+ },
+ {
+ "match":
+ "(?i)\\bpreg_(split|quote|filter|last_error|replace(_callback)?|grep|match(_all)?)\\b",
+ "name": "support.function.php_pcre.php"
+ },
+ {
+ "match":
+ "(?i)\\b(spl_(classes|object_hash|autoload(_(call|unregister|extensions|functions|register))?)|class_(implements|uses|parents)|iterator_(count|to_array|apply))\\b",
+ "name": "support.function.php_spl.php"
+ },
+ {
+ "match":
+ "(?i)\\bzip_(close|open|entry_(name|compressionmethod|compressedsize|close|open|filesize|read)|read)\\b",
+ "name": "support.function.php_zip.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\nposix_(\n strerror|set(s|e?u|[ep]?g)id|ctermid|ttyname|times|isatty|initgroups|uname|errno|kill|access|\n get(sid|cwd|uid|pid|ppid|pwnam|pwuid|pgid|pgrp|euid|egid|login|rlimit|gid|grnam|groups|grgid)|\n get_last_error|mknod|mkfifo\n)\\b",
+ "name": "support.function.posix.php"
+ },
+ {
+ "match": "(?i)\\bset(thread|proc)title\\b",
+ "name": "support.function.proctitle.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\npspell_(\n store_replacement|suggest|save_wordlist|new(_(config|personal))?|check|clear_session|\n config_(save_repl|create|ignore|(data|dict)_dir|personal|runtogether|repl|mode)|add_to_(session|personal)\n)\\b",
+ "name": "support.function.pspell.php"
+ },
+ {
+ "match":
+ "(?i)\\breadline(_(completion_function|clear_history|callback_(handler_(install|remove)|read_char)|info|on_new_line|write_history|list_history|add_history|redisplay|read_history))?\\b",
+ "name": "support.function.readline.php"
+ },
+ {
+ "match": "(?i)\\brecode(_(string|file))?\\b",
+ "name": "support.function.recode.php"
+ },
+ {
+ "match":
+ "(?i)\\brrd(c_disconnect|_(create|tune|info|update|error|version|first|fetch|last(update)?|restore|graph|xport))\\b",
+ "name": "support.function.rrd.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n shm_((get|has|remove|put)_var|detach|attach|remove)|sem_(acquire|release|remove|get)|ftok|\n msg_((get|remove|set|stat)_queue|send|queue_exists|receive)\n)\\b",
+ "name": "support.function.sem.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\nsession_(\n status|start|set_(save_handler|cookie_params)|save_path|name|commit|cache_(expire|limiter)|\n is_registered|id|destroy|decode|unset|unregister|encode|write_close|abort|reset|register(_shutdown)?|\n regenerate_id|get_cookie_params|module_name\n)\\b",
+ "name": "support.function.session.php"
+ },
+ {
+ "match": "(?i)\\bshmop_(size|close|open|delete|write|read)\\b",
+ "name": "support.function.shmop.php"
+ },
+ {
+ "match": "(?i)\\bsimplexml_(import_dom|load_(string|file))\\b",
+ "name": "support.function.simplexml.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n snmp(walk(oid)?|realwalk|get(next)?|set)|\n snmp_(set_(valueretrieval|quick_print|enum_print|oid_(numeric_print|output_format))|read_mib|\n get_(valueretrieval|quick_print))|\n snmp[23]_(set|walk|real_walk|get(next)?)\n)\\b",
+ "name": "support.function.snmp.php"
+ },
+ {
+ "match": "(?i)\\b(is_soap_fault|use_soap_error_handler)\\b",
+ "name": "support.function.soap.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\nsocket_(\n shutdown|strerror|send(to|msg)?|set_((non)?block|option)|select|connect|close|clear_error|bind|\n create(_(pair|listen))?|cmsg_space|import_stream|write|listen|last_error|accept|recv(from|msg)?|\n read|get(peer|sock)name|get_option\n)\\b",
+ "name": "support.function.sockets.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\nsqlite_(\n single_query|seek|has_(more|prev)|num_(fields|rows)|next|changes|column|current|close|\n create_(aggregate|function)|open|unbuffered_query|udf_(decode|encode)_binary|popen|prev|\n escape_string|error_string|exec|valid|key|query|field_name|factory|\n fetch_(string|single|column_types|object|all|array)|lib(encoding|version)|\n last_(insert_rowid|error)|array_query|rewind|busy_timeout\n)\\b",
+ "name": "support.function.sqlite.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\nsqlsrv_(\n send_stream_data|server_info|has_rows|num_(fields|rows)|next_result|connect|configure|commit|\n client_info|close|cancel|prepare|errors|execute|query|field_metadata|fetch(_(array|object))?|\n free_stmt|rows_affected|rollback|get_(config|field)|begin_transaction\n)\\b",
+ "name": "support.function.sqlsrv.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\nstats_(\n harmonic_mean|covariance|standard_deviation|skew|\n cdf_(noncentral_(chisquare|f)|negative_binomial|chisquare|cauchy|t|uniform|poisson|exponential|f|weibull|\n logistic|laplace|gamma|binomial|beta)|\n stat_(noncentral_t|correlation|innerproduct|independent_t|powersum|percentile|paired_t|gennch|binomial_coef)|\n dens_(normal|negative_binomial|chisquare|cauchy|t|pmf_(hypergeometric|poisson|binomial)|exponential|f|\n weibull|logistic|laplace|gamma|beta)|\n den_uniform|variance|kurtosis|absolute_deviation|\n rand_(setall|phrase_to_seeds|ranf|get_seeds|\n gen_(noncentral_[ft]|noncenral_chisquare|normal|chisquare|t|int|\n i(uniform|poisson|binomial(_negative)?)|exponential|f(uniform)?|gamma|beta))\n)\\b",
+ "name": "support.function.stats.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n set_socket_blocking|\n stream_(socket_(shutdown|sendto|server|client|pair|enable_crypto|accept|recvfrom|get_name)|\n set_(chunk_size|timeout|(read|write)_buffer|blocking)|select|notification_callback|supports_lock|\n context_(set_(option|default|params)|create|get_(options|default|params))|copy_to_stream|is_local|\n encoding|filter_(append|prepend|register|remove)|wrapper_((un)?register|restore)|\n resolve_include_path|register_wrapper|get_(contents|transports|filters|wrappers|line|meta_data)|\n bucket_(new|prepend|append|make_writeable)\n )\n)\\b",
+ "name": "support.function.streamsfuncs.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n money_format|md5(_file)?|metaphone|bin2hex|sscanf|sha1(_file)?|\n str(str|c?spn|n(at)?(case)?cmp|chr|coll|(case)?cmp|to(upper|lower)|tok|tr|istr|pos|pbrk|len|rchr|ri?pos|rev)|\n str_(getcsv|ireplace|pad|repeat|replace|rot13|shuffle|split|word_count)|\n strip(c?slashes|os)|strip_tags|similar_text|soundex|substr(_(count|compare|replace))?|setlocale|\n html(specialchars(_decode)?|entities)|html_entity_decode|hex2bin|hebrev(c)?|number_format|nl2br|nl_langinfo|\n chop|chunk_split|chr|convert_(cyr_string|uu(decode|encode))|count_chars|crypt|crc32|trim|implode|ord|\n uc(first|words)|join|parse_str|print(f)?|echo|explode|v?[fs]?printf|quoted_printable_(decode|encode)|\n quotemeta|wordwrap|lcfirst|[lr]trim|localeconv|levenshtein|addc?slashes|get_html_translation_table\n)\\b",
+ "name": "support.function.string.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\nsybase_(\n set_message_handler|select_db|num_(fields|rows)|connect|close|deadlock_retry_count|data_seek|\n unbuffered_query|pconnect|query|field_seek|fetch_(object|field|assoc|array|row)|free_result|\n affected_rows|result|get_last_message|min_(client|error|message|server)_severity\n)\\b",
+ "name": "support.function.sybase.php"
+ },
+ {
+ "match": "(?i)\\b(taint|is_tainted|untaint)\\b",
+ "name": "support.function.taint.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n tidy_((get|set)opt|set_encoding|save_config|config_count|clean_repair|is_(xhtml|xml)|diagnose|\n (access|error|warning)_count|load_config|reset_config|(parse|repair)_(string|file)|\n get_(status|html(_ver)?|head|config|output|opt_doc|root|release|body))|\n ob_tidyhandler\n)\\b",
+ "name": "support.function.tidy.php"
+ },
+ {
+ "match": "(?i)\\btoken_(name|get_all)\\b",
+ "name": "support.function.tokenizer.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\ntrader_(\n stoch(f|r|rsi)?|stddev|sin(h)?|sum|sub|set_(compat|unstable_period)|sqrt|sar(ext)?|sma|\n ht_(sine|trend(line|mode)|dc(period|phase)|phasor)|natr|cci|cos(h)?|correl|\n cdl(shootingstar|shortline|sticksandwich|stalledpattern|spinningtop|separatinglines|\n hikkake(mod)?|highwave|homingpigeon|hangingman|harami(cross)?|hammer|concealbabyswall|\n counterattack|closingmarubozu|thrusting|tasukigap|takuri|tristar|inneck|invertedhammer|\n identical3crows|2crows|onneck|doji(star)?|darkcloudcover|dragonflydoji|unique3river|\n upsidegap2crows|3(starsinsouth|inside|outside|whitesoldiers|linestrike|blackcrows)|\n piercing|engulfing|evening(doji)?star|kicking(bylength)?|longline|longleggeddoji|\n ladderbottom|advanceblock|abandonedbaby|risefall3methods|rickshawman|gapsidesidewhite|\n gravestonedoji|xsidegap3methods|morning(doji)?star|mathold|matchinglow|marubozu|\n belthold|breakaway)|\n ceil|cmo|tsf|typprice|t3|tema|tan(h)?|trix|trima|trange|obv|div|dema|dx|ultosc|ppo|\n plus_d[im]|errno|exp|ema|var|kama|floor|wclprice|willr|wma|ln|log10|bop|beta|bbands|\n linearreg(_(slope|intercept|angle))?|asin|acos|atan|atr|adosc|ad|add|adx(r)?|apo|avgprice|\n aroon(osc)?|rsi|roc|rocp|rocr(100)?|get_(compat|unstable_period)|min(index)?|minus_d[im]|\n minmax(index)?|mid(point|price)|mom|mult|medprice|mfi|macd(ext|fix)?|mavp|max(index)?|ma(ma)?\n)\\b",
+ "name": "support.function.trader.php"
+ },
+ {
+ "match":
+ "(?i)\\buopz_(copy|compose|implement|overload|delete|undefine|extend|function|flags|restore|rename|redefine|backup)\\b",
+ "name": "support.function.uopz.php"
+ },
+ {
+ "match":
+ "(?i)\\b(http_build_query|(raw)?url(decode|encode)|parse_url|get_(headers|meta_tags)|base64_(decode|encode))\\b",
+ "name": "support.function.url.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n strval|settype|serialize|(bool|double|float)val|debug_zval_dump|intval|import_request_variables|isset|\n is_(scalar|string|null|numeric|callable|int(eger)?|object|double|float|long|array|resource|real|bool)|\n unset|unserialize|print_r|empty|var_(dump|export)|gettype|get_(defined_vars|resource_type)\n)\\b",
+ "name": "support.function.var.php"
+ },
+ {
+ "match":
+ "(?i)\\bwddx_(serialize_(value|vars)|deserialize|packet_(start|end)|add_vars)\\b",
+ "name": "support.function.wddx.php"
+ },
+ {
+ "match": "(?i)\\bxhprof_(sample_)?(disable|enable)\\b",
+ "name": "support.function.xhprof.php"
+ },
+ {
+ "match":
+ "(?xi)\n\\b\n(\n utf8_(decode|encode)|\n xml_(set_((notation|(end|start)_namespace|unparsed_entity)_decl_handler|\n (character_data|default|element|external_entity_ref|processing_instruction)_handler|object)|\n parse(_into_struct)?|parser_((get|set)_option|create(_ns)?|free)|error_string|\n get_(current_((column|line)_number|byte_index)|error_code))\n)\\b",
+ "name": "support.function.xml.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\nxmlrpc_(\n server_(call_method|create|destroy|add_introspection_data|register_(introspection_callback|method))|\n is_fault|decode(_request)?|parse_method_descriptions|encode(_request)?|(get|set)_type\n)\\b",
+ "name": "support.function.xmlrpc.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\nxmlwriter_(\n (end|start|write)_(comment|cdata|dtd(_(attlist|entity|element))?|document|pi|attribute|element)|\n (start|write)_(attribute|element)_ns|write_raw|set_indent(_string)?|text|output_memory|open_(memory|uri)|\n full_end_element|flush|\n)\\b",
+ "name": "support.function.xmlwriter.php"
+ },
+ {
+ "match":
+ "(?xi)\\b\n(\n zlib_(decode|encode|get_coding_type)|readgzfile|\n gz(seek|compress|close|tell|inflate|open|decode|deflate|uncompress|puts|passthru|encode|eof|file|\n write|rewind|read|getc|getss?)\n)\\b",
+ "name": "support.function.zlib.php"
+ },
+ {
+ "match": "(?i)\\bis_int(eger)?\\b",
+ "name": "support.function.alias.php"
+ }
+ ]
+ },
+ "switch_statement": {
+ "patterns": [
+ {
+ "match": "\\s+(?=switch\\b)"
+ },
+ {
+ "begin": "\\bswitch\\b(?!\\s*\\(.*\\)\\s*:)",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.control.switch.php"
+ }
+ },
+ "end": "}|(?=\\?>)",
+ "endCaptures": {
+ "0": {
+ "name":
+ "punctuation.definition.section.switch-block.end.bracket.curly.php"
+ }
+ },
+ "name": "meta.switch-statement.php",
+ "patterns": [
+ {
+ "begin": "\\(",
+ "beginCaptures": {
+ "0": {
+ "name":
+ "punctuation.definition.switch-expression.begin.bracket.round.php"
+ }
+ },
+ "end": "\\)|(?=\\?>)",
+ "endCaptures": {
+ "0": {
+ "name":
+ "punctuation.definition.switch-expression.end.bracket.round.php"
+ }
+ },
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ {
+ "begin": "{",
+ "beginCaptures": {
+ "0": {
+ "name":
+ "punctuation.definition.section.switch-block.begin.bracket.curly.php"
+ }
+ },
+ "end": "(?=}|\\?>)",
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "use-inner": {
+ "patterns": [
+ {
+ "include": "#comments"
+ },
+ {
+ "begin": "(?i)\\b(as)\\s+",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.use-as.php"
+ }
+ },
+ "end": "(?i)[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*",
+ "endCaptures": {
+ "0": {
+ "name": "entity.other.alias.php"
+ }
+ }
+ },
+ {
+ "include": "#class-name"
+ },
+ {
+ "match": ",",
+ "name": "punctuation.separator.delimiter.php"
+ }
+ ]
+ },
+ "var_basic": {
+ "patterns": [
+ {
+ "match": "(?i)(\\$+)[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*",
+ "name": "variable.other.php",
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.variable.php"
+ }
+ }
+ }
+ ]
+ },
+ "var_global": {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.variable.php"
+ }
+ },
+ "match": "(\\$)((_(COOKIE|FILES|GET|POST|REQUEST))|arg(v|c))\\b",
+ "name": "variable.other.global.php"
+ },
+ "var_global_safer": {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.variable.php"
+ }
+ },
+ "match": "(\\$)((GLOBALS|_(ENV|SERVER|SESSION)))",
+ "name": "variable.other.global.safer.php"
+ },
+ "var_language": {
+ "match": "(\\$)this\\b",
+ "name": "variable.language.this.php",
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.variable.php"
+ }
+ }
+ },
+ "variable-name": {
+ "patterns": [
+ {
+ "include": "#var_global"
+ },
+ {
+ "include": "#var_global_safer"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "variable.other.php"
+ },
+ "2": {
+ "name": "punctuation.definition.variable.php"
+ },
+ "4": {
+ "name": "keyword.operator.class.php"
+ },
+ "5": {
+ "name": "variable.other.property.php"
+ },
+ "6": {
+ "name": "punctuation.section.array.begin.php"
+ },
+ "7": {
+ "name": "constant.numeric.index.php"
+ },
+ "8": {
+ "name": "variable.other.index.php"
+ },
+ "9": {
+ "name": "punctuation.definition.variable.php"
+ },
+ "10": {
+ "name": "string.unquoted.index.php"
+ },
+ "11": {
+ "name": "punctuation.section.array.end.php"
+ }
+ },
+ "match":
+ "(?xi)\n((\\$)(?[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*))\n(?:\n (->)(\\g)\n |\n (\\[)(?:(\\d+)|((\\$)\\g)|([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*))(\\])\n)?"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "variable.other.php"
+ },
+ "2": {
+ "name": "punctuation.definition.variable.php"
+ },
+ "4": {
+ "name": "punctuation.definition.variable.php"
+ }
+ },
+ "match":
+ "(?i)((\\${)(?[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)(}))"
+ }
+ ]
+ },
+ "variables": {
+ "patterns": [
+ {
+ "include": "#var_language"
+ },
+ {
+ "include": "#var_global"
+ },
+ {
+ "include": "#var_global_safer"
+ },
+ {
+ "include": "#var_basic"
+ },
+ {
+ "begin": "\\${(?=.*?})",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.variable.php"
+ }
+ },
+ "end": "}",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.variable.php"
+ }
+ },
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ }
+ ]
+ },
+ "ternary_shorthand": {
+ "match": "\\?:",
+ "name": "keyword.operator.ternary.php"
+ },
+ "ternary_expression": {
+ "begin": "\\?",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.ternary.php"
+ }
+ },
+ "end": ":",
+ "endCaptures": {
+ "0": {
+ "name": "keyword.operator.ternary.php"
+ }
+ },
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ "null_coalescing": {
+ "match": "\\?\\?",
+ "name": "keyword.operator.null-coalescing.php"
+ }
+ }
+}
diff --git a/extensions/python/syntaxes/python.tmLanguage.json b/extensions/python/syntaxes/python.tmLanguage.json
new file mode 100755
index 0000000000..ea5f6e0b8b
--- /dev/null
+++ b/extensions/python/syntaxes/python.tmLanguage.json
@@ -0,0 +1,5368 @@
+{
+ "information_for_contributors": [
+ "This file has been converted from https://github.com/MagicStack/MagicPython/blob/master/grammars/MagicPython.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/MagicStack/MagicPython/commit/b453f26ed856c9b16a053517c41207e3a72cc7d5",
+ "name": "MagicPython",
+ "scopeName": "source.python",
+ "patterns": [
+ {
+ "include": "#statement"
+ },
+ {
+ "include": "#expression"
+ }
+ ],
+ "repository": {
+ "impossible": {
+ "comment":
+ "This is a special rule that should be used where no match is desired. It is not a good idea to match something like '1{0}' because in some cases that can result in infinite loops in token generation. So the rule instead matches and impossible expression to allow a match to fail and move to the next token.",
+ "match": "$.^"
+ },
+ "statement": {
+ "patterns": [
+ {
+ "include": "#import"
+ },
+ {
+ "include": "#class-declaration"
+ },
+ {
+ "include": "#function-declaration"
+ },
+ {
+ "include": "#statement-keyword"
+ },
+ {
+ "include": "#assignment-operator"
+ },
+ {
+ "include": "#decorator"
+ },
+ {
+ "include": "#docstring-statement"
+ },
+ {
+ "include": "#semicolon"
+ }
+ ]
+ },
+ "semicolon": {
+ "patterns": [
+ {
+ "name": "invalid.deprecated.semicolon.python",
+ "match": "\\;$"
+ }
+ ]
+ },
+ "comments": {
+ "patterns": [
+ {
+ "name": "comment.line.number-sign.python",
+ "contentName": "meta.typehint.comment.python",
+ "begin":
+ "(?x)\n (?:\n \\# \\s* (type:)\n \\s*+ (?# we want `\\s*+` which is possessive quantifier since\n we do not actually want to backtrack when matching\n whitespace here)\n (?! $ | \\#)\n )\n",
+ "end": "(?:$|(?=\\#))",
+ "beginCaptures": {
+ "0": {
+ "name": "meta.typehint.comment.python"
+ },
+ "1": {
+ "name": "comment.typehint.directive.notation.python"
+ }
+ },
+ "patterns": [
+ {
+ "name": "comment.typehint.ignore.notation.python",
+ "match": "(?x)\n \\G ignore\n (?= \\s* (?: $ | \\#))\n"
+ },
+ {
+ "name": "comment.typehint.type.notation.python",
+ "match":
+ "(?x)\n (?))"
+ },
+ {
+ "name": "comment.typehint.variable.notation.python",
+ "match": "([[:alpha:]_]\\w*)"
+ }
+ ]
+ },
+ {
+ "include": "#comments-base"
+ }
+ ]
+ },
+ "docstring-statement": {
+ "begin": "^(?=\\s*[rR]?(\\'\\'\\'|\\\"\\\"\\\"|\\'|\\\"))",
+ "end": "(?<=\\'\\'\\'|\\\"\\\"\\\"|\\'|\\\")",
+ "patterns": [
+ {
+ "include": "#docstring"
+ }
+ ]
+ },
+ "docstring": {
+ "patterns": [
+ {
+ "name": "string.quoted.docstring.multi.python",
+ "begin": "(\\'\\'\\'|\\\"\\\"\\\")",
+ "end": "(\\1)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.string.begin.python"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.definition.string.end.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#docstring-prompt"
+ },
+ {
+ "include": "#codetags"
+ },
+ {
+ "include": "#docstring-guts-unicode"
+ }
+ ]
+ },
+ {
+ "name": "string.quoted.docstring.raw.multi.python",
+ "begin": "([rR])(\\'\\'\\'|\\\"\\\"\\\")",
+ "end": "(\\2)",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.type.string.python"
+ },
+ "2": {
+ "name": "punctuation.definition.string.begin.python"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.definition.string.end.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#string-consume-escape"
+ },
+ {
+ "include": "#docstring-prompt"
+ },
+ {
+ "include": "#codetags"
+ }
+ ]
+ },
+ {
+ "name": "string.quoted.docstring.single.python",
+ "begin": "(\\'|\\\")",
+ "end": "(\\1)|((?>>|\\.\\.\\.) \\s) (?=\\s*\\S)\n )\n",
+ "captures": {
+ "1": {
+ "name": "keyword.control.flow.python"
+ }
+ }
+ },
+ "statement-keyword": {
+ "patterns": [
+ {
+ "name": "storage.type.function.python",
+ "match": "\\b((async\\s+)?\\s*def)\\b"
+ },
+ {
+ "name": "keyword.control.flow.python",
+ "match":
+ "(?x)\n \\b(?>= | //= | \\*\\*=\n | \\+= | -= | /= | @=\n | \\*= | %= | ~= | \\^= | &= | \\|=\n | =(?!=)\n"
+ },
+ "operator": {
+ "match":
+ "(?x)\n \\b(?> | & | \\| | \\^ | ~) (?# 3)\n\n | (\\*\\* | \\* | \\+ | - | % | // | / | @) (?# 4)\n\n | (!= | == | >= | <= | < | >) (?# 5)\n",
+ "captures": {
+ "1": {
+ "name": "keyword.operator.logical.python"
+ },
+ "2": {
+ "name": "keyword.control.flow.python"
+ },
+ "3": {
+ "name": "keyword.operator.bitwise.python"
+ },
+ "4": {
+ "name": "keyword.operator.arithmetic.python"
+ },
+ "5": {
+ "name": "keyword.operator.comparison.python"
+ }
+ }
+ },
+ "punctuation": {
+ "patterns": [
+ {
+ "name": "punctuation.separator.colon.python",
+ "match": ":"
+ },
+ {
+ "name": "punctuation.separator.element.python",
+ "match": ","
+ }
+ ]
+ },
+ "literal": {
+ "patterns": [
+ {
+ "name": "constant.language.python",
+ "match": "\\b(True|False|None|NotImplemented|Ellipsis)\\b"
+ },
+ {
+ "include": "#number"
+ }
+ ]
+ },
+ "number": {
+ "name": "constant.numeric.python",
+ "patterns": [
+ {
+ "include": "#number-float"
+ },
+ {
+ "include": "#number-dec"
+ },
+ {
+ "include": "#number-hex"
+ },
+ {
+ "include": "#number-oct"
+ },
+ {
+ "include": "#number-bin"
+ },
+ {
+ "include": "#number-long"
+ },
+ {
+ "name": "invalid.illegal.name.python",
+ "match": "\\b[0-9]+\\w+"
+ }
+ ]
+ },
+ "number-float": {
+ "name": "constant.numeric.float.python",
+ "match":
+ "(?x)\n (?=^]? [-+ ]? \\#?\n \\d* ,? (\\.\\d+)? [bcdeEfFgGnosxX%]? )?\n })\n )\n",
+ "captures": {
+ "2": {
+ "name": "storage.type.format.python"
+ },
+ "3": {
+ "name": "storage.type.format.python"
+ }
+ }
+ },
+ {
+ "name": "constant.character.format.placeholder.other.python",
+ "begin":
+ "(?x)\n \\{\n \\w*? (\\.[[:alpha:]_]\\w*? | \\[[^\\]'\"]+\\])*?\n (![rsa])?\n (:)\n (?=[^'\"}\\n]*\\})\n",
+ "end": "\\}",
+ "beginCaptures": {
+ "2": {
+ "name": "storage.type.format.python"
+ },
+ "3": {
+ "name": "storage.type.format.python"
+ }
+ },
+ "patterns": [
+ {
+ "match": "(?x) \\{ [^'\"}\\n]*? \\} (?=.*?\\})\n"
+ }
+ ]
+ }
+ ]
+ },
+ "fstring-formatting": {
+ "patterns": [
+ {
+ "include": "#fstring-formatting-braces"
+ },
+ {
+ "include": "#fstring-formatting-singe-brace"
+ }
+ ]
+ },
+ "fstring-formatting-singe-brace": {
+ "name": "invalid.illegal.brace.python",
+ "match": "(}(?!}))"
+ },
+ "import": {
+ "comment": "Import statements\n",
+ "patterns": [
+ {
+ "match": "(?x)\n \\s* \\b(from)\\b \\s*(\\.+)\\s* (import)?\n",
+ "captures": {
+ "1": {
+ "name": "keyword.control.import.python"
+ },
+ "2": {
+ "name": "punctuation.separator.period.python"
+ },
+ "3": {
+ "name": "keyword.control.import.python"
+ }
+ }
+ },
+ {
+ "name": "keyword.control.import.python",
+ "match": "\\b(?)",
+ "end": "(?=:)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.separator.annotation.result.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "item-access": {
+ "patterns": [
+ {
+ "name": "meta.item-access.python",
+ "begin": "(?x)\n \\b(?=\n [[:alpha:]_]\\w* \\s* \\[\n )\n",
+ "end": "(\\])",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.definition.arguments.end.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#item-name"
+ },
+ {
+ "include": "#item-index"
+ },
+ {
+ "include": "#expression"
+ }
+ ]
+ }
+ ]
+ },
+ "item-name": {
+ "patterns": [
+ {
+ "include": "#special-variables"
+ },
+ {
+ "include": "#builtin-functions"
+ },
+ {
+ "include": "#special-names"
+ },
+ {
+ "match": "(?x)\n \\b ([[:alpha:]_]\\w*) \\b\n"
+ }
+ ]
+ },
+ "item-index": {
+ "begin": "(\\[)",
+ "end": "(?=\\])",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.arguments.begin.python"
+ }
+ },
+ "contentName": "meta.item-access.arguments.python",
+ "patterns": [
+ {
+ "name": "punctuation.separator.slice.python",
+ "match": ":"
+ },
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "decorator": {
+ "name": "meta.function.decorator.python",
+ "begin": "(?x)\n ^\\s*\n (@) \\s* (?=[[:alpha:]_]\\w*)\n",
+ "end":
+ "(?x)\n ( \\) )\n # trailing whitespace and comments are legal\n (?: (.*?) (?=\\s*(?:\\#|$)) )\n | (?=\\n|\\#)\n",
+ "beginCaptures": {
+ "1": {
+ "name": "entity.name.function.decorator.python"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.definition.arguments.end.python"
+ },
+ "2": {
+ "name": "invalid.illegal.decorator.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#decorator-name"
+ },
+ {
+ "include": "#function-arguments"
+ }
+ ]
+ },
+ "decorator-name": {
+ "patterns": [
+ {
+ "include": "#builtin-callables"
+ },
+ {
+ "include": "#illegal-object-name"
+ },
+ {
+ "name": "entity.name.function.decorator.python",
+ "match": "(?x)\n ([[:alpha:]_]\\w*) | \\.\n"
+ },
+ {
+ "include": "#line-continuation"
+ },
+ {
+ "name": "invalid.illegal.decorator.python",
+ "match": "(?x)\n \\s* ([^([:alpha:]\\s_\\.#\\\\] .*?) (?=\\#|$)\n",
+ "captures": {
+ "1": {
+ "name": "invalid.illegal.decorator.python"
+ }
+ }
+ }
+ ]
+ },
+ "call-wrapper-inheritance": {
+ "comment": "same as a function call, but in inheritance context",
+ "name": "meta.function-call.python",
+ "begin": "(?x)\n \\b(?=\n ([[:alpha:]_]\\w*) \\s* (\\()\n )\n",
+ "end": "(\\))",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.definition.arguments.end.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#inheritance-name"
+ },
+ {
+ "include": "#function-arguments"
+ }
+ ]
+ },
+ "inheritance-name": {
+ "patterns": [
+ {
+ "include": "#lambda-incomplete"
+ },
+ {
+ "include": "#builtin-possible-callables"
+ },
+ {
+ "include": "#inheritance-identifier"
+ }
+ ]
+ },
+ "function-call": {
+ "name": "meta.function-call.python",
+ "begin": "(?x)\n \\b(?=\n ([[:alpha:]_]\\w*) \\s* (\\()\n )\n",
+ "end": "(\\))",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.definition.arguments.end.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#special-variables"
+ },
+ {
+ "include": "#function-name"
+ },
+ {
+ "include": "#function-arguments"
+ }
+ ]
+ },
+ "function-name": {
+ "patterns": [
+ {
+ "include": "#builtin-possible-callables"
+ },
+ {
+ "comment": "Some color schemas support meta.function-call.generic scope",
+ "name": "meta.function-call.generic.python",
+ "match": "(?x)\n \\b ([[:alpha:]_]\\w*) \\b\n"
+ }
+ ]
+ },
+ "function-arguments": {
+ "begin": "(?x)\n (?:\n (\\()\n (?:\\s*(\\*\\*|\\*))?\n )\n",
+ "end": "(?=\\))(?!\\)\\s*\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.arguments.begin.python"
+ },
+ "2": {
+ "name": "keyword.operator.unpacking.arguments.python"
+ }
+ },
+ "contentName": "meta.function-call.arguments.python",
+ "patterns": [
+ {
+ "match": "(?x)\n (?:\n (,)\n (?:\\s*(\\*\\*|\\*))?\n )\n",
+ "captures": {
+ "1": {
+ "name": "punctuation.separator.arguments.python"
+ },
+ "2": {
+ "name": "keyword.operator.unpacking.arguments.python"
+ }
+ }
+ },
+ {
+ "include": "#lambda-incomplete"
+ },
+ {
+ "include": "#illegal-names"
+ },
+ {
+ "match": "\\b([[:alpha:]_]\\w*)\\s*(=)(?!=)",
+ "captures": {
+ "1": {
+ "name": "variable.parameter.function-call.python"
+ },
+ "2": {
+ "name": "keyword.operator.assignment.python"
+ }
+ }
+ },
+ {
+ "name": "keyword.operator.assignment.python",
+ "match": "=(?!=)"
+ },
+ {
+ "include": "#expression"
+ },
+ {
+ "match": "\\s*(\\))\\s*(\\()",
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.arguments.end.python"
+ },
+ "2": {
+ "name": "punctuation.definition.arguments.begin.python"
+ }
+ }
+ }
+ ]
+ },
+ "builtin-callables": {
+ "patterns": [
+ {
+ "include": "#illegal-names"
+ },
+ {
+ "include": "#illegal-object-name"
+ },
+ {
+ "include": "#builtin-exceptions"
+ },
+ {
+ "include": "#builtin-functions"
+ },
+ {
+ "include": "#builtin-types"
+ }
+ ]
+ },
+ "builtin-possible-callables": {
+ "patterns": [
+ {
+ "include": "#builtin-callables"
+ },
+ {
+ "include": "#magic-names"
+ }
+ ]
+ },
+ "builtin-exceptions": {
+ "name": "support.type.exception.python",
+ "match":
+ "(?x) (?"
+ },
+ "regexp-base-expression": {
+ "patterns": [
+ {
+ "include": "#regexp-quantifier"
+ },
+ {
+ "include": "#regexp-base-common"
+ }
+ ]
+ },
+ "fregexp-base-expression": {
+ "patterns": [
+ {
+ "include": "#fregexp-quantifier"
+ },
+ {
+ "include": "#fstring-formatting-braces"
+ },
+ {
+ "match": "\\{.*?\\}"
+ },
+ {
+ "include": "#regexp-base-common"
+ }
+ ]
+ },
+ "fstring-formatting-braces": {
+ "patterns": [
+ {
+ "comment": "empty braces are illegal",
+ "match": "({)(\\s*?)(})",
+ "captures": {
+ "1": {
+ "name": "constant.character.format.placeholder.other.python"
+ },
+ "2": {
+ "name": "invalid.illegal.brace.python"
+ },
+ "3": {
+ "name": "constant.character.format.placeholder.other.python"
+ }
+ }
+ },
+ {
+ "name": "constant.character.escape.python",
+ "match": "({{|}})"
+ }
+ ]
+ },
+ "regexp-base-common": {
+ "patterns": [
+ {
+ "name": "support.other.match.any.regexp",
+ "match": "\\."
+ },
+ {
+ "name": "support.other.match.begin.regexp",
+ "match": "\\^"
+ },
+ {
+ "name": "support.other.match.end.regexp",
+ "match": "\\$"
+ },
+ {
+ "name": "keyword.operator.quantifier.regexp",
+ "match": "[+*?]\\??"
+ },
+ {
+ "name": "keyword.operator.disjunction.regexp",
+ "match": "\\|"
+ },
+ {
+ "include": "#regexp-escape-sequence"
+ }
+ ]
+ },
+ "regexp-quantifier": {
+ "name": "keyword.operator.quantifier.regexp",
+ "match": "(?x)\n \\{(\n \\d+ | \\d+,(\\d+)? | ,\\d+\n )\\}\n"
+ },
+ "fregexp-quantifier": {
+ "name": "keyword.operator.quantifier.regexp",
+ "match": "(?x)\n \\{\\{(\n \\d+ | \\d+,(\\d+)? | ,\\d+\n )\\}\\}\n"
+ },
+ "regexp-backreference-number": {
+ "name": "meta.backreference.regexp",
+ "match": "(\\\\[1-9]\\d?)",
+ "captures": {
+ "1": {
+ "name": "entity.name.tag.backreference.regexp"
+ }
+ }
+ },
+ "regexp-backreference": {
+ "name": "meta.backreference.named.regexp",
+ "match": "(?x)\n (\\() (\\?P= \\w+(?:\\s+[[:alnum:]]+)?) (\\))\n",
+ "captures": {
+ "1": {
+ "name":
+ "support.other.parenthesis.regexp punctuation.parenthesis.backreference.named.begin.regexp"
+ },
+ "2": {
+ "name": "entity.name.tag.named.backreference.regexp"
+ },
+ "3": {
+ "name":
+ "support.other.parenthesis.regexp punctuation.parenthesis.backreference.named.end.regexp"
+ }
+ }
+ },
+ "regexp-flags": {
+ "name": "storage.modifier.flag.regexp",
+ "match": "\\(\\?[aiLmsux]+\\)"
+ },
+ "regexp-escape-special": {
+ "name": "support.other.escape.special.regexp",
+ "match": "\\\\([AbBdDsSwWZ])"
+ },
+ "regexp-escape-character": {
+ "name": "constant.character.escape.regexp",
+ "match":
+ "(?x)\n \\\\ (\n x[0-9A-Fa-f]{2}\n | 0[0-7]{1,2}\n | [0-7]{3}\n )\n"
+ },
+ "regexp-escape-unicode": {
+ "name": "constant.character.unicode.regexp",
+ "match": "(?x)\n \\\\ (\n u[0-9A-Fa-f]{4}\n | U[0-9A-Fa-f]{8}\n )\n"
+ },
+ "regexp-escape-catchall": {
+ "name": "constant.character.escape.regexp",
+ "match": "\\\\(.|\\n)"
+ },
+ "regexp-escape-sequence": {
+ "patterns": [
+ {
+ "include": "#regexp-escape-special"
+ },
+ {
+ "include": "#regexp-escape-character"
+ },
+ {
+ "include": "#regexp-escape-unicode"
+ },
+ {
+ "include": "#regexp-backreference-number"
+ },
+ {
+ "include": "#regexp-escape-catchall"
+ }
+ ]
+ },
+ "regexp-charecter-set-escapes": {
+ "patterns": [
+ {
+ "name": "constant.character.escape.regexp",
+ "match": "\\\\[abfnrtv\\\\]"
+ },
+ {
+ "include": "#regexp-escape-special"
+ },
+ {
+ "name": "constant.character.escape.regexp",
+ "match": "\\\\([0-7]{1,3})"
+ },
+ {
+ "include": "#regexp-escape-character"
+ },
+ {
+ "include": "#regexp-escape-unicode"
+ },
+ {
+ "include": "#regexp-escape-catchall"
+ }
+ ]
+ },
+ "codetags": {
+ "match": "(?:\\b(NOTE|XXX|HACK|FIXME|BUG|TODO)\\b)",
+ "captures": {
+ "1": {
+ "name": "keyword.codetag.notation.python"
+ }
+ }
+ },
+ "comments-base": {
+ "name": "comment.line.number-sign.python",
+ "begin": "(\\#)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.comment.python"
+ }
+ },
+ "end": "($)",
+ "patterns": [
+ {
+ "include": "#codetags"
+ }
+ ]
+ },
+ "comments-string-single-three": {
+ "name": "comment.line.number-sign.python",
+ "begin": "(\\#)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.comment.python"
+ }
+ },
+ "end": "($|(?='''))",
+ "patterns": [
+ {
+ "include": "#codetags"
+ }
+ ]
+ },
+ "comments-string-double-three": {
+ "name": "comment.line.number-sign.python",
+ "begin": "(\\#)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.comment.python"
+ }
+ },
+ "end": "($|(?=\"\"\"))",
+ "patterns": [
+ {
+ "include": "#codetags"
+ }
+ ]
+ },
+ "single-one-regexp-expression": {
+ "patterns": [
+ {
+ "include": "#regexp-base-expression"
+ },
+ {
+ "include": "#single-one-regexp-character-set"
+ },
+ {
+ "include": "#single-one-regexp-comments"
+ },
+ {
+ "include": "#regexp-flags"
+ },
+ {
+ "include": "#single-one-regexp-named-group"
+ },
+ {
+ "include": "#regexp-backreference"
+ },
+ {
+ "include": "#single-one-regexp-lookahead"
+ },
+ {
+ "include": "#single-one-regexp-lookahead-negative"
+ },
+ {
+ "include": "#single-one-regexp-lookbehind"
+ },
+ {
+ "include": "#single-one-regexp-lookbehind-negative"
+ },
+ {
+ "include": "#single-one-regexp-conditional"
+ },
+ {
+ "include": "#single-one-regexp-parentheses-non-capturing"
+ },
+ {
+ "include": "#single-one-regexp-parentheses"
+ }
+ ]
+ },
+ "single-one-regexp-character-set": {
+ "patterns": [
+ {
+ "match": "(?x)\n \\[ \\^? \\] (?! .*?\\])\n"
+ },
+ {
+ "name": "meta.character.set.regexp",
+ "begin": "(\\[)(\\^)?(\\])?",
+ "end": "(\\]|(?=\\'))|((?=(?)\n",
+ "end": "(\\)|(?=\\'))|((?=(?)\n",
+ "end": "(\\)|(?=\\'\\'\\'))",
+ "beginCaptures": {
+ "1": {
+ "name":
+ "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
+ },
+ "2": {
+ "name": "entity.name.tag.named.group.regexp"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name":
+ "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#single-three-regexp-expression"
+ },
+ {
+ "include": "#comments-string-single-three"
+ }
+ ]
+ },
+ "single-three-regexp-comments": {
+ "name": "comment.regexp",
+ "begin": "\\(\\?#",
+ "end": "(\\)|(?=\\'\\'\\'))",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.comment.begin.regexp"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.comment.end.regexp"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#codetags"
+ }
+ ]
+ },
+ "single-three-regexp-lookahead": {
+ "begin": "(\\()\\?=",
+ "end": "(\\)|(?=\\'\\'\\'))",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.lookahead.regexp"
+ },
+ "1": {
+ "name": "punctuation.parenthesis.lookahead.begin.regexp"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name":
+ "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#single-three-regexp-expression"
+ },
+ {
+ "include": "#comments-string-single-three"
+ }
+ ]
+ },
+ "single-three-regexp-lookahead-negative": {
+ "begin": "(\\()\\?!",
+ "end": "(\\)|(?=\\'\\'\\'))",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.lookahead.negative.regexp"
+ },
+ "1": {
+ "name": "punctuation.parenthesis.lookahead.begin.regexp"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name":
+ "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#single-three-regexp-expression"
+ },
+ {
+ "include": "#comments-string-single-three"
+ }
+ ]
+ },
+ "single-three-regexp-lookbehind": {
+ "begin": "(\\()\\?<=",
+ "end": "(\\)|(?=\\'\\'\\'))",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.lookbehind.regexp"
+ },
+ "1": {
+ "name": "punctuation.parenthesis.lookbehind.begin.regexp"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name":
+ "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#single-three-regexp-expression"
+ },
+ {
+ "include": "#comments-string-single-three"
+ }
+ ]
+ },
+ "single-three-regexp-lookbehind-negative": {
+ "begin": "(\\()\\?)\n",
+ "end": "(\\)|(?=\"))|((?=(?)\n",
+ "end": "(\\)|(?=\"\"\"))",
+ "beginCaptures": {
+ "1": {
+ "name":
+ "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
+ },
+ "2": {
+ "name": "entity.name.tag.named.group.regexp"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name":
+ "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#double-three-regexp-expression"
+ },
+ {
+ "include": "#comments-string-double-three"
+ }
+ ]
+ },
+ "double-three-regexp-comments": {
+ "name": "comment.regexp",
+ "begin": "\\(\\?#",
+ "end": "(\\)|(?=\"\"\"))",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.comment.begin.regexp"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.comment.end.regexp"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#codetags"
+ }
+ ]
+ },
+ "double-three-regexp-lookahead": {
+ "begin": "(\\()\\?=",
+ "end": "(\\)|(?=\"\"\"))",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.lookahead.regexp"
+ },
+ "1": {
+ "name": "punctuation.parenthesis.lookahead.begin.regexp"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name":
+ "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#double-three-regexp-expression"
+ },
+ {
+ "include": "#comments-string-double-three"
+ }
+ ]
+ },
+ "double-three-regexp-lookahead-negative": {
+ "begin": "(\\()\\?!",
+ "end": "(\\)|(?=\"\"\"))",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.lookahead.negative.regexp"
+ },
+ "1": {
+ "name": "punctuation.parenthesis.lookahead.begin.regexp"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name":
+ "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#double-three-regexp-expression"
+ },
+ {
+ "include": "#comments-string-double-three"
+ }
+ ]
+ },
+ "double-three-regexp-lookbehind": {
+ "begin": "(\\()\\?<=",
+ "end": "(\\)|(?=\"\"\"))",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.lookbehind.regexp"
+ },
+ "1": {
+ "name": "punctuation.parenthesis.lookbehind.begin.regexp"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name":
+ "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#double-three-regexp-expression"
+ },
+ {
+ "include": "#comments-string-double-three"
+ }
+ ]
+ },
+ "double-three-regexp-lookbehind-negative": {
+ "begin": "(\\()\\?)\n",
+ "end": "(\\)|(?=\\'))|((?=(?)\n",
+ "end": "(\\)|(?=\\'\\'\\'))",
+ "beginCaptures": {
+ "1": {
+ "name":
+ "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
+ },
+ "2": {
+ "name": "entity.name.tag.named.group.regexp"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name":
+ "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#single-three-fregexp-expression"
+ },
+ {
+ "include": "#comments-string-single-three"
+ }
+ ]
+ },
+ "single-three-fregexp-lookahead": {
+ "begin": "(\\()\\?=",
+ "end": "(\\)|(?=\\'\\'\\'))",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.lookahead.regexp"
+ },
+ "1": {
+ "name": "punctuation.parenthesis.lookahead.begin.regexp"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name":
+ "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#single-three-fregexp-expression"
+ },
+ {
+ "include": "#comments-string-single-three"
+ }
+ ]
+ },
+ "single-three-fregexp-lookahead-negative": {
+ "begin": "(\\()\\?!",
+ "end": "(\\)|(?=\\'\\'\\'))",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.lookahead.negative.regexp"
+ },
+ "1": {
+ "name": "punctuation.parenthesis.lookahead.begin.regexp"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name":
+ "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#single-three-fregexp-expression"
+ },
+ {
+ "include": "#comments-string-single-three"
+ }
+ ]
+ },
+ "single-three-fregexp-lookbehind": {
+ "begin": "(\\()\\?<=",
+ "end": "(\\)|(?=\\'\\'\\'))",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.lookbehind.regexp"
+ },
+ "1": {
+ "name": "punctuation.parenthesis.lookbehind.begin.regexp"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name":
+ "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#single-three-fregexp-expression"
+ },
+ {
+ "include": "#comments-string-single-three"
+ }
+ ]
+ },
+ "single-three-fregexp-lookbehind-negative": {
+ "begin": "(\\()\\?)\n",
+ "end": "(\\)|(?=\"))|((?=(?)\n",
+ "end": "(\\)|(?=\"\"\"))",
+ "beginCaptures": {
+ "1": {
+ "name":
+ "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
+ },
+ "2": {
+ "name": "entity.name.tag.named.group.regexp"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name":
+ "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#double-three-fregexp-expression"
+ },
+ {
+ "include": "#comments-string-double-three"
+ }
+ ]
+ },
+ "double-three-fregexp-lookahead": {
+ "begin": "(\\()\\?=",
+ "end": "(\\)|(?=\"\"\"))",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.lookahead.regexp"
+ },
+ "1": {
+ "name": "punctuation.parenthesis.lookahead.begin.regexp"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name":
+ "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#double-three-fregexp-expression"
+ },
+ {
+ "include": "#comments-string-double-three"
+ }
+ ]
+ },
+ "double-three-fregexp-lookahead-negative": {
+ "begin": "(\\()\\?!",
+ "end": "(\\)|(?=\"\"\"))",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.lookahead.negative.regexp"
+ },
+ "1": {
+ "name": "punctuation.parenthesis.lookahead.begin.regexp"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name":
+ "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#double-three-fregexp-expression"
+ },
+ {
+ "include": "#comments-string-double-three"
+ }
+ ]
+ },
+ "double-three-fregexp-lookbehind": {
+ "begin": "(\\()\\?<=",
+ "end": "(\\)|(?=\"\"\"))",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.lookbehind.regexp"
+ },
+ "1": {
+ "name": "punctuation.parenthesis.lookbehind.begin.regexp"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name":
+ "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#double-three-fregexp-expression"
+ },
+ {
+ "include": "#comments-string-double-three"
+ }
+ ]
+ },
+ "double-three-fregexp-lookbehind-negative": {
+ "begin": "(\\()\\?=^]? [-+ ]? \\#?\n \\d* ,? (\\.\\d+)? [bcdeEfFgGnosxX%]? )(?=})\n",
+ "captures": {
+ "1": {
+ "name": "storage.type.format.python"
+ },
+ "2": {
+ "name": "storage.type.format.python"
+ }
+ }
+ },
+ {
+ "include": "#fstring-terminator-single-tail"
+ }
+ ]
+ },
+ "fstring-terminator-single-tail": {
+ "begin": "(![rsa])?(:)(?=.*?{)",
+ "end": "(?=})|(?=\\n)",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.type.format.python"
+ },
+ "2": {
+ "name": "storage.type.format.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#fstring-illegal-single-brace"
+ },
+ {
+ "include": "#fstring-single-brace"
+ },
+ {
+ "name": "storage.type.format.python",
+ "match": "([bcdeEfFgGnosxX%])(?=})"
+ },
+ {
+ "name": "storage.type.format.python",
+ "match": "(\\.\\d+)"
+ },
+ {
+ "name": "storage.type.format.python",
+ "match": "(,)"
+ },
+ {
+ "name": "storage.type.format.python",
+ "match": "(\\d+)"
+ },
+ {
+ "name": "storage.type.format.python",
+ "match": "(\\#)"
+ },
+ {
+ "name": "storage.type.format.python",
+ "match": "([-+ ])"
+ },
+ {
+ "name": "storage.type.format.python",
+ "match": "([<>=^])"
+ },
+ {
+ "name": "storage.type.format.python",
+ "match": "(\\w)"
+ }
+ ]
+ },
+ "fstring-fnorm-quoted-multi-line": {
+ "name": "meta.fstring.python",
+ "begin": "(\\b[fF])([bBuU])?('''|\"\"\")",
+ "end": "(\\3)",
+ "beginCaptures": {
+ "1": {
+ "name":
+ "string.interpolated.python string.quoted.multi.python storage.type.string.python"
+ },
+ "2": {
+ "name": "invalid.illegal.prefix.python"
+ },
+ "3": {
+ "name":
+ "punctuation.definition.string.begin.python string.interpolated.python string.quoted.multi.python"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name":
+ "punctuation.definition.string.end.python string.interpolated.python string.quoted.multi.python"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#fstring-guts"
+ },
+ {
+ "include": "#fstring-illegal-multi-brace"
+ },
+ {
+ "include": "#fstring-multi-brace"
+ },
+ {
+ "include": "#fstring-multi-core"
+ }
+ ]
+ },
+ "fstring-normf-quoted-multi-line": {
+ "name": "meta.fstring.python",
+ "begin": "(\\b[bBuU])([fF])('''|\"\"\")",
+ "end": "(\\3)",
+ "beginCaptures": {
+ "1": {
+ "name": "invalid.illegal.prefix.python"
+ },
+ "2": {
+ "name":
+ "string.interpolated.python string.quoted.multi.python storage.type.string.python"
+ },
+ "3": {
+ "name": "punctuation.definition.string.begin.python string.quoted.multi.python"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name":
+ "punctuation.definition.string.end.python string.interpolated.python string.quoted.multi.python"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#fstring-guts"
+ },
+ {
+ "include": "#fstring-illegal-multi-brace"
+ },
+ {
+ "include": "#fstring-multi-brace"
+ },
+ {
+ "include": "#fstring-multi-core"
+ }
+ ]
+ },
+ "fstring-raw-quoted-multi-line": {
+ "name": "meta.fstring.python",
+ "begin": "(\\b(?:[R][fF]|[fF][R]))('''|\"\"\")",
+ "end": "(\\2)",
+ "beginCaptures": {
+ "1": {
+ "name":
+ "string.interpolated.python string.quoted.raw.multi.python storage.type.string.python"
+ },
+ "2": {
+ "name":
+ "punctuation.definition.string.begin.python string.quoted.raw.multi.python"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name":
+ "punctuation.definition.string.end.python string.interpolated.python string.quoted.raw.multi.python"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#fstring-raw-guts"
+ },
+ {
+ "include": "#fstring-illegal-multi-brace"
+ },
+ {
+ "include": "#fstring-multi-brace"
+ },
+ {
+ "include": "#fstring-raw-multi-core"
+ }
+ ]
+ },
+ "fstring-multi-core": {
+ "name": "string.interpolated.python string.quoted.multi.python",
+ "match":
+ "(?x)\n (.+?)\n (\n (?# .* and .*? in multi-line match need special handling of\n newlines otherwise SublimeText and Atom will match slightly\n differently.\n\n The guard for newlines has to be separate from the\n lookahead because of special $ matching rule.)\n ($\\n?)\n |\n (?=[\\\\\\}\\{]|'''|\"\"\")\n )\n (?# due to how multiline regexps are matched we need a special case\n for matching a newline character)\n | \\n\n"
+ },
+ "fstring-raw-multi-core": {
+ "name": "string.interpolated.python string.quoted.raw.multi.python",
+ "match":
+ "(?x)\n (.+?)\n (\n (?# .* and .*? in multi-line match need special handling of\n newlines otherwise SublimeText and Atom will match slightly\n differently.\n\n The guard for newlines has to be separate from the\n lookahead because of special $ matching rule.)\n ($\\n?)\n |\n (?=[\\\\\\}\\{]|'''|\"\"\")\n )\n (?# due to how multiline regexps are matched we need a special case\n for matching a newline character)\n | \\n\n"
+ },
+ "fstring-multi-brace": {
+ "comment": "value interpolation using { ... }",
+ "begin": "(\\{)",
+ "end": "(?x)\n (\\})\n",
+ "beginCaptures": {
+ "1": {
+ "name": "constant.character.format.placeholder.other.python"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name": "constant.character.format.placeholder.other.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#fstring-terminator-multi"
+ },
+ {
+ "include": "#f-expression"
+ }
+ ]
+ },
+ "fstring-terminator-multi": {
+ "patterns": [
+ {
+ "name": "storage.type.format.python",
+ "match": "(![rsa])(?=})"
+ },
+ {
+ "match":
+ "(?x)\n (![rsa])?\n ( : \\w? [<>=^]? [-+ ]? \\#?\n \\d* ,? (\\.\\d+)? [bcdeEfFgGnosxX%]? )(?=})\n",
+ "captures": {
+ "1": {
+ "name": "storage.type.format.python"
+ },
+ "2": {
+ "name": "storage.type.format.python"
+ }
+ }
+ },
+ {
+ "include": "#fstring-terminator-multi-tail"
+ }
+ ]
+ },
+ "fstring-terminator-multi-tail": {
+ "begin": "(![rsa])?(:)(?=.*?{)",
+ "end": "(?=})",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.type.format.python"
+ },
+ "2": {
+ "name": "storage.type.format.python"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#fstring-illegal-multi-brace"
+ },
+ {
+ "include": "#fstring-multi-brace"
+ },
+ {
+ "name": "storage.type.format.python",
+ "match": "([bcdeEfFgGnosxX%])(?=})"
+ },
+ {
+ "name": "storage.type.format.python",
+ "match": "(\\.\\d+)"
+ },
+ {
+ "name": "storage.type.format.python",
+ "match": "(,)"
+ },
+ {
+ "name": "storage.type.format.python",
+ "match": "(\\d+)"
+ },
+ {
+ "name": "storage.type.format.python",
+ "match": "(\\#)"
+ },
+ {
+ "name": "storage.type.format.python",
+ "match": "([-+ ])"
+ },
+ {
+ "name": "storage.type.format.python",
+ "match": "([<>=^])"
+ },
+ {
+ "name": "storage.type.format.python",
+ "match": "(\\w)"
+ }
+ ]
+ }
+ }
+}
diff --git a/extensions/ruby/syntaxes/ruby.tmLanguage.json b/extensions/ruby/syntaxes/ruby.tmLanguage.json
new file mode 100755
index 0000000000..7c3cab1d8a
--- /dev/null
+++ b/extensions/ruby/syntaxes/ruby.tmLanguage.json
@@ -0,0 +1,2795 @@
+{
+ "information_for_contributors": [
+ "This file has been converted from https://github.com/textmate/ruby.tmbundle/blob/master/Syntaxes/Ruby.plist",
+ "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/textmate/ruby.tmbundle/commit/74713556df10fbc7b1f9e99013ab1e34cd836f56",
+ "name": "Ruby",
+ "scopeName": "source.ruby",
+ "comment":
+ "\n\tTODO: unresolved issues\n\n\ttext:\n\t\"p <[a-zA-Z_]\\w*(?>[?!])?)(:)(?!:)",
+ "name": "constant.other.symbol.hashkey.ruby"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.constant.ruby"
+ }
+ },
+ "comment": "symbols as hash key (1.8 syntax)",
+ "match": "(?[a-zA-Z_]\\w*(?>[?!])?)(?=\\s*=>)",
+ "name": "constant.other.symbol.hashkey.ruby"
+ },
+ {
+ "comment": "everything being a reserved word, not a value and needing a 'end' is a..",
+ "match":
+ "(?|_|\\*|\\$|\\?|:|\"|-[0adFiIlpvw])",
+ "name": "variable.other.readwrite.global.pre-defined.ruby"
+ },
+ {
+ "begin": "\\b(ENV)\\[",
+ "beginCaptures": {
+ "1": {
+ "name": "variable.other.constant.ruby"
+ }
+ },
+ "end": "\\]",
+ "name": "meta.environment-variable.ruby",
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ {
+ "match": "\\b[A-Z]\\w*(?=((\\.|::)[A-Za-z]|\\[))",
+ "name": "support.class.ruby"
+ },
+ {
+ "match":
+ "\\b(abort|at_exit|autoload[?]?|binding|callcc|caller|caller_locations|chomp|chop|eval|exec|exit|exit!|fork|format|gets|global_variables|gsub|lambda|load|local_variables|open|p|print|printf|proc|putc|puts|rand|readline|readlines|select|set_trace_func|sleep|spawn|sprintf|srand|sub|syscall|system|test|trace_var|trap|untrace_var|warn)(\\b|(?<=[?!]))(?![?!])",
+ "name": "support.function.kernel.ruby"
+ },
+ {
+ "match": "\\b[_A-Z]\\w*\\b",
+ "name": "variable.other.constant.ruby"
+ },
+ {
+ "begin":
+ "(?x)\n\t\t\t (?=def\\b) # an optimization to help Oniguruma fail fast\n\t\t\t (?<=^|\\s)(def)\\s+ # the def keyword\n\t\t\t ( (?>[a-zA-Z_]\\w*(?>\\.|::))? # a method name prefix\n\t\t\t (?>[a-zA-Z_]\\w*(?>[?!]|=(?!>))? # the method name\n\t\t\t |===?|!=|!~|>[>=]?|<=>|<[<=]?|[%&`/\\|^]|\\*\\*?|=?~|[-+]@?|\\[\\]=?) ) # …or an operator method\n\t\t\t \\s*(\\() # the openning parenthesis for arguments\n\t\t\t ",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.control.def.ruby"
+ },
+ "2": {
+ "name": "entity.name.function.ruby"
+ },
+ "3": {
+ "name": "punctuation.definition.parameters.ruby"
+ }
+ },
+ "comment":
+ "the method pattern comes from the symbol pattern, see there for a explaination",
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.parameters.ruby"
+ }
+ },
+ "name": "meta.function.method.with-arguments.ruby",
+ "patterns": [
+ {
+ "begin": "(?=[&*_a-zA-Z])",
+ "end": "(?=[,)])",
+ "patterns": [
+ {
+ "captures": {
+ "1": {
+ "name": "storage.type.variable.ruby"
+ },
+ "2": {
+ "name": "constant.other.symbol.hashkey.parameter.function.ruby"
+ },
+ "3": {
+ "name": "punctuation.definition.constant.ruby"
+ },
+ "4": {
+ "name": "variable.parameter.function.ruby"
+ }
+ },
+ "match": "\\G([&*]?)(?:([_a-zA-Z]\\w*(:))|([_a-zA-Z]\\w*))"
+ },
+ {
+ "include": "#parens"
+ },
+ {
+ "include": "#braces"
+ },
+ {
+ "include": "$self"
+ }
+ ]
+ }
+ ],
+ "repository": {
+ "braces": {
+ "begin": "\\{",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.function.begin.ruby"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.function.end.ruby"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#parens"
+ },
+ {
+ "include": "#braces"
+ },
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ "parens": {
+ "begin": "\\(",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.function.begin.ruby"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.function.end.ruby"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#parens"
+ },
+ {
+ "include": "#braces"
+ },
+ {
+ "include": "$self"
+ }
+ ]
+ }
+ }
+ },
+ {
+ "begin":
+ "(?x)\n\t\t\t (?=def\\b) # an optimization to help Oniguruma fail fast\n\t\t\t (?<=^|\\s)(def)\\s+ # the def keyword\n\t\t\t ( (?>[a-zA-Z_]\\w*(?>\\.|::))? # a method name prefix\n\t\t\t (?>[a-zA-Z_]\\w*(?>[?!]|=(?!>))? # the method name\n\t\t\t |===?|!=|!~|>[>=]?|<=>|<[<=]?|[%&`/\\|^]|\\*\\*?|=?~|[-+]@?|\\[\\]=?) ) # …or an operator method\n\t\t\t [ \\t] # the space separating the arguments\n\t\t\t (?=[ \\t]*[^\\s#;]) # make sure arguments and not a comment follow\n\t\t\t ",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.control.def.ruby"
+ },
+ "2": {
+ "name": "entity.name.function.ruby"
+ }
+ },
+ "comment": "same as the previous rule, but without parentheses around the arguments",
+ "end": "$",
+ "name": "meta.function.method.with-arguments.ruby",
+ "patterns": [
+ {
+ "begin": "(?![\\s,])",
+ "end": "(?=,|$)",
+ "patterns": [
+ {
+ "captures": {
+ "1": {
+ "name": "storage.type.variable.ruby"
+ },
+ "2": {
+ "name": "constant.other.symbol.hashkey.parameter.function.ruby"
+ },
+ "3": {
+ "name": "punctuation.definition.constant.ruby"
+ },
+ "4": {
+ "name": "variable.parameter.function.ruby"
+ }
+ },
+ "match": "\\G([&*]?)(?:([_a-zA-Z]\\w*(:))|([_a-zA-Z]\\w*))",
+ "name": "variable.parameter.function.ruby"
+ },
+ {
+ "include": "$self"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "keyword.control.def.ruby"
+ },
+ "3": {
+ "name": "entity.name.function.ruby"
+ }
+ },
+ "comment": " the optional name is just to catch the def also without a method-name",
+ "match":
+ "(?x)\n\t\t\t (?=def\\b) # an optimization to help Oniguruma fail fast\n\t\t\t (?<=^|\\s)(def)\\b # the def keyword\n\t\t\t ( \\s+ # an optional group of whitespace followed by…\n\t\t\t ( (?>[a-zA-Z_]\\w*(?>\\.|::))? # a method name prefix\n\t\t\t (?>[a-zA-Z_]\\w*(?>[?!]|=(?!>))? # the method name\n\t\t\t |===?|!=|!~|>[>=]?|<=>|<[<=]?|[%&`/\\|^]|\\*\\*?|=?~|[-+]@?|\\[\\]=?) ) )? # …or an operator method\n\t\t\t ",
+ "name": "meta.function.method.without-arguments.ruby"
+ },
+ {
+ "match":
+ "\\b\\d(?>_?\\d)*(?=\\.\\d|[eE])(\\.\\d(?>_?\\d)*)?([eE][-+]?\\d(?>_?\\d)*)?r?i?\\b",
+ "name": "constant.numeric.float.ruby"
+ },
+ {
+ "match": "\\b(0|(0[dD]\\d|[1-9])(?>_?\\d)*)r?i?\\b",
+ "name": "constant.numeric.integer.ruby"
+ },
+ {
+ "match": "\\b0[xX]\\h(?>_?\\h)*r?i?\\b",
+ "name": "constant.numeric.hex.ruby"
+ },
+ {
+ "match": "\\b0[bB][01](?>_?[01])*r?i?\\b",
+ "name": "constant.numeric.binary.ruby"
+ },
+ {
+ "match": "\\b0([oO]?[0-7](?>_?[0-7])*)?r?i?\\b",
+ "name": "constant.numeric.octal.ruby"
+ },
+ {
+ "begin": ":'",
+ "captures": {
+ "0": {
+ "name": "punctuation.definition.constant.ruby"
+ }
+ },
+ "end": "'",
+ "name": "constant.other.symbol.single-quoted.ruby",
+ "patterns": [
+ {
+ "match": "\\\\['\\\\]",
+ "name": "constant.character.escape.ruby"
+ }
+ ]
+ },
+ {
+ "begin": ":\"",
+ "captures": {
+ "0": {
+ "name": "punctuation.definition.constant.ruby"
+ }
+ },
+ "end": "\"",
+ "name": "constant.other.symbol.double-quoted.ruby",
+ "patterns": [
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "include": "#escaped_char"
+ }
+ ]
+ },
+ {
+ "comment": "Needs higher precidence than regular expressions.",
+ "match": "(?~(?:\\[,|&;]\n\t\t\t | [\\s;]if\\s\t\t\t# keywords\n\t\t\t | [\\s;]elsif\\s\n\t\t\t | [\\s;]while\\s\n\t\t\t | [\\s;]unless\\s\n\t\t\t | [\\s;]when\\s\n\t\t\t | [\\s;]assert_match\\s\n\t\t\t | [\\s;]or\\s\t\t\t# boolean opperators\n\t\t\t | [\\s;]and\\s\n\t\t\t | [\\s;]not\\s\n\t\t\t | [\\s.]index\\s\t\t\t# methods\n\t\t\t | [\\s.]scan\\s\n\t\t\t | [\\s.]sub\\s\n\t\t\t | [\\s.]sub!\\s\n\t\t\t | [\\s.]gsub\\s\n\t\t\t | [\\s.]gsub!\\s\n\t\t\t | [\\s.]match\\s\n\t\t\t )\n\t\t\t | (?<= # or a look-behind with line anchor:\n\t\t\t ^when\\s # duplication necessary due to limits of regex\n\t\t\t | ^if\\s\n\t\t\t | ^elsif\\s\n\t\t\t | ^while\\s\n\t\t\t | ^unless\\s\n\t\t\t )\n\t\t\t )\n\t\t\t \\s*((/))(?![*+{}?])\n\t\t\t",
+ "captures": {
+ "1": {
+ "name": "string.regexp.classic.ruby"
+ },
+ "2": {
+ "name": "punctuation.definition.string.ruby"
+ }
+ },
+ "comment":
+ "regular expressions (normal)\n\t\t\twe only start a regexp if the character before it (excluding whitespace)\n\t\t\tis what we think is before a regexp\n\t\t\t",
+ "contentName": "string.regexp.classic.ruby",
+ "end": "((/[eimnosux]*))",
+ "patterns": [
+ {
+ "include": "#regex_sub"
+ }
+ ]
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.constant.ruby"
+ }
+ },
+ "comment": "symbols",
+ "match":
+ "(?[a-zA-Z_]\\w*(?>[?!]|=(?![>=]))?|===?|>[>=]?|<=>|<[<=]?|[%&`/\\|]|\\*\\*?|=?~|[-+]@?|\\[\\]=?|(@@?|\\$)[a-zA-Z_]\\w*)",
+ "name": "constant.other.symbol.ruby"
+ },
+ {
+ "begin": "^=begin",
+ "captures": {
+ "0": {
+ "name": "punctuation.definition.comment.ruby"
+ }
+ },
+ "comment": "multiline comments",
+ "end": "^=end",
+ "name": "comment.block.documentation.ruby"
+ },
+ {
+ "begin": "(^[ \\t]+)?(?=#)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.whitespace.comment.leading.ruby"
+ }
+ },
+ "end": "(?!\\G)",
+ "patterns": [
+ {
+ "begin": "#",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.comment.ruby"
+ }
+ },
+ "end": "\\n",
+ "name": "comment.line.number-sign.ruby"
+ }
+ ]
+ },
+ {
+ "comment":
+ "\n\t\t\tmatches questionmark-letters.\n\n\t\t\texamples (1st alternation = hex):\n\t\t\t?\\x1 ?\\x61\n\n\t\t\texamples (2nd alternation = octal):\n\t\t\t?\\0 ?\\07 ?\\017\n\n\t\t\texamples (3rd alternation = escaped):\n\t\t\t?\\n ?\\b\n\n\t\t\texamples (4th alternation = meta-ctrl):\n\t\t\t?\\C-a ?\\M-a ?\\C-\\M-\\C-\\M-a\n\n\t\t\texamples (4th alternation = normal):\n\t\t\t?a ?A ?0 \n\t\t\t?* ?\" ?( \n\t\t\t?. ?#\n\t\t\t\n\t\t\t\n\t\t\tthe negative lookbehind prevents against matching\n\t\t\tp(42.tainted?)\n\t\t\t",
+ "match":
+ "(?<<[-~](\"?)((?:[_\\w]+_|)HTML)\\b\\1))",
+ "comment": "Heredoc with embedded html",
+ "end": "(?!\\G)",
+ "name": "meta.embedded.block.html",
+ "patterns": [
+ {
+ "begin": "(?><<[-~](\"?)((?:[_\\w]+_|)HTML)\\b\\1)",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.ruby"
+ }
+ },
+ "contentName": "text.html",
+ "end": "\\s*\\2$\\n?",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.ruby"
+ }
+ },
+ "name": "string.unquoted.heredoc.ruby",
+ "patterns": [
+ {
+ "include": "#heredoc"
+ },
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "include": "text.html.basic"
+ },
+ {
+ "include": "#escaped_char"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "begin": "(?=(?><<[-~](\"?)((?:[_\\w]+_|)XML)\\b\\1))",
+ "comment": "Heredoc with embedded xml",
+ "end": "(?!\\G)",
+ "name": "meta.embedded.block.xml",
+ "patterns": [
+ {
+ "begin": "(?><<[-~](\"?)((?:[_\\w]+_|)XML)\\b\\1)",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.ruby"
+ }
+ },
+ "contentName": "text.xml",
+ "end": "\\s*\\2$\\n?",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.ruby"
+ }
+ },
+ "name": "string.unquoted.heredoc.ruby",
+ "patterns": [
+ {
+ "include": "#heredoc"
+ },
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "include": "text.xml"
+ },
+ {
+ "include": "#escaped_char"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "begin": "(?=(?><<[-~](\"?)((?:[_\\w]+_|)SQL)\\b\\1))",
+ "comment": "Heredoc with embedded sql",
+ "end": "(?!\\G)",
+ "name": "meta.embedded.block.sql",
+ "patterns": [
+ {
+ "begin": "(?><<[-~](\"?)((?:[_\\w]+_|)SQL)\\b\\1)",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.ruby"
+ }
+ },
+ "contentName": "source.sql",
+ "end": "\\s*\\2$\\n?",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.ruby"
+ }
+ },
+ "name": "string.unquoted.heredoc.ruby",
+ "patterns": [
+ {
+ "include": "#heredoc"
+ },
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "include": "source.sql"
+ },
+ {
+ "include": "#escaped_char"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "begin": "(?=(?><<[-~](\"?)((?:[_\\w]+_|)CSS)\\b\\1))",
+ "comment": "Heredoc with embedded css",
+ "end": "(?!\\G)",
+ "name": "meta.embedded.block.css",
+ "patterns": [
+ {
+ "begin": "(?><<[-~](\"?)((?:[_\\w]+_|)CSS)\\b\\1)",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.ruby"
+ }
+ },
+ "contentName": "source.css",
+ "end": "\\s*\\2$\\n?",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.ruby"
+ }
+ },
+ "name": "string.unquoted.heredoc.ruby",
+ "patterns": [
+ {
+ "include": "#heredoc"
+ },
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "include": "source.css"
+ },
+ {
+ "include": "#escaped_char"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "begin": "(?=(?><<[-~](\"?)((?:[_\\w]+_|)CPP)\\b\\1))",
+ "comment": "Heredoc with embedded c++",
+ "end": "(?!\\G)",
+ "name": "meta.embedded.block.c++",
+ "patterns": [
+ {
+ "begin": "(?><<[-~](\"?)((?:[_\\w]+_|)CPP)\\b\\1)",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.ruby"
+ }
+ },
+ "contentName": "source.c++",
+ "end": "\\s*\\2$\\n?",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.ruby"
+ }
+ },
+ "name": "string.unquoted.heredoc.ruby",
+ "patterns": [
+ {
+ "include": "#heredoc"
+ },
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "include": "source.c++"
+ },
+ {
+ "include": "#escaped_char"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "begin": "(?=(?><<[-~](\"?)((?:[_\\w]+_|)C)\\b\\1))",
+ "comment": "Heredoc with embedded c",
+ "end": "(?!\\G)",
+ "name": "meta.embedded.block.c",
+ "patterns": [
+ {
+ "begin": "(?><<[-~](\"?)((?:[_\\w]+_|)C)\\b\\1)",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.ruby"
+ }
+ },
+ "contentName": "source.c",
+ "end": "\\s*\\2$\\n?",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.ruby"
+ }
+ },
+ "name": "string.unquoted.heredoc.ruby",
+ "patterns": [
+ {
+ "include": "#heredoc"
+ },
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "include": "source.c"
+ },
+ {
+ "include": "#escaped_char"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "begin": "(?=(?><<[-~](\"?)((?:[_\\w]+_|)(?:JS|JAVASCRIPT))\\b\\1))",
+ "comment": "Heredoc with embedded javascript",
+ "end": "(?!\\G)",
+ "name": "meta.embedded.block.js",
+ "patterns": [
+ {
+ "begin": "(?><<[-~](\"?)((?:[_\\w]+_|)(?:JS|JAVASCRIPT))\\b\\1)",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.ruby"
+ }
+ },
+ "contentName": "source.js",
+ "end": "\\s*\\2$\\n?",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.ruby"
+ }
+ },
+ "name": "string.unquoted.heredoc.ruby",
+ "patterns": [
+ {
+ "include": "#heredoc"
+ },
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "include": "source.js"
+ },
+ {
+ "include": "#escaped_char"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "begin": "(?=(?><<[-~](\"?)((?:[_\\w]+_|)JQUERY)\\b\\1))",
+ "comment": "Heredoc with embedded jQuery javascript",
+ "end": "(?!\\G)",
+ "name": "meta.embedded.block.js.jquery",
+ "patterns": [
+ {
+ "begin": "(?><<[-~](\"?)((?:[_\\w]+_|)JQUERY)\\b\\1)",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.ruby"
+ }
+ },
+ "contentName": "source.js.jquery",
+ "end": "\\s*\\2$\\n?",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.ruby"
+ }
+ },
+ "name": "string.unquoted.heredoc.ruby",
+ "patterns": [
+ {
+ "include": "#heredoc"
+ },
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "include": "source.js.jquery"
+ },
+ {
+ "include": "#escaped_char"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "begin": "(?=(?><<[-~](\"?)((?:[_\\w]+_|)(?:SH|SHELL))\\b\\1))",
+ "comment": "Heredoc with embedded shell",
+ "end": "(?!\\G)",
+ "name": "meta.embedded.block.shell",
+ "patterns": [
+ {
+ "begin": "(?><<[-~](\"?)((?:[_\\w]+_|)(?:SH|SHELL))\\b\\1)",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.ruby"
+ }
+ },
+ "contentName": "source.shell",
+ "end": "\\s*\\2$\\n?",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.ruby"
+ }
+ },
+ "name": "string.unquoted.heredoc.ruby",
+ "patterns": [
+ {
+ "include": "#heredoc"
+ },
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "include": "source.shell"
+ },
+ {
+ "include": "#escaped_char"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "begin": "(?=(?><<[-~](\"?)((?:[_\\w]+_|)LUA)\\b\\1))",
+ "comment": "Heredoc with embedded lua",
+ "end": "(?!\\G)",
+ "name": "meta.embedded.block.lua",
+ "patterns": [
+ {
+ "begin": "(?><<[-~](\"?)((?:[_\\w]+_|)LUA)\\b\\1)",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.ruby"
+ }
+ },
+ "contentName": "source.lua",
+ "end": "\\s*\\2$\\n?",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.ruby"
+ }
+ },
+ "name": "string.unquoted.heredoc.ruby",
+ "patterns": [
+ {
+ "include": "#heredoc"
+ },
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "include": "source.lua"
+ },
+ {
+ "include": "#escaped_char"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "begin": "(?=(?><<[-~](\"?)((?:[_\\w]+_|)RUBY)\\b\\1))",
+ "comment": "Heredoc with embedded ruby",
+ "end": "(?!\\G)",
+ "name": "meta.embedded.block.ruby",
+ "patterns": [
+ {
+ "begin": "(?><<[-~](\"?)((?:[_\\w]+_|)RUBY)\\b\\1)",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.ruby"
+ }
+ },
+ "contentName": "source.ruby",
+ "end": "\\s*\\2$\\n?",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.ruby"
+ }
+ },
+ "name": "string.unquoted.heredoc.ruby",
+ "patterns": [
+ {
+ "include": "#heredoc"
+ },
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "include": "source.ruby"
+ },
+ {
+ "include": "#escaped_char"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "begin": "(?>=\\s*<<(\\w+))",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.ruby"
+ }
+ },
+ "end": "^\\1$",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.ruby"
+ }
+ },
+ "name": "string.unquoted.heredoc.ruby",
+ "patterns": [
+ {
+ "include": "#heredoc"
+ },
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "include": "#escaped_char"
+ }
+ ]
+ },
+ {
+ "begin": "(?><<[-~](\\w+))",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.ruby"
+ }
+ },
+ "comment": "heredoc with indented terminator",
+ "end": "\\s*\\1$",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.ruby"
+ }
+ },
+ "name": "string.unquoted.heredoc.ruby",
+ "patterns": [
+ {
+ "include": "#heredoc"
+ },
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "include": "#escaped_char"
+ }
+ ]
+ },
+ {
+ "begin": "(?<=\\{|do|\\{\\s|do\\s)(\\|)",
+ "captures": {
+ "1": {
+ "name": "punctuation.separator.arguments.ruby"
+ }
+ },
+ "end": "(?",
+ "name": "punctuation.separator.key-value"
+ },
+ {
+ "match": "->",
+ "name": "support.function.kernel.lambda.ruby"
+ },
+ {
+ "match": "<<=|%=|&{1,2}=|\\*=|\\*\\*=|\\+=|-=|\\^=|\\|{1,2}=|<<",
+ "name": "keyword.operator.assignment.augmented.ruby"
+ },
+ {
+ "match": "<=>|<(?!<|=)|>(?!<|=|>)|<=|>=|===|==|=~|!=|!~|(?<=[ \\t])\\?",
+ "name": "keyword.operator.comparison.ruby"
+ },
+ {
+ "match": "(?>",
+ "name": "keyword.operator.other.ruby"
+ },
+ {
+ "match": ";",
+ "name": "punctuation.separator.statement.ruby"
+ },
+ {
+ "match": ",",
+ "name": "punctuation.separator.object.ruby"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.separator.namespace.ruby"
+ }
+ },
+ "comment": "Mark as namespace separator if double colons followed by capital letter",
+ "match": "(::)\\s*(?=[A-Z])"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.separator.method.ruby"
+ }
+ },
+ "comment": "Mark as method separator if double colons not followed by capital letter",
+ "match": "(\\.|::)\\s*(?![A-Z])"
+ },
+ {
+ "comment": "Must come after method and constant separators to prefer double colons",
+ "match": ":",
+ "name": "punctuation.separator.other.ruby"
+ },
+ {
+ "match": "\\{",
+ "name": "punctuation.section.scope.begin.ruby"
+ },
+ {
+ "match": "\\}",
+ "name": "punctuation.section.scope.end.ruby"
+ },
+ {
+ "match": "\\[",
+ "name": "punctuation.section.array.begin.ruby"
+ },
+ {
+ "match": "\\]",
+ "name": "punctuation.section.array.end.ruby"
+ },
+ {
+ "match": "\\(|\\)",
+ "name": "punctuation.section.function.ruby"
+ }
+ ],
+ "repository": {
+ "escaped_char": {
+ "match": "\\\\(?:[0-7]{1,3}|x[\\da-fA-F]{1,2}|.)",
+ "name": "constant.character.escape.ruby"
+ },
+ "heredoc": {
+ "begin": "^<<[-~]?\\w+",
+ "end": "$",
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ "interpolated_ruby": {
+ "patterns": [
+ {
+ "begin": "#\\{",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.begin.ruby"
+ }
+ },
+ "contentName": "source.ruby",
+ "end": "(\\})",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.end.ruby"
+ },
+ "1": {
+ "name": "source.ruby"
+ }
+ },
+ "name": "meta.embedded.line.ruby",
+ "patterns": [
+ {
+ "include": "#nest_curly_and_self"
+ },
+ {
+ "include": "$self"
+ }
+ ],
+ "repository": {
+ "nest_curly_and_self": {
+ "patterns": [
+ {
+ "begin": "\\{",
+ "captures": {
+ "0": {
+ "name": "punctuation.section.scope.ruby"
+ }
+ },
+ "end": "\\}",
+ "patterns": [
+ {
+ "include": "#nest_curly_and_self"
+ }
+ ]
+ },
+ {
+ "include": "$self"
+ }
+ ]
+ }
+ }
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.variable.ruby"
+ }
+ },
+ "match": "(#@)[a-zA-Z_]\\w*",
+ "name": "variable.other.readwrite.instance.ruby"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.variable.ruby"
+ }
+ },
+ "match": "(#@@)[a-zA-Z_]\\w*",
+ "name": "variable.other.readwrite.class.ruby"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.variable.ruby"
+ }
+ },
+ "match": "(#\\$)[a-zA-Z_]\\w*",
+ "name": "variable.other.readwrite.global.ruby"
+ }
+ ]
+ },
+ "percent_literals": {
+ "patterns": [
+ {
+ "begin": "%i(?:([(\\[{<])|([^\\w\\s]|_))",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.array.begin.ruby"
+ }
+ },
+ "end": "[)\\]}>]\\2|\\1\\2",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.array.end.ruby"
+ }
+ },
+ "name": "meta.array.symbol.ruby",
+ "patterns": [
+ {
+ "begin": "\\G(?<=\\()(?!\\))",
+ "end": "(?=\\))",
+ "patterns": [
+ {
+ "include": "#parens"
+ },
+ {
+ "include": "#symbol"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=\\[)(?!\\])",
+ "end": "(?=\\])",
+ "patterns": [
+ {
+ "include": "#brackets"
+ },
+ {
+ "include": "#symbol"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=\\{)(?!\\})",
+ "end": "(?=\\})",
+ "patterns": [
+ {
+ "include": "#braces"
+ },
+ {
+ "include": "#symbol"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=<)(?!>)",
+ "end": "(?=>)",
+ "patterns": [
+ {
+ "include": "#angles"
+ },
+ {
+ "include": "#symbol"
+ }
+ ]
+ },
+ {
+ "include": "#symbol"
+ }
+ ],
+ "repository": {
+ "angles": {
+ "patterns": [
+ {
+ "captures": {
+ "0": {
+ "name": "constant.character.escape.ruby"
+ }
+ },
+ "match": "\\\\<|\\\\>",
+ "name": "constant.other.symbol.ruby"
+ },
+ {
+ "begin": "<",
+ "captures": {
+ "0": {
+ "name": "constant.other.symbol.ruby"
+ }
+ },
+ "end": ">",
+ "patterns": [
+ {
+ "include": "#angles"
+ },
+ {
+ "include": "#symbol"
+ }
+ ]
+ }
+ ]
+ },
+ "braces": {
+ "patterns": [
+ {
+ "captures": {
+ "0": {
+ "name": "constant.character.escape.ruby"
+ }
+ },
+ "match": "\\\\\\{|\\\\\\}",
+ "name": "constant.other.symbol.ruby"
+ },
+ {
+ "begin": "\\{",
+ "captures": {
+ "0": {
+ "name": "constant.other.symbol.ruby"
+ }
+ },
+ "end": "\\}",
+ "patterns": [
+ {
+ "include": "#braces"
+ },
+ {
+ "include": "#symbol"
+ }
+ ]
+ }
+ ]
+ },
+ "brackets": {
+ "patterns": [
+ {
+ "captures": {
+ "0": {
+ "name": "constant.character.escape.ruby"
+ }
+ },
+ "match": "\\\\\\[|\\\\\\]",
+ "name": "constant.other.symbol.ruby"
+ },
+ {
+ "begin": "\\[",
+ "captures": {
+ "0": {
+ "name": "constant.other.symbol.ruby"
+ }
+ },
+ "end": "\\]",
+ "patterns": [
+ {
+ "include": "#brackets"
+ },
+ {
+ "include": "#symbol"
+ }
+ ]
+ }
+ ]
+ },
+ "parens": {
+ "patterns": [
+ {
+ "captures": {
+ "0": {
+ "name": "constant.character.escape.ruby"
+ }
+ },
+ "match": "\\\\\\(|\\\\\\)",
+ "name": "constant.other.symbol.ruby"
+ },
+ {
+ "begin": "\\(",
+ "captures": {
+ "0": {
+ "name": "constant.other.symbol.ruby"
+ }
+ },
+ "end": "\\)",
+ "patterns": [
+ {
+ "include": "#parens"
+ },
+ {
+ "include": "#symbol"
+ }
+ ]
+ }
+ ]
+ },
+ "symbol": {
+ "patterns": [
+ {
+ "captures": {
+ "0": {
+ "name": "constant.character.escape.ruby"
+ }
+ },
+ "match": "\\\\\\\\|\\\\[ ]",
+ "name": "constant.other.symbol.ruby"
+ },
+ {
+ "match": "\\S\\w*",
+ "name": "constant.other.symbol.ruby"
+ }
+ ]
+ }
+ }
+ },
+ {
+ "begin": "%I(?:([(\\[{<])|([^\\w\\s]|_))",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.array.begin.ruby"
+ }
+ },
+ "end": "[)\\]}>]\\2|\\1\\2",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.array.end.ruby"
+ }
+ },
+ "name": "meta.array.symbol.interpolated.ruby",
+ "patterns": [
+ {
+ "begin": "\\G(?<=\\()(?!\\))",
+ "end": "(?=\\))",
+ "patterns": [
+ {
+ "include": "#parens"
+ },
+ {
+ "include": "#symbol"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=\\[)(?!\\])",
+ "end": "(?=\\])",
+ "patterns": [
+ {
+ "include": "#brackets"
+ },
+ {
+ "include": "#symbol"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=\\{)(?!\\})",
+ "end": "(?=\\})",
+ "patterns": [
+ {
+ "include": "#braces"
+ },
+ {
+ "include": "#symbol"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=<)(?!>)",
+ "end": "(?=>)",
+ "patterns": [
+ {
+ "include": "#angles"
+ },
+ {
+ "include": "#symbol"
+ }
+ ]
+ },
+ {
+ "include": "#symbol"
+ }
+ ],
+ "repository": {
+ "angles": {
+ "patterns": [
+ {
+ "begin": "<",
+ "captures": {
+ "0": {
+ "name": "constant.other.symbol.ruby"
+ }
+ },
+ "end": ">",
+ "patterns": [
+ {
+ "include": "#angles"
+ },
+ {
+ "include": "#symbol"
+ }
+ ]
+ }
+ ]
+ },
+ "braces": {
+ "patterns": [
+ {
+ "begin": "\\{",
+ "captures": {
+ "0": {
+ "name": "constant.other.symbol.ruby"
+ }
+ },
+ "end": "\\}",
+ "patterns": [
+ {
+ "include": "#braces"
+ },
+ {
+ "include": "#symbol"
+ }
+ ]
+ }
+ ]
+ },
+ "brackets": {
+ "patterns": [
+ {
+ "begin": "\\[",
+ "captures": {
+ "0": {
+ "name": "constant.other.symbol.ruby"
+ }
+ },
+ "end": "\\]",
+ "patterns": [
+ {
+ "include": "#brackets"
+ },
+ {
+ "include": "#symbol"
+ }
+ ]
+ }
+ ]
+ },
+ "parens": {
+ "patterns": [
+ {
+ "begin": "\\(",
+ "captures": {
+ "0": {
+ "name": "constant.other.symbol.ruby"
+ }
+ },
+ "end": "\\)",
+ "patterns": [
+ {
+ "include": "#parens"
+ },
+ {
+ "include": "#symbol"
+ }
+ ]
+ }
+ ]
+ },
+ "symbol": {
+ "patterns": [
+ {
+ "begin": "(?=\\\\|#\\{)",
+ "end": "(?!\\G)",
+ "name": "constant.other.symbol.ruby",
+ "patterns": [
+ {
+ "include": "#escaped_char"
+ },
+ {
+ "include": "#interpolated_ruby"
+ }
+ ]
+ },
+ {
+ "match": "\\S\\w*",
+ "name": "constant.other.symbol.ruby"
+ }
+ ]
+ }
+ }
+ },
+ {
+ "begin": "%q(?:([(\\[{<])|([^\\w\\s]|_))",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.ruby"
+ }
+ },
+ "end": "[)\\]}>]\\2|\\1\\2",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.ruby"
+ }
+ },
+ "name": "string.quoted.other.ruby",
+ "patterns": [
+ {
+ "begin": "\\G(?<=\\()(?!\\))",
+ "end": "(?=\\))",
+ "patterns": [
+ {
+ "include": "#parens"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=\\[)(?!\\])",
+ "end": "(?=\\])",
+ "patterns": [
+ {
+ "include": "#brackets"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=\\{)(?!\\})",
+ "end": "(?=\\})",
+ "patterns": [
+ {
+ "include": "#braces"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=<)(?!>)",
+ "end": "(?=>)",
+ "patterns": [
+ {
+ "include": "#angles"
+ }
+ ]
+ }
+ ],
+ "repository": {
+ "angles": {
+ "patterns": [
+ {
+ "match": "\\\\<|\\\\>|\\\\\\\\",
+ "name": "constant.character.escape.ruby"
+ },
+ {
+ "begin": "<",
+ "end": ">",
+ "patterns": [
+ {
+ "include": "#angles"
+ }
+ ]
+ }
+ ]
+ },
+ "braces": {
+ "patterns": [
+ {
+ "match": "\\\\\\{|\\\\\\}|\\\\\\\\",
+ "name": "constant.character.escape.ruby"
+ },
+ {
+ "begin": "\\{",
+ "end": "\\}",
+ "patterns": [
+ {
+ "include": "#braces"
+ }
+ ]
+ }
+ ]
+ },
+ "brackets": {
+ "patterns": [
+ {
+ "match": "\\\\\\[|\\\\\\]|\\\\\\\\",
+ "name": "constant.character.escape.ruby"
+ },
+ {
+ "begin": "\\[",
+ "end": "\\]",
+ "patterns": [
+ {
+ "include": "#brackets"
+ }
+ ]
+ }
+ ]
+ },
+ "parens": {
+ "patterns": [
+ {
+ "match": "\\\\\\(|\\\\\\)|\\\\\\\\",
+ "name": "constant.character.escape.ruby"
+ },
+ {
+ "begin": "\\(",
+ "end": "\\)",
+ "patterns": [
+ {
+ "include": "#parens"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ },
+ {
+ "begin": "%Q?(?:([(\\[{<])|([^\\w\\s=]|_))",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.ruby"
+ }
+ },
+ "end": "[)\\]}>]\\2|\\1\\2",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.ruby"
+ }
+ },
+ "name": "string.quoted.other.interpolated.ruby",
+ "patterns": [
+ {
+ "begin": "\\G(?<=\\()(?!\\))",
+ "end": "(?=\\))",
+ "patterns": [
+ {
+ "include": "#parens"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=\\[)(?!\\])",
+ "end": "(?=\\])",
+ "patterns": [
+ {
+ "include": "#brackets"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=\\{)(?!\\})",
+ "end": "(?=\\})",
+ "patterns": [
+ {
+ "include": "#braces"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=<)(?!>)",
+ "end": "(?=>)",
+ "patterns": [
+ {
+ "include": "#angles"
+ }
+ ]
+ },
+ {
+ "include": "#escaped_char"
+ },
+ {
+ "include": "#interpolated_ruby"
+ }
+ ],
+ "repository": {
+ "angles": {
+ "patterns": [
+ {
+ "include": "#escaped_char"
+ },
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "begin": "<",
+ "end": ">",
+ "patterns": [
+ {
+ "include": "#angles"
+ }
+ ]
+ }
+ ]
+ },
+ "braces": {
+ "patterns": [
+ {
+ "include": "#escaped_char"
+ },
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "begin": "\\{",
+ "end": "\\}",
+ "patterns": [
+ {
+ "include": "#braces"
+ }
+ ]
+ }
+ ]
+ },
+ "brackets": {
+ "patterns": [
+ {
+ "include": "#escaped_char"
+ },
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "begin": "\\[",
+ "end": "\\]",
+ "patterns": [
+ {
+ "include": "#brackets"
+ }
+ ]
+ }
+ ]
+ },
+ "parens": {
+ "patterns": [
+ {
+ "include": "#escaped_char"
+ },
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "begin": "\\(",
+ "end": "\\)",
+ "patterns": [
+ {
+ "include": "#parens"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ },
+ {
+ "begin": "%r(?:([(\\[{<])|([^\\w\\s]|_))",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.ruby"
+ }
+ },
+ "end": "([)\\]}>]\\2|\\1\\2)[eimnosux]*",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.ruby"
+ }
+ },
+ "name": "string.regexp.percent.ruby",
+ "patterns": [
+ {
+ "begin": "\\G(?<=\\()(?!\\))",
+ "end": "(?=\\))",
+ "patterns": [
+ {
+ "include": "#parens"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=\\[)(?!\\])",
+ "end": "(?=\\])",
+ "patterns": [
+ {
+ "include": "#brackets"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=\\{)(?!\\})",
+ "end": "(?=\\})",
+ "patterns": [
+ {
+ "include": "#braces"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=<)(?!>)",
+ "end": "(?=>)",
+ "patterns": [
+ {
+ "include": "#angles"
+ }
+ ]
+ },
+ {
+ "include": "#regex_sub"
+ }
+ ],
+ "repository": {
+ "angles": {
+ "patterns": [
+ {
+ "include": "#regex_sub"
+ },
+ {
+ "begin": "<",
+ "end": ">",
+ "patterns": [
+ {
+ "include": "#angles"
+ }
+ ]
+ }
+ ]
+ },
+ "braces": {
+ "patterns": [
+ {
+ "include": "#regex_sub"
+ },
+ {
+ "begin": "\\{",
+ "end": "\\}",
+ "patterns": [
+ {
+ "include": "#braces"
+ }
+ ]
+ }
+ ]
+ },
+ "brackets": {
+ "patterns": [
+ {
+ "include": "#regex_sub"
+ },
+ {
+ "begin": "\\[",
+ "end": "\\]",
+ "patterns": [
+ {
+ "include": "#brackets"
+ }
+ ]
+ }
+ ]
+ },
+ "parens": {
+ "patterns": [
+ {
+ "include": "#regex_sub"
+ },
+ {
+ "begin": "\\(",
+ "end": "\\)",
+ "patterns": [
+ {
+ "include": "#parens"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ },
+ {
+ "begin": "%s(?:([(\\[{<])|([^\\w\\s]|_))",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.constant.begin.ruby"
+ }
+ },
+ "end": "[)\\]}>]\\2|\\1\\2",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.constant.end.ruby"
+ }
+ },
+ "name": "constant.other.symbol.percent.ruby",
+ "patterns": [
+ {
+ "begin": "\\G(?<=\\()(?!\\))",
+ "end": "(?=\\))",
+ "patterns": [
+ {
+ "include": "#parens"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=\\[)(?!\\])",
+ "end": "(?=\\])",
+ "patterns": [
+ {
+ "include": "#brackets"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=\\{)(?!\\})",
+ "end": "(?=\\})",
+ "patterns": [
+ {
+ "include": "#braces"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=<)(?!>)",
+ "end": "(?=>)",
+ "patterns": [
+ {
+ "include": "#angles"
+ }
+ ]
+ }
+ ],
+ "repository": {
+ "angles": {
+ "patterns": [
+ {
+ "match": "\\\\<|\\\\>|\\\\\\\\",
+ "name": "constant.character.escape.ruby"
+ },
+ {
+ "begin": "<",
+ "end": ">",
+ "patterns": [
+ {
+ "include": "#angles"
+ }
+ ]
+ }
+ ]
+ },
+ "braces": {
+ "patterns": [
+ {
+ "match": "\\\\\\{|\\\\\\}|\\\\\\\\",
+ "name": "constant.character.escape.ruby"
+ },
+ {
+ "begin": "\\{",
+ "end": "\\}",
+ "patterns": [
+ {
+ "include": "#braces"
+ }
+ ]
+ }
+ ]
+ },
+ "brackets": {
+ "patterns": [
+ {
+ "match": "\\\\\\[|\\\\\\]|\\\\\\\\",
+ "name": "constant.character.escape.ruby"
+ },
+ {
+ "begin": "\\[",
+ "end": "\\]",
+ "patterns": [
+ {
+ "include": "#brackets"
+ }
+ ]
+ }
+ ]
+ },
+ "parens": {
+ "patterns": [
+ {
+ "match": "\\\\\\(|\\\\\\)|\\\\\\\\",
+ "name": "constant.character.escape.ruby"
+ },
+ {
+ "begin": "\\(",
+ "end": "\\)",
+ "patterns": [
+ {
+ "include": "#parens"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ },
+ {
+ "begin": "%w(?:([(\\[{<])|([^\\w\\s]|_))",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.array.begin.ruby"
+ }
+ },
+ "end": "[)\\]}>]\\2|\\1\\2",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.array.end.ruby"
+ }
+ },
+ "name": "meta.array.string.ruby",
+ "patterns": [
+ {
+ "begin": "\\G(?<=\\()(?!\\))",
+ "end": "(?=\\))",
+ "patterns": [
+ {
+ "include": "#parens"
+ },
+ {
+ "include": "#string"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=\\[)(?!\\])",
+ "end": "(?=\\])",
+ "patterns": [
+ {
+ "include": "#brackets"
+ },
+ {
+ "include": "#string"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=\\{)(?!\\})",
+ "end": "(?=\\})",
+ "patterns": [
+ {
+ "include": "#braces"
+ },
+ {
+ "include": "#string"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=<)(?!>)",
+ "end": "(?=>)",
+ "patterns": [
+ {
+ "include": "#angles"
+ },
+ {
+ "include": "#string"
+ }
+ ]
+ },
+ {
+ "include": "#string"
+ }
+ ],
+ "repository": {
+ "angles": {
+ "patterns": [
+ {
+ "captures": {
+ "0": {
+ "name": "constant.character.escape.ruby"
+ }
+ },
+ "match": "\\\\<|\\\\>",
+ "name": "string.other.ruby"
+ },
+ {
+ "begin": "<",
+ "captures": {
+ "0": {
+ "name": "string.other.ruby"
+ }
+ },
+ "end": ">",
+ "patterns": [
+ {
+ "include": "#angles"
+ },
+ {
+ "include": "#string"
+ }
+ ]
+ }
+ ]
+ },
+ "braces": {
+ "patterns": [
+ {
+ "captures": {
+ "0": {
+ "name": "constant.character.escape.ruby"
+ }
+ },
+ "match": "\\\\\\{|\\\\\\}",
+ "name": "string.other.ruby"
+ },
+ {
+ "begin": "\\{",
+ "captures": {
+ "0": {
+ "name": "string.other.ruby"
+ }
+ },
+ "end": "\\}",
+ "patterns": [
+ {
+ "include": "#braces"
+ },
+ {
+ "include": "#string"
+ }
+ ]
+ }
+ ]
+ },
+ "brackets": {
+ "patterns": [
+ {
+ "captures": {
+ "0": {
+ "name": "constant.character.escape.ruby"
+ }
+ },
+ "match": "\\\\\\[|\\\\\\]",
+ "name": "string.other.ruby"
+ },
+ {
+ "begin": "\\[",
+ "captures": {
+ "0": {
+ "name": "string.other.ruby"
+ }
+ },
+ "end": "\\]",
+ "patterns": [
+ {
+ "include": "#brackets"
+ },
+ {
+ "include": "#string"
+ }
+ ]
+ }
+ ]
+ },
+ "parens": {
+ "patterns": [
+ {
+ "captures": {
+ "0": {
+ "name": "constant.character.escape.ruby"
+ }
+ },
+ "match": "\\\\\\(|\\\\\\)",
+ "name": "string.other.ruby"
+ },
+ {
+ "begin": "\\(",
+ "captures": {
+ "0": {
+ "name": "string.other.ruby"
+ }
+ },
+ "end": "\\)",
+ "patterns": [
+ {
+ "include": "#parens"
+ },
+ {
+ "include": "#string"
+ }
+ ]
+ }
+ ]
+ },
+ "string": {
+ "patterns": [
+ {
+ "captures": {
+ "0": {
+ "name": "constant.character.escape.ruby"
+ }
+ },
+ "match": "\\\\\\\\|\\\\[ ]",
+ "name": "string.other.ruby"
+ },
+ {
+ "match": "\\S\\w*",
+ "name": "string.other.ruby"
+ }
+ ]
+ }
+ }
+ },
+ {
+ "begin": "%W(?:([(\\[{<])|([^\\w\\s]|_))",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.array.begin.ruby"
+ }
+ },
+ "end": "[)\\]}>]\\2|\\1\\2",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.array.end.ruby"
+ }
+ },
+ "name": "meta.array.string.interpolated.ruby",
+ "patterns": [
+ {
+ "begin": "\\G(?<=\\()(?!\\))",
+ "end": "(?=\\))",
+ "patterns": [
+ {
+ "include": "#parens"
+ },
+ {
+ "include": "#string"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=\\[)(?!\\])",
+ "end": "(?=\\])",
+ "patterns": [
+ {
+ "include": "#brackets"
+ },
+ {
+ "include": "#string"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=\\{)(?!\\})",
+ "end": "(?=\\})",
+ "patterns": [
+ {
+ "include": "#braces"
+ },
+ {
+ "include": "#string"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=<)(?!>)",
+ "end": "(?=>)",
+ "patterns": [
+ {
+ "include": "#angles"
+ },
+ {
+ "include": "#string"
+ }
+ ]
+ },
+ {
+ "include": "#string"
+ }
+ ],
+ "repository": {
+ "angles": {
+ "patterns": [
+ {
+ "begin": "<",
+ "captures": {
+ "0": {
+ "name": "string.other.ruby"
+ }
+ },
+ "end": ">",
+ "patterns": [
+ {
+ "include": "#angles"
+ },
+ {
+ "include": "#string"
+ }
+ ]
+ }
+ ]
+ },
+ "braces": {
+ "patterns": [
+ {
+ "begin": "\\{",
+ "captures": {
+ "0": {
+ "name": "string.other.ruby"
+ }
+ },
+ "end": "\\}",
+ "patterns": [
+ {
+ "include": "#braces"
+ },
+ {
+ "include": "#string"
+ }
+ ]
+ }
+ ]
+ },
+ "brackets": {
+ "patterns": [
+ {
+ "begin": "\\[",
+ "captures": {
+ "0": {
+ "name": "string.other.ruby"
+ }
+ },
+ "end": "\\]",
+ "patterns": [
+ {
+ "include": "#brackets"
+ },
+ {
+ "include": "#string"
+ }
+ ]
+ }
+ ]
+ },
+ "parens": {
+ "patterns": [
+ {
+ "begin": "\\(",
+ "captures": {
+ "0": {
+ "name": "string.other.ruby"
+ }
+ },
+ "end": "\\)",
+ "patterns": [
+ {
+ "include": "#parens"
+ },
+ {
+ "include": "#string"
+ }
+ ]
+ }
+ ]
+ },
+ "string": {
+ "patterns": [
+ {
+ "begin": "(?=\\\\|#\\{)",
+ "end": "(?!\\G)",
+ "name": "string.other.ruby",
+ "patterns": [
+ {
+ "include": "#escaped_char"
+ },
+ {
+ "include": "#interpolated_ruby"
+ }
+ ]
+ },
+ {
+ "match": "\\S\\w*",
+ "name": "string.other.ruby"
+ }
+ ]
+ }
+ }
+ },
+ {
+ "begin": "%x(?:([(\\[{<])|([^\\w\\s]|_))",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.ruby"
+ }
+ },
+ "end": "[)\\]}>]\\2|\\1\\2",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.ruby"
+ }
+ },
+ "name": "string.interpolated.percent.ruby",
+ "patterns": [
+ {
+ "begin": "\\G(?<=\\()(?!\\))",
+ "end": "(?=\\))",
+ "patterns": [
+ {
+ "include": "#parens"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=\\[)(?!\\])",
+ "end": "(?=\\])",
+ "patterns": [
+ {
+ "include": "#brackets"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=\\{)(?!\\})",
+ "end": "(?=\\})",
+ "patterns": [
+ {
+ "include": "#braces"
+ }
+ ]
+ },
+ {
+ "begin": "\\G(?<=<)(?!>)",
+ "end": "(?=>)",
+ "patterns": [
+ {
+ "include": "#angles"
+ }
+ ]
+ },
+ {
+ "include": "#escaped_char"
+ },
+ {
+ "include": "#interpolated_ruby"
+ }
+ ],
+ "repository": {
+ "angles": {
+ "patterns": [
+ {
+ "include": "#escaped_char"
+ },
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "begin": "<",
+ "end": ">",
+ "patterns": [
+ {
+ "include": "#angles"
+ }
+ ]
+ }
+ ]
+ },
+ "braces": {
+ "patterns": [
+ {
+ "include": "#escaped_char"
+ },
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "begin": "\\{",
+ "end": "\\}",
+ "patterns": [
+ {
+ "include": "#braces"
+ }
+ ]
+ }
+ ]
+ },
+ "brackets": {
+ "patterns": [
+ {
+ "include": "#escaped_char"
+ },
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "begin": "\\[",
+ "end": "\\]",
+ "patterns": [
+ {
+ "include": "#brackets"
+ }
+ ]
+ }
+ ]
+ },
+ "parens": {
+ "patterns": [
+ {
+ "include": "#escaped_char"
+ },
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "begin": "\\(",
+ "end": "\\)",
+ "patterns": [
+ {
+ "include": "#parens"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ }
+ ]
+ },
+ "regex_sub": {
+ "patterns": [
+ {
+ "include": "#interpolated_ruby"
+ },
+ {
+ "include": "#escaped_char"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.quantifier.begin.ruby"
+ },
+ "3": {
+ "name": "punctuation.definition.quantifier.end.ruby"
+ }
+ },
+ "match": "(\\{)\\d+(,\\d+)?(\\})",
+ "name": "keyword.operator.quantifier.ruby"
+ },
+ {
+ "begin": "\\[\\^?",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.character-class.begin.ruby"
+ }
+ },
+ "end": "\\]",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.character-class.end.ruby"
+ }
+ },
+ "name": "constant.other.character-class.set.ruby",
+ "patterns": [
+ {
+ "include": "#escaped_char"
+ }
+ ]
+ },
+ {
+ "begin": "\\(\\?#",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.comment.begin.ruby"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.comment.end.ruby"
+ }
+ },
+ "name": "comment.line.number-sign.ruby",
+ "patterns": [
+ {
+ "include": "#escaped_char"
+ }
+ ]
+ },
+ {
+ "begin": "\\(",
+ "captures": {
+ "0": {
+ "name": "punctuation.definition.group.ruby"
+ }
+ },
+ "end": "\\)",
+ "name": "meta.group.regexp.ruby",
+ "patterns": [
+ {
+ "include": "#regex_sub"
+ }
+ ]
+ },
+ {
+ "begin": "(?<=^|\\s)(#)\\s(?=[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.comment.ruby"
+ }
+ },
+ "comment":
+ "We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.",
+ "end": "$\\n?",
+ "name": "comment.line.number-sign.ruby"
+ }
+ ]
+ }
+ }
+}
diff --git a/extensions/rust/syntaxes/rust.tmLanguage.json b/extensions/rust/syntaxes/rust.tmLanguage.json
new file mode 100755
index 0000000000..dffdbaab5a
--- /dev/null
+++ b/extensions/rust/syntaxes/rust.tmLanguage.json
@@ -0,0 +1,662 @@
+{
+ "information_for_contributors": [
+ "This file has been converted from https://github.com/zargony/atom-language-rust/blob/master/grammars/rust.cson",
+ "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/zargony/atom-language-rust/commit/179f449a69182cae4fcdf644d59d842b7e445f89",
+ "name": "Rust",
+ "scopeName": "source.rust",
+ "patterns": [
+ {
+ "comment": "Implementation",
+ "begin": "\\b(impl)\\b",
+ "end": "\\{",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.type.rust"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#block_comment"
+ },
+ {
+ "include": "#line_comment"
+ },
+ {
+ "include": "#sigils"
+ },
+ {
+ "include": "#mut"
+ },
+ {
+ "include": "#ref_lifetime"
+ },
+ {
+ "include": "#core_types"
+ },
+ {
+ "include": "#core_marker"
+ },
+ {
+ "include": "#core_traits"
+ },
+ {
+ "include": "#std_types"
+ },
+ {
+ "include": "#std_traits"
+ },
+ {
+ "include": "#type_params"
+ },
+ {
+ "include": "#where"
+ },
+ {
+ "name": "storage.type.rust",
+ "match": "\\bfor\\b"
+ },
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ {
+ "include": "#block_doc_comment"
+ },
+ {
+ "include": "#block_comment"
+ },
+ {
+ "include": "#line_doc_comment"
+ },
+ {
+ "include": "#line_comment"
+ },
+ {
+ "comment": "Attribute",
+ "name": "meta.attribute.rust",
+ "begin": "#\\!?\\[",
+ "end": "\\]",
+ "patterns": [
+ {
+ "include": "#string_literal"
+ },
+ {
+ "include": "#block_doc_comment"
+ },
+ {
+ "include": "#block_comment"
+ },
+ {
+ "include": "#line_doc_comment"
+ },
+ {
+ "include": "#line_comment"
+ }
+ ]
+ },
+ {
+ "comment": "Single-quote string literal (character)",
+ "name": "string.quoted.single.rust",
+ "match":
+ "b?'([^'\\\\]|\\\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.))'"
+ },
+ {
+ "include": "#string_literal"
+ },
+ {
+ "include": "#raw_string_literal"
+ },
+ {
+ "comment": "Floating point literal (fraction)",
+ "name": "constant.numeric.float.rust",
+ "match": "\\b[0-9][0-9_]*\\.[0-9][0-9_]*([eE][+-]?[0-9_]+)?(f32|f64)?\\b"
+ },
+ {
+ "comment": "Floating point literal (exponent)",
+ "name": "constant.numeric.float.rust",
+ "match": "\\b[0-9][0-9_]*(\\.[0-9][0-9_]*)?[eE][+-]?[0-9_]+(f32|f64)?\\b"
+ },
+ {
+ "comment": "Floating point literal (typed)",
+ "name": "constant.numeric.float.rust",
+ "match": "\\b[0-9][0-9_]*(\\.[0-9][0-9_]*)?([eE][+-]?[0-9_]+)?(f32|f64)\\b"
+ },
+ {
+ "comment": "Integer literal (decimal)",
+ "name": "constant.numeric.integer.decimal.rust",
+ "match": "\\b[0-9][0-9_]*([ui](8|16|32|64|128|s|size))?\\b"
+ },
+ {
+ "comment": "Integer literal (hexadecimal)",
+ "name": "constant.numeric.integer.hexadecimal.rust",
+ "match": "\\b0x[a-fA-F0-9_]+([ui](8|16|32|64|128|s|size))?\\b"
+ },
+ {
+ "comment": "Integer literal (octal)",
+ "name": "constant.numeric.integer.octal.rust",
+ "match": "\\b0o[0-7_]+([ui](8|16|32|64|128|s|size))?\\b"
+ },
+ {
+ "comment": "Integer literal (binary)",
+ "name": "constant.numeric.integer.binary.rust",
+ "match": "\\b0b[01_]+([ui](8|16|32|64|128|s|size))?\\b"
+ },
+ {
+ "comment": "Static storage modifier",
+ "name": "storage.modifier.static.rust",
+ "match": "\\bstatic\\b"
+ },
+ {
+ "comment": "Boolean constant",
+ "name": "constant.language.boolean.rust",
+ "match": "\\b(true|false)\\b"
+ },
+ {
+ "comment": "Control keyword",
+ "name": "keyword.control.rust",
+ "match": "\\b(break|continue|else|if|in|for|loop|match|return|while)\\b"
+ },
+ {
+ "comment": "Keyword",
+ "name": "keyword.other.rust",
+ "match": "\\b(crate|extern|mod|let|ref|use|super|move)\\b"
+ },
+ {
+ "comment": "Reserved keyword",
+ "name": "invalid.deprecated.rust",
+ "match":
+ "\\b(abstract|alignof|become|do|final|macro|offsetof|override|priv|proc|pure|sizeof|typeof|virtual|yield)\\b"
+ },
+ {
+ "include": "#unsafe"
+ },
+ {
+ "include": "#sigils"
+ },
+ {
+ "include": "#self"
+ },
+ {
+ "include": "#mut"
+ },
+ {
+ "include": "#box"
+ },
+ {
+ "include": "#lifetime"
+ },
+ {
+ "include": "#ref_lifetime"
+ },
+ {
+ "include": "#const"
+ },
+ {
+ "include": "#pub"
+ },
+ {
+ "comment": "Miscellaneous operator",
+ "name": "keyword.operator.misc.rust",
+ "match": "(=>|::|\\bas\\b)"
+ },
+ {
+ "comment": "Comparison operator",
+ "name": "keyword.operator.comparison.rust",
+ "match": "(&&|\\|\\||==|!=)"
+ },
+ {
+ "comment": "Assignment operator",
+ "name": "keyword.operator.assignment.rust",
+ "match": "(\\+=|-=|/=|\\*=|%=|\\^=|&=|\\|=|<<=|>>=|=)"
+ },
+ {
+ "comment": "Arithmetic operator",
+ "name": "keyword.operator.arithmetic.rust",
+ "match": "(!|\\+|-|/|\\*|%|\\^|&|\\||<<|>>)"
+ },
+ {
+ "comment": "Comparison operator (second group because of regex precedence)",
+ "name": "keyword.operator.comparison.rust",
+ "match": "(<=|>=|<|>)"
+ },
+ {
+ "include": "#core_types"
+ },
+ {
+ "include": "#core_vars"
+ },
+ {
+ "include": "#core_marker"
+ },
+ {
+ "include": "#core_traits"
+ },
+ {
+ "include": "#std_types"
+ },
+ {
+ "include": "#std_traits"
+ },
+ {
+ "comment": "Built-in macro",
+ "name": "support.function.builtin.rust",
+ "match":
+ "\\b(macro_rules|compile_error|format_args|env|option_env|concat_idents|concat|line|column|file|stringify|include|include_str|include_bytes|module_path|cfg)!"
+ },
+ {
+ "comment": "Core macro",
+ "name": "support.function.core.rust",
+ "match":
+ "\\b(panic|assert|assert_eq|assert_ne|debug_assert|debug_assert_eq|debug_assert_ne|try|write|writeln|unreachable|unimplemented)!"
+ },
+ {
+ "comment": "Standard library macro",
+ "name": "support.function.std.rust",
+ "match": "\\b(format|print|println|eprint|eprintln|select|vec)!"
+ },
+ {
+ "comment": "Logging macro",
+ "name": "support.function.log.rust",
+ "match": "\\b(log|error|warn|info|debug|trace|log_enabled)!"
+ },
+ {
+ "comment": "Invokation of a macro",
+ "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*\\!)\\s*[({\\[]",
+ "captures": {
+ "1": {
+ "name": "entity.name.function.macro.rust"
+ }
+ }
+ },
+ {
+ "comment": "Function call",
+ "match": "\\b([A-Za-z][A-Za-z0-9_]*|_[A-Za-z0-9_]+)\\s*\\(",
+ "captures": {
+ "1": {
+ "name": "entity.name.function.rust"
+ }
+ }
+ },
+ {
+ "comment": "Function call with type parameters",
+ "begin": "\\b([A-Za-z][A-Za-z0-9_]*|_[A-Za-z0-9_]+)\\s*(::)(?=\\s*<.*>\\s*\\()",
+ "end": "\\(",
+ "captures": {
+ "1": {
+ "name": "entity.name.function.rust"
+ },
+ "2": {
+ "name": "keyword.operator.misc.rust"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#type_params"
+ }
+ ]
+ },
+ {
+ "comment": "Function definition",
+ "begin": "\\b(fn)\\s+([A-Za-z][A-Za-z0-9_]*|_[A-Za-z0-9_]+)",
+ "end": "[\\{;]",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.fn.rust"
+ },
+ "2": {
+ "name": "entity.name.function.rust"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#block_comment"
+ },
+ {
+ "include": "#line_comment"
+ },
+ {
+ "include": "#sigils"
+ },
+ {
+ "include": "#self"
+ },
+ {
+ "include": "#mut"
+ },
+ {
+ "include": "#ref_lifetime"
+ },
+ {
+ "include": "#core_types"
+ },
+ {
+ "include": "#core_marker"
+ },
+ {
+ "include": "#core_traits"
+ },
+ {
+ "include": "#std_types"
+ },
+ {
+ "include": "#std_traits"
+ },
+ {
+ "include": "#type_params"
+ },
+ {
+ "include": "#const"
+ },
+ {
+ "include": "#where"
+ },
+ {
+ "include": "#unsafe"
+ },
+ {
+ "comment": "Function arguments",
+ "match": "\bfn\b",
+ "name": "keyword.other.fn.rust"
+ }
+ ]
+ },
+ {
+ "comment": "Type declaration",
+ "begin": "\\b(enum|struct|trait|union)\\s+([a-zA-Z_][a-zA-Z0-9_]*)",
+ "end": "[\\{\\(;]",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.type.rust"
+ },
+ "2": {
+ "name": "entity.name.type.rust"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#block_comment"
+ },
+ {
+ "include": "#line_comment"
+ },
+ {
+ "include": "#core_traits"
+ },
+ {
+ "include": "#std_traits"
+ },
+ {
+ "include": "#type_params"
+ },
+ {
+ "include": "#core_types"
+ },
+ {
+ "include": "#pub"
+ },
+ {
+ "include": "#where"
+ }
+ ]
+ },
+ {
+ "comment": "Type alias",
+ "begin": "\\b(type)\\s+([a-zA-Z_][a-zA-Z0-9_]*)",
+ "end": ";",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.type.rust"
+ },
+ "2": {
+ "name": "entity.name.type.rust"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#block_comment"
+ },
+ {
+ "include": "#line_comment"
+ },
+ {
+ "include": "#sigils"
+ },
+ {
+ "include": "#mut"
+ },
+ {
+ "include": "#lifetime"
+ },
+ {
+ "include": "#ref_lifetime"
+ },
+ {
+ "include": "#core_types"
+ },
+ {
+ "include": "#core_marker"
+ },
+ {
+ "include": "#core_traits"
+ },
+ {
+ "include": "#std_types"
+ },
+ {
+ "include": "#std_traits"
+ },
+ {
+ "include": "#type_params"
+ }
+ ]
+ }
+ ],
+ "repository": {
+ "block_doc_comment": {
+ "comment": "Block documentation comment",
+ "name": "comment.block.documentation.rust",
+ "begin": "/\\*[\\*!](?![\\*/])",
+ "end": "\\*/",
+ "patterns": [
+ {
+ "include": "#block_doc_comment"
+ },
+ {
+ "include": "#block_comment"
+ }
+ ]
+ },
+ "block_comment": {
+ "comment": "Block comment",
+ "name": "comment.block.rust",
+ "begin": "/\\*",
+ "end": "\\*/",
+ "patterns": [
+ {
+ "include": "#block_doc_comment"
+ },
+ {
+ "include": "#block_comment"
+ }
+ ]
+ },
+ "line_doc_comment": {
+ "comment": "Single-line documentation comment",
+ "name": "comment.line.documentation.rust",
+ "begin": "//[!/](?=[^/])",
+ "end": "$"
+ },
+ "line_comment": {
+ "comment": "Single-line comment",
+ "name": "comment.line.double-slash.rust",
+ "begin": "//",
+ "end": "$"
+ },
+ "escaped_character": {
+ "name": "constant.character.escape.rust",
+ "match": "\\\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)"
+ },
+ "string_literal": {
+ "comment": "Double-quote string literal",
+ "name": "string.quoted.double.rust",
+ "begin": "b?\"",
+ "end": "\"",
+ "patterns": [
+ {
+ "include": "#escaped_character"
+ }
+ ]
+ },
+ "raw_string_literal": {
+ "comment": "Raw double-quote string literal",
+ "name": "string.quoted.double.raw.rust",
+ "begin": "b?r(#*)\"",
+ "end": "\"\\1"
+ },
+ "sigils": {
+ "comment": "Sigil",
+ "name": "keyword.operator.sigil.rust",
+ "match": "[&*](?=[a-zA-Z0-9_\\(\\[\\|\\\"]+)"
+ },
+ "self": {
+ "comment": "Self variable",
+ "name": "variable.language.rust",
+ "match": "\\bself\\b"
+ },
+ "mut": {
+ "comment": "Mutable storage modifier",
+ "name": "storage.modifier.mut.rust",
+ "match": "\\bmut\\b"
+ },
+ "box": {
+ "comment": "Box storage modifier",
+ "name": "storage.modifier.box.rust",
+ "match": "\\bbox\\b"
+ },
+ "const": {
+ "comment": "Const storage modifier",
+ "name": "storage.modifier.const.rust",
+ "match": "\\bconst\\b"
+ },
+ "pub": {
+ "comment": "Visibility modifier",
+ "name": "storage.modifier.visibility.rust",
+ "match": "\\bpub\\b"
+ },
+ "unsafe": {
+ "comment": "Unsafe code keyword",
+ "name": "keyword.other.unsafe.rust",
+ "match": "\\bunsafe\\b"
+ },
+ "where": {
+ "comment": "Generic where clause",
+ "name": "keyword.other.where.rust",
+ "match": "\\bwhere\\b"
+ },
+ "lifetime": {
+ "comment": "Named lifetime",
+ "name": "storage.modifier.lifetime.rust",
+ "match": "'([a-zA-Z_][a-zA-Z0-9_]*)\\b",
+ "captures": {
+ "1": {
+ "name": "entity.name.lifetime.rust"
+ }
+ }
+ },
+ "ref_lifetime": {
+ "comment": "Reference with named lifetime",
+ "match": "&('([a-zA-Z_][a-zA-Z0-9_]*))\\b",
+ "captures": {
+ "1": {
+ "name": "storage.modifier.lifetime.rust"
+ },
+ "2": {
+ "name": "entity.name.lifetime.rust"
+ }
+ }
+ },
+ "core_types": {
+ "comment": "Built-in/core type",
+ "name": "storage.type.core.rust",
+ "match":
+ "\\b(bool|char|usize|isize|u8|u16|u32|u64|u128|i8|i16|i32|i64|i128|f32|f64|str|Self|Option|Result)\\b"
+ },
+ "core_vars": {
+ "comment": "Core type variant",
+ "name": "support.constant.core.rust",
+ "match": "\\b(Some|None|Ok|Err)\\b"
+ },
+ "core_marker": {
+ "comment": "Core trait (marker)",
+ "name": "support.type.marker.rust",
+ "match": "\\b(Copy|Send|Sized|Sync)\\b"
+ },
+ "core_traits": {
+ "comment": "Core trait",
+ "name": "support.type.core.rust",
+ "match":
+ "\\b(Drop|Fn|FnMut|FnOnce|Clone|PartialEq|PartialOrd|Eq|Ord|AsRef|AsMut|Into|From|Default|Iterator|Extend|IntoIterator|DoubleEndedIterator|ExactSizeIterator)\\b"
+ },
+ "std_types": {
+ "comment": "Standard library type",
+ "name": "storage.class.std.rust",
+ "match": "\\b(Box|String|Vec|Path|PathBuf)\\b"
+ },
+ "std_traits": {
+ "comment": "Standard library trait",
+ "name": "support.type.std.rust",
+ "match": "\\b(ToOwned|ToString)\\b"
+ },
+ "type": {
+ "comment": "A type",
+ "name": "entity.name.type.rust",
+ "match": "\\b([A-Za-z][_A-Za-z0-9]*|_[_A-Za-z0-9]+)\\b"
+ },
+ "type_params": {
+ "comment": "Type parameters",
+ "name": "meta.type_params.rust",
+ "begin": "<(?![=<])",
+ "end": "(?",
+ "patterns": [
+ {
+ "include": "#block_comment"
+ },
+ {
+ "include": "#line_comment"
+ },
+ {
+ "include": "#sigils"
+ },
+ {
+ "include": "#mut"
+ },
+ {
+ "include": "#lifetime"
+ },
+ {
+ "include": "#core_types"
+ },
+ {
+ "include": "#core_marker"
+ },
+ {
+ "include": "#core_traits"
+ },
+ {
+ "include": "#std_types"
+ },
+ {
+ "include": "#std_traits"
+ },
+ {
+ "include": "#type_params"
+ }
+ ]
+ }
+ }
+}
diff --git a/extensions/shell/syntaxes/shell.tmLanguage.json b/extensions/shell/syntaxes/shell.tmLanguage.json
new file mode 100755
index 0000000000..0d32b7b3b2
--- /dev/null
+++ b/extensions/shell/syntaxes/shell.tmLanguage.json
@@ -0,0 +1,1287 @@
+{
+ "information_for_contributors": [
+ "This file has been converted from https://github.com/atom/language-shellscript/blob/master/grammars/shell-unix-bash.cson",
+ "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/atom/language-shellscript/commit/4c3711edbe8eac6f501976893976b1ac6a043d50",
+ "name": "Shell Script",
+ "scopeName": "source.shell",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#pipeline"
+ },
+ {
+ "include": "#list"
+ },
+ {
+ "include": "#compound-command"
+ },
+ {
+ "include": "#loop"
+ },
+ {
+ "include": "#string"
+ },
+ {
+ "include": "#function-definition"
+ },
+ {
+ "include": "#variable"
+ },
+ {
+ "include": "#interpolation"
+ },
+ {
+ "include": "#heredoc"
+ },
+ {
+ "include": "#herestring"
+ },
+ {
+ "include": "#redirection"
+ },
+ {
+ "include": "#pathname"
+ },
+ {
+ "include": "#keyword"
+ },
+ {
+ "include": "#support"
+ }
+ ],
+ "repository": {
+ "case-clause": {
+ "patterns": [
+ {
+ "begin": "(?=\\S)",
+ "end": ";;",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.terminator.case-clause.shell"
+ }
+ },
+ "name": "meta.scope.case-clause.shell",
+ "patterns": [
+ {
+ "begin": "\\(|(?=\\S)",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.case-pattern.shell"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.case-pattern.shell"
+ }
+ },
+ "name": "meta.scope.case-pattern.shell",
+ "patterns": [
+ {
+ "match": "\\|",
+ "name": "punctuation.separator.pipe-sign.shell"
+ },
+ {
+ "include": "#string"
+ },
+ {
+ "include": "#variable"
+ },
+ {
+ "include": "#interpolation"
+ },
+ {
+ "include": "#pathname"
+ }
+ ]
+ },
+ {
+ "begin": "(?<=\\))",
+ "end": "(?=;;)",
+ "name": "meta.scope.case-clause-body.shell",
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "comment": {
+ "begin": "(^\\s+)?(?<=^|\\W)(?|&&|\\|\\|",
+ "name": "keyword.operator.logical.shell"
+ },
+ {
+ "match": "(?[>=]?|==|!=|^|\\|{1,2}|&{1,2}|\\?|\\:|,|=|[*/%+\\-&^|]=|<<=|>>=",
+ "name": "keyword.operator.arithmetic.shell"
+ },
+ {
+ "match": "0[xX][0-9A-Fa-f]+",
+ "name": "constant.numeric.hex.shell"
+ },
+ {
+ "match": "0\\d+",
+ "name": "constant.numeric.octal.shell"
+ },
+ {
+ "match": "\\d{1,2}#[0-9a-zA-Z@_]+",
+ "name": "constant.numeric.other.shell"
+ },
+ {
+ "match": "\\d+",
+ "name": "constant.numeric.integer.shell"
+ }
+ ]
+ },
+ "pathname": {
+ "patterns": [
+ {
+ "match": "(?<=\\s|:|=|^)~",
+ "name": "keyword.operator.tilde.shell"
+ },
+ {
+ "match": "\\*|\\?",
+ "name": "keyword.operator.glob.shell"
+ },
+ {
+ "begin": "([?*+@!])(\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.operator.extglob.shell"
+ },
+ "2": {
+ "name": "punctuation.definition.extglob.shell"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.extglob.shell"
+ }
+ },
+ "name": "meta.structure.extglob.shell",
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ }
+ ]
+ },
+ "pipeline": {
+ "patterns": [
+ {
+ "match": "(?<=^|;|&|\\s)(time)(?=\\s|;|&|$)",
+ "name": "keyword.other.shell"
+ },
+ {
+ "match": "[|!]",
+ "name": "keyword.operator.pipe.shell"
+ }
+ ]
+ },
+ "redirection": {
+ "patterns": [
+ {
+ "begin": "[><]\\(",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.shell"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.shell"
+ }
+ },
+ "name": "string.interpolated.process-substitution.shell",
+ "patterns": [
+ {
+ "include": "$self"
+ }
+ ]
+ },
+ {
+ "match": "(?])(&>|\\d*>&\\d*|\\d*(>>|>|<)|\\d*<&|\\d*<>)(?![<>])",
+ "name": "keyword.operator.redirect.shell"
+ }
+ ]
+ },
+ "string": {
+ "patterns": [
+ {
+ "match": "\\\\.",
+ "name": "constant.character.escape.shell"
+ },
+ {
+ "begin": "'",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.shell"
+ }
+ },
+ "end": "'",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.shell"
+ }
+ },
+ "name": "string.quoted.single.shell"
+ },
+ {
+ "begin": "\\$?\"",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.shell"
+ }
+ },
+ "end": "\"",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.shell"
+ }
+ },
+ "name": "string.quoted.double.shell",
+ "patterns": [
+ {
+ "match": "\\\\[\\$`\"\\\\\\n]",
+ "name": "constant.character.escape.shell"
+ },
+ {
+ "include": "#variable"
+ },
+ {
+ "include": "#interpolation"
+ }
+ ]
+ },
+ {
+ "begin": "\\$'",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.shell"
+ }
+ },
+ "end": "'",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.shell"
+ }
+ },
+ "name": "string.quoted.single.dollar.shell",
+ "patterns": [
+ {
+ "match": "\\\\(a|b|e|f|n|r|t|v|\\\\|')",
+ "name": "constant.character.escape.ansi-c.shell"
+ },
+ {
+ "match": "\\\\[0-9]{3}",
+ "name": "constant.character.escape.octal.shell"
+ },
+ {
+ "match": "\\\\x[0-9a-fA-F]{2}",
+ "name": "constant.character.escape.hex.shell"
+ },
+ {
+ "match": "\\\\c.",
+ "name": "constant.character.escape.control-char.shell"
+ }
+ ]
+ }
+ ]
+ },
+ "support": {
+ "patterns": [
+ {
+ "match": "(?<=^|;|&|\\s)(?::|\\.)(?=\\s|;|&|$)",
+ "name": "support.function.builtin.shell"
+ },
+ {
+ "match":
+ "(?<=^|;|&|\\s)(?:alias|bg|bind|break|builtin|caller|cd|command|compgen|complete|dirs|disown|echo|enable|eval|exec|exit|false|fc|fg|getopts|hash|help|history|jobs|kill|let|logout|popd|printf|pushd|pwd|read|readonly|set|shift|shopt|source|suspend|test|times|trap|true|type|ulimit|umask|unalias|unset|wait)(?=\\s|;|&|$)",
+ "name": "support.function.builtin.shell"
+ }
+ ]
+ },
+ "variable": {
+ "patterns": [
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.variable.shell"
+ }
+ },
+ "match": "(\\$)[a-zA-Z_][a-zA-Z0-9_]*",
+ "name": "variable.other.normal.shell"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.variable.shell"
+ }
+ },
+ "match": "(\\$)[-*@#?$!0_]",
+ "name": "variable.other.special.shell"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.variable.shell"
+ }
+ },
+ "match": "(\\$)[1-9]",
+ "name": "variable.other.positional.shell"
+ },
+ {
+ "begin": "\\${",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.variable.shell"
+ }
+ },
+ "end": "}",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.variable.shell"
+ }
+ },
+ "name": "variable.other.bracket.shell",
+ "patterns": [
+ {
+ "match": "!|:[-=?]?|\\*|@|#{1,2}|%{1,2}|/",
+ "name": "keyword.operator.expansion.shell"
+ },
+ {
+ "captures": {
+ "1": {
+ "name": "punctuation.section.array.shell"
+ },
+ "3": {
+ "name": "punctuation.section.array.shell"
+ }
+ },
+ "match": "(\\[)([^\\]]+)(\\])"
+ },
+ {
+ "include": "#variable"
+ },
+ {
+ "include": "#string"
+ }
+ ]
+ }
+ ]
+ }
+ }
+}
diff --git a/extensions/swift/syntaxes/swift.tmLanguage.json b/extensions/swift/syntaxes/swift.tmLanguage.json
new file mode 100755
index 0000000000..dcf437a5cd
--- /dev/null
+++ b/extensions/swift/syntaxes/swift.tmLanguage.json
@@ -0,0 +1,229 @@
+{
+ "information_for_contributors": [
+ "This file has been converted from https://github.com/freebroccolo/atom-language-swift/blob/master/grammars/swift.cson",
+ "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/freebroccolo/atom-language-swift/commit/fb7c93e0174dea69c8685c00deeb53d480d1d202",
+ "name": "Swift",
+ "scopeName": "source.swift",
+ "patterns": [
+ {
+ "name": "keyword.others.swift",
+ "match":
+ "^\\s*(#if|#else|#endif|#elseif|@warn_unused_result|@discardableResult|@IBAction|@IBOutlet|@IBDesignable|@IBInspectable)\\b"
+ },
+ {
+ "name": "keyword.declaration.swift",
+ "match": "\\b(deinit|import|init|subscript)\\b"
+ },
+ {
+ "name": "storage.type.swift",
+ "match":
+ "\\b(precedencegroup|class|struct|enum|extension|protocol|let|var|typealias)\\b"
+ },
+ {
+ "name": "storage.modifier.swift",
+ "match":
+ "\\b(final|internal|private|fileprivate|public|open|static|required|convenience)\\b"
+ },
+ {
+ "name": "keyword.statement.swift",
+ "match":
+ "\\b(try|catch|repeat|break|case|continue|default|do|else|fallthrough|if|in|for|return|switch|where|while|guard|defer)\\b"
+ },
+ {
+ "name": "support.type.swift",
+ "match":
+ "(?x) \\b(Character|U?Int|U?Int(8|16|32|64) |Float|Double|Float(32|64)|Bool|String|Date|Data|URL |(double|float)[234]|(double|float)[234]x[234] |Any |AnyObject |Error |Equatable |Hashable |Comparable |CustomDebugStringConvertible |CustomStringConvertible |OptionSet |ManagedBuffer |ManagedBufferPointer |BitwiseOperations |CountedSet |Counter |Directions |ExpressibleByArrayLiteral |ExpressibleByBooleanLiteral |ExpressibleByDictionaryLiteral |ExpressibleByExtendedGraphemeClusterLiteral |ExpressibleByFloatLitera |ExpressibleByIntegerLiteral |ExpressibleByNilLiteral |ExpressibleByStringInterpolation |ExpressibleByStringLiteral |ExpressibleByUnicodeScalarLiteral |OrderedSet |PaperSize |RawRepresentable |(UI|NS|CF|CG)[A-Z][a-zA-Z0-9]+ |Stream |(In|Out)putStream |FileManager |Array |Unsafe[a-zA-Z]*Pointer |Bundle |Jex)\\b"
+ },
+ {
+ "name": "support.function.swift",
+ "match": "\\b(assert|assertionFailure|print)\\b"
+ },
+ {
+ "name": "keyword.expressions-and-types.swift",
+ "match":
+ "\\b(as|dynamicType|is|new|super|self|Self|Type|#column|#file|#function|#line)\\b"
+ },
+ {
+ "name": "keyword.reserved.swift",
+ "match":
+ "\\b(associativity|didSet|get|infix|inout|left|mutating|nonmutating|operator|override|postfix|precedence|prefix|right|set|unowned|unowned(safe)|unowned(unsafe)|weak|willSet)\\b"
+ },
+ {
+ "name": "constant.language.swift",
+ "match": "\\b(true|false|nil|none)\\b"
+ },
+ {
+ "name": "entity.name.function.swift",
+ "match": "\\bfunc\\s+([^\\t\\n\\x20\\x28]+)"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#literal"
+ },
+ {
+ "include": "#operator"
+ }
+ ],
+ "repository": {
+ "comment": {
+ "patterns": [
+ {
+ "name": "comment.block.swift",
+ "begin": "/\\*",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.comment.begin.swift"
+ }
+ },
+ "end": "\\*/",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.comment.end.swift"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#comment"
+ }
+ ]
+ },
+ {
+ "begin": "(^[ \\t]+)?(?=//)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.whitespace.comment.leading.swift"
+ }
+ },
+ "end": "(?!\\G)",
+ "patterns": [
+ {
+ "name": "comment.line.double-slash.swift",
+ "begin": "//",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.comment.swift"
+ }
+ },
+ "end": "\\n",
+ "patterns": [
+ {
+ "name": "punctuation.separator.continuation.swift",
+ "match": "(?>\\\\\\s*\\n)"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "escaped-char": {
+ "patterns": [
+ {
+ "name": "constant.character.escape.swift",
+ "match": "\\\\[0\\\\tnr\"']"
+ },
+ {
+ "name": "constant.character.escape.swift",
+ "match": "\\\\(x\\h{2}|u\\h{4}|U\\h{8})"
+ },
+ {
+ "name": "invalid.illegal.constant.character.escape.swift",
+ "match": "\\\\[^uxU]"
+ }
+ ]
+ },
+ "identifier": {
+ "match":
+ "(?x) (? \\g \\g? | ` \\g \\g? ` ){0} (? [ a-z A-Z ] | [ \\u00A8 \\u00AA \\u00AD \\u00AF \\u00B2-\\u00B5 \\u00B7-\\u00BA ] | [ \\u00BC-\\u00BE \\u00C0-\\u00D6 \\u00D8-\\u00F6 \\u00F8-\\u00FF ] | [ \\u0100-\\u02FF \\u0370-\\u167F \\u1681-\\u180D \\u180F-\\u1DBF ] | [ \\u1E00-\\u1FFF ] | [ \\u200B-\\u200D \\u202A-\\u202E \\u203F-\\u2040 \\u2054 \\u2060-\\u206F ] | [ \\u2070-\\u20CF \\u2100-\\u218F \\u2460-\\u24FF \\u2776-\\u2793 ] | [ \\u2C00-\\u2DFF \\u2E80-\\u2FFF ] | [ \\u3004-\\u3007 \\u3021-\\u302F \\u3031-\\u303F \\u3040-\\uD7FF ] | [ \\uF900-\\uFD3D \\uFD40-\\uFDCF \\uFDF0-\\uFE1F \\uFE30-\\uFE44 ] | [ \\uFE47-\\uFFFD ] | [ \\u10000-\\u1FFFD \\u20000-\\u2FFFD \\u30000-\\u3FFFD \\u40000-\\u4FFFD ] | [ \\u50000-\\u5FFFD \\u60000-\\u6FFFD \\u70000-\\u7FFFD \\u80000-\\u8FFFD ] | [ \\u90000-\\u9FFFD \\uA0000-\\uAFFFD \\uB0000-\\uBFFFD \\uC0000-\\uCFFFD ] | [ \\uD0000-\\uDFFFD \\uE0000-\\uEFFFD ] ){0} (? \\d | [ \\u0300-\\u036F \\u1DC0-\\u1DFF \\u20D0-\\u20FF \\uFE20-\\uFE2F ] | \\g ){0} (? \\g \\g? ){0} (? (?) \\$ \\d+ (?!\\g) (?# FIXME) ){0} \\g | \\g",
+ "captures": {
+ "5": {
+ "name": "variable.other.positional.swift"
+ }
+ }
+ },
+ "literal": {
+ "patterns": [
+ {
+ "include": "#literal-number"
+ },
+ {
+ "include": "#literal-string"
+ }
+ ]
+ },
+ "literal-number": {
+ "name": "constant.numeric.swift",
+ "match":
+ "(?x) (?### INTEGER ###) (? \\g | \\g | \\g | \\g ){0} (?### BINARY ###) (? \\b 0b \\g \\g? \\b ){0} (? [0-1] ){0} (? \\g | _ ){0} (? \\g \\g? ){0} (?### OCTAL ###) (? \\b 0o \\g \\g? \\b ){0} (? [0-7] ){0} (? \\g | _ ){0} (? \\g \\g? ){0} (?### DECIMAL ###) (? \\b \\g \\g? \\b ){0} (? \\d ){0} (? \\g | _ ){0} (? \\g \\g? ){0} (?### HEXADECIMAL ###) (? \\b 0x \\g \\g? \\b ){0} (? \\h ){0} (? \\g | _ ){0} (? \\g \\g? ){0} (?### FLOATING POINT ###) (? \\b \\g \\g? \\g? \\b | \\b \\g \\g? \\g \\b ){0} (? \\. \\g ){0} (? \\g \\g? \\g ){0} (? \\. \\g? ){0} (? \\g \\g? \\g ){0} (? [eE] ){0} (? [pP] ){0} (? [+-] ){0} (?!0[box]) \\g