From d0e3f4e2d43c87436becbdbf208b9258f08bf2a0 Mon Sep 17 00:00:00 2001 From: Aloxaf Date: Thu, 11 Jul 2019 13:52:18 +0800 Subject: [PATCH] More theme & syntax & Linux clipboard support --- Cargo.lock | 101 + Cargo.toml | 1 + README.md | 7 +- assets/README.md | 3 + assets/sync_from_bat.py | 19 + assets/syntaxes/AWK.sublime-syntax | 209 ++ assets/syntaxes/AsciiDoc.sublime-syntax | 283 ++ assets/syntaxes/Assembly (ARM).sublime-syntax | 172 + .../syntaxes/Assembly (x86_64).sublime-syntax | 1367 +++++++ assets/syntaxes/CMake C Header.sublime-syntax | 40 + .../syntaxes/CMake C++ Header.sublime-syntax | 40 + assets/syntaxes/CMake.sublime-syntax | 671 ++++ assets/syntaxes/CMakeCache.sublime-syntax | 54 + assets/syntaxes/CMakeCommands.sublime-syntax | 2328 ++++++++++++ assets/syntaxes/CSV.sublime-syntax | 46 + assets/syntaxes/Cabal.sublime-syntax | 47 + assets/syntaxes/Crystal.sublime-syntax | 1036 ++++++ assets/syntaxes/Dart.sublime-syntax | 369 ++ assets/syntaxes/DotENV.sublime-syntax | 88 + assets/syntaxes/Elixir.sublime-syntax | 510 +++ assets/syntaxes/F#.sublime-syntax | 672 ++++ assets/syntaxes/FSharp.sublime-syntax | 672 ++++ assets/syntaxes/HTML (EEx).sublime-syntax | 497 +++ assets/syntaxes/HTML (Twig).sublime-syntax | 662 ++++ assets/syntaxes/Hosts.sublime-syntax | 23 + assets/syntaxes/INI.sublime-syntax | 46 + .../Javascript (Babel).sublime-syntax | 1288 +++++++ assets/syntaxes/Julia.sublime-syntax | 615 ++++ assets/syntaxes/Kotlin.sublime-syntax | 398 +++ assets/syntaxes/LESS.sublime-syntax | 618 ++++ assets/syntaxes/Nix.sublime-syntax | 609 ++++ assets/syntaxes/Org mode.sublime-syntax | 219 ++ ...blime-syntax => PowerShell.sublime-syntax} | 39 +- assets/syntaxes/Protobuf.sublime-syntax | 460 +++ assets/syntaxes/ProtobufText.sublime-syntax | 186 + assets/syntaxes/Robot.sublime-syntax | 54 + assets/syntaxes/SSH Config.sublime-syntax | 292 ++ assets/syntaxes/SSHD Config.sublime-syntax | 184 + assets/syntaxes/Swift.sublime-syntax | 371 ++ assets/syntaxes/TOML.sublime-syntax | 401 +++ assets/syntaxes/Terraform.sublime-syntax | 133 + assets/syntaxes/TypeScript.sublime-syntax | 3027 ++++++++++++++++ .../syntaxes/TypsecriptReact.sublime-syntax | 3161 +++++++++++++++++ assets/syntaxes/VimL.sublime-syntax | 91 + assets/syntaxes/fish.sublime-syntax | 1009 ++++++ assets/syntaxes/jsonnet.sublime-syntax | 122 + assets/syntaxes/purescript.sublime-syntax | 387 ++ .../syntaxes/requirementstxt.sublime-syntax | 19 + .../syntaxes/show-nonprintable.sublime-syntax | 27 + assets/syntaxes/syslog.sublime-syntax | 41 + assets/syntaxes/varlink.sublime-syntax | 94 + assets/themes/1337.tmTheme | 616 ++++ assets/themes/DarkNeon.tmTheme | 818 +++++ assets/themes/GitHub.tmTheme | 526 +++ assets/themes/Monokai Extended Bright.tmTheme | 999 ++++++ assets/themes/Monokai Extended Light.tmTheme | 1975 ++++++++++ assets/themes/Monokai Extended Origin.tmTheme | 1919 ++++++++++ assets/themes/Monokai Extended.tmTheme | 1878 ++++++++++ assets/themes/OneHalfDark.tmTheme | 663 ++++ assets/themes/OneHalfLight.tmTheme | 663 ++++ ...Monokai.tmTheme => Sublime Snazzy.tmTheme} | 62 +- assets/themes/TwoDark.tmTheme | 878 +++++ assets/themes/ansi-dark.tmTheme | 504 +++ assets/themes/ansi-light.tmTheme | 504 +++ assets/themes/base16.tmTheme | 543 +++ assets/themes/zenburn.tmTheme | 744 ++++ src/config.rs | 47 +- src/main.rs | 18 +- src/utils.rs | 20 +- 69 files changed, 37105 insertions(+), 80 deletions(-) create mode 100644 assets/README.md create mode 100644 assets/sync_from_bat.py create mode 100644 assets/syntaxes/AWK.sublime-syntax create mode 100644 assets/syntaxes/AsciiDoc.sublime-syntax create mode 100644 assets/syntaxes/Assembly (ARM).sublime-syntax create mode 100644 assets/syntaxes/Assembly (x86_64).sublime-syntax create mode 100644 assets/syntaxes/CMake C Header.sublime-syntax create mode 100644 assets/syntaxes/CMake C++ Header.sublime-syntax create mode 100644 assets/syntaxes/CMake.sublime-syntax create mode 100644 assets/syntaxes/CMakeCache.sublime-syntax create mode 100644 assets/syntaxes/CMakeCommands.sublime-syntax create mode 100644 assets/syntaxes/CSV.sublime-syntax create mode 100644 assets/syntaxes/Cabal.sublime-syntax create mode 100644 assets/syntaxes/Crystal.sublime-syntax create mode 100644 assets/syntaxes/Dart.sublime-syntax create mode 100644 assets/syntaxes/DotENV.sublime-syntax create mode 100644 assets/syntaxes/Elixir.sublime-syntax create mode 100644 assets/syntaxes/F#.sublime-syntax create mode 100644 assets/syntaxes/FSharp.sublime-syntax create mode 100644 assets/syntaxes/HTML (EEx).sublime-syntax create mode 100644 assets/syntaxes/HTML (Twig).sublime-syntax create mode 100644 assets/syntaxes/Hosts.sublime-syntax create mode 100644 assets/syntaxes/INI.sublime-syntax create mode 100644 assets/syntaxes/Javascript (Babel).sublime-syntax create mode 100644 assets/syntaxes/Julia.sublime-syntax create mode 100644 assets/syntaxes/Kotlin.sublime-syntax create mode 100644 assets/syntaxes/LESS.sublime-syntax create mode 100644 assets/syntaxes/Nix.sublime-syntax create mode 100644 assets/syntaxes/Org mode.sublime-syntax rename assets/syntaxes/{PowerShellSyntax.sublime-syntax => PowerShell.sublime-syntax} (92%) create mode 100644 assets/syntaxes/Protobuf.sublime-syntax create mode 100644 assets/syntaxes/ProtobufText.sublime-syntax create mode 100644 assets/syntaxes/Robot.sublime-syntax create mode 100644 assets/syntaxes/SSH Config.sublime-syntax create mode 100644 assets/syntaxes/SSHD Config.sublime-syntax create mode 100644 assets/syntaxes/Swift.sublime-syntax create mode 100644 assets/syntaxes/TOML.sublime-syntax create mode 100644 assets/syntaxes/Terraform.sublime-syntax create mode 100644 assets/syntaxes/TypeScript.sublime-syntax create mode 100644 assets/syntaxes/TypsecriptReact.sublime-syntax create mode 100644 assets/syntaxes/VimL.sublime-syntax create mode 100644 assets/syntaxes/fish.sublime-syntax create mode 100644 assets/syntaxes/jsonnet.sublime-syntax create mode 100644 assets/syntaxes/purescript.sublime-syntax create mode 100644 assets/syntaxes/requirementstxt.sublime-syntax create mode 100644 assets/syntaxes/show-nonprintable.sublime-syntax create mode 100644 assets/syntaxes/syslog.sublime-syntax create mode 100644 assets/syntaxes/varlink.sublime-syntax create mode 100644 assets/themes/1337.tmTheme create mode 100644 assets/themes/DarkNeon.tmTheme create mode 100644 assets/themes/GitHub.tmTheme create mode 100644 assets/themes/Monokai Extended Bright.tmTheme create mode 100644 assets/themes/Monokai Extended Light.tmTheme create mode 100644 assets/themes/Monokai Extended Origin.tmTheme create mode 100644 assets/themes/Monokai Extended.tmTheme create mode 100644 assets/themes/OneHalfDark.tmTheme create mode 100644 assets/themes/OneHalfLight.tmTheme rename assets/themes/{Monokai.tmTheme => Sublime Snazzy.tmTheme} (83%) create mode 100644 assets/themes/TwoDark.tmTheme create mode 100644 assets/themes/ansi-dark.tmTheme create mode 100644 assets/themes/ansi-light.tmTheme create mode 100644 assets/themes/base16.tmTheme create mode 100644 assets/themes/zenburn.tmTheme diff --git a/Cargo.lock b/Cargo.lock index 9aad800..8c38713 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -115,6 +115,15 @@ name = "byteorder" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "c2-chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cc" version = "1.0.37" @@ -434,6 +443,15 @@ name = "fuchsia-cprng" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "getrandom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "gif" version = "0.10.2" @@ -541,6 +559,9 @@ dependencies = [ name = "lazy_static" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "spin 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "lazycell" @@ -826,6 +847,11 @@ dependencies = [ "num-iter 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ppv-lite86" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "proc-macro2" version = "0.4.30" @@ -865,6 +891,18 @@ dependencies = [ "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rand" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_chacha 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rand_chacha" version = "0.1.1" @@ -874,6 +912,16 @@ dependencies = [ "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rand_chacha" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rand_core" version = "0.3.1" @@ -887,6 +935,14 @@ name = "rand_core" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "rand_core" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rand_hc" version = "0.1.0" @@ -895,6 +951,14 @@ dependencies = [ "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rand_isaac" version = "0.1.1" @@ -1005,6 +1069,14 @@ dependencies = [ "ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "remove_dir_all" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rustc-demangle" version = "0.1.15" @@ -1116,8 +1188,14 @@ dependencies = [ "rusttype 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", "structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "syntect 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "spin" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "stb_truetype" version = "0.2.6" @@ -1188,6 +1266,19 @@ dependencies = [ "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tempfile" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "term_size" version = "0.3.1" @@ -1342,6 +1433,7 @@ dependencies = [ "checksum blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" "checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" +"checksum c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7d64d04786e0f528460fc884753cf8dddcc466be308f6026f8e355c41a0e4101" "checksum cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)" = "39f75544d7bbaf57560d2168f28fd649ff9c76153874db88bdbdfd839b1a7e7d" "checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" @@ -1379,6 +1471,7 @@ dependencies = [ "checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" "checksum freetype 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "11926b2b410b469d0e9399eca4cbbe237a9ef02176c485803b29216307e8e028" "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +"checksum getrandom 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "e65cce4e5084b14874c4e7097f38cab54f47ee554f9194673456ea379dcc4c55" "checksum gif 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "86c2f2b597d6e05c86ee5947b2223bda468fe8dad3e88e2a6520869322aaf568" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" "checksum humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca7e5f2e110db35f93b837c81797f3714500b81d517bf20c431b16d3ca4f114" @@ -1425,14 +1518,19 @@ dependencies = [ "checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c" "checksum plist 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5f2a9f075f6394100e7c105ed1af73fb1859d6fd14e49d4290d578120beb167f" "checksum png 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "63daf481fdd0defa2d1d2be15c674fbfa1b0fd71882c303a91f9a79b3252c359" +"checksum ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e3cbf9f658cdb5000fcf6f362b8ea2ba154b9f146a61c7a20d647034c6b6561b" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" "checksum quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "faf4799c5d274f3868a4aae320a0a182cbd2baee377b378f080e16a23e9d80db" "checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +"checksum rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d47eab0e83d9693d40f825f86948aa16eff6750ead4bdffc4ab95b8b3a7f052c" "checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +"checksum rand_chacha 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e193067942ef6f485a349a113329140d0ab9e2168ce92274499bb0e9a4190d9d" "checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" "checksum rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0" +"checksum rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "615e683324e75af5d43d8f7a39ffe3ee4a9dc42c5c701167a71dc59c3a493aca" "checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" "checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" "checksum rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" "checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" @@ -1445,6 +1543,7 @@ dependencies = [ "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" "checksum redox_users 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe5204c3a17e97dde73f285d49be585df59ed84b50a872baf416e73b62c3828" "checksum regex-syntax 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9d76410686f9e3a17f06128962e0ecc5755870bb890c34820c7af7f1db2e1d48" +"checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" "checksum rustc-demangle 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "a7f4dccf6f4891ebcc0c39f9b6eb1a83b9bf5d747cb439ec6fba4f3b977038af" "checksum rusttype 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)" = "654103d61a05074b268a107cf6581ce120f0fc0115f2610ed9dfea363bb81139" "checksum ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997" @@ -1458,12 +1557,14 @@ dependencies = [ "checksum servo-fontconfig 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a088f8d775a5c5314aae09bd77340bc9c67d72b9a45258be34c83548b4814cd9" "checksum servo-fontconfig-sys 4.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b46d201addcfbd25c1798ad1281d98c40743824e0b0f1e611bd3d5d0d31a7b8d" "checksum servo-freetype-sys 4.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2c4ccb6d0d32d277d3ef7dea86203d8210945eb7a45fba89dd445b3595dd0dfc" +"checksum spin 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44363f6f51401c34e7be73db0db371c04705d35efbe9f7d6082e03a921a32c55" "checksum stb_truetype 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "69b7df505db8e81d54ff8be4693421e5b543e08214bd8d99eb761fcb4d5668ba" "checksum structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "16c2cdbf9cc375f15d1b4141bc48aeef444806655cd0e904207edc8d68d86ed7" "checksum structopt-derive 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "53010261a84b37689f9ed7d395165029f9cc7abb9f56bbfe86bee2597ed25107" "checksum syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d960b829a55e56db167e861ddb43602c003c7be0bee1d345021703fac2fb7c" "checksum synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02353edf96d6e4dc81aea2d8490a7e9db177bf8acb0e951c24940bf866cb313f" "checksum syntect 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e80b8831c5a543192ffc3727f01cf0e57579c6ac15558e3048bfb5708892167b" +"checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" "checksum term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9e5b9a66db815dcfd2da92db471106457082577c3c278d4138ab3e3b4e189327" "checksum termion 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a8fb22f7cde82c8220e5aeacb3258ed7ce996142c77cba193f203515e26c330" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" diff --git a/Cargo.toml b/Cargo.toml index 5e07dc0..e90025e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,7 @@ failure = "0.1.5" clipboard = "0.5.0" structopt = { version = "0.2.18", default-features = false, features = [ "color", "wrap_help" ] } itertools = "0.8.0" +tempfile = "3.1.0" [build-dependencies] syntect = "3.2" diff --git a/README.md b/README.md index 1ca1065..e4b0936 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,13 @@ A [Carbon](https://github.com/dawnlabs/carbon) alternative implemented in Rust. ## TODO - [x] MVP -- [ ] More themes -- [ ] More syntaxes support +- [x] More themes +- [x] More syntaxes support - [ ] Better font support - [ ] Clipboard support - [x] Get code from clipboard - [ ] Paste the image to clipboard + - [x] Linux + - [ ] Windows + - [ ] MacOS - [ ] Watermark diff --git a/assets/README.md b/assets/README.md new file mode 100644 index 0000000..339a990 --- /dev/null +++ b/assets/README.md @@ -0,0 +1,3 @@ +# Assets + +Silicon uses [bat](https://github.com/sharkdp/bat/tree/master/assets)'s syntax and theme resources. diff --git a/assets/sync_from_bat.py b/assets/sync_from_bat.py new file mode 100644 index 0000000..9638e70 --- /dev/null +++ b/assets/sync_from_bat.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +# Sync themes and syntaxes from [bat](https://github.com/sharkdp/bat/tree/master/assets) + +import os +from glob import glob +from shutil import copy + +if not os.path.exists('../../bat'): + os.system('git clone https://github.com/sharkdp/bat ../../bat') +else: + os.system('git -C ../../bat pull') + +for syntax_file in glob('../../bat/assets/syntaxes/**/*.sublime-syntax'): + copy(syntax_file, './syntaxes/') + +for theme_file in glob('../../bat/assets/themes/**/*.tmTheme'): + copy(theme_file, './themes/') + +print('Finished.') diff --git a/assets/syntaxes/AWK.sublime-syntax b/assets/syntaxes/AWK.sublime-syntax new file mode 100644 index 0000000..990afbc --- /dev/null +++ b/assets/syntaxes/AWK.sublime-syntax @@ -0,0 +1,209 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: AWK + +scope: source.awk + +file_extensions: + - awk + +# References +# http://pubs.opengroup.org/onlinepubs/009695399/utilities/awk.html +# http://www.gnu.org/software/gawk/manual/html_node/index.html +# http://www.grymoire.com/Unix/Awk.html +# http://www.cs.mun.ca/~yzchen/bib/nawkUS.pdf +variables: + + NAME: '[A-Za-z_][A-Za-z_0-9]*' + +contexts: + + main: + - include: comment + - include: procedure + - include: pattern + + comment: + - match: '(?!]=|[<>]" + scope: keyword.operator.comparison.awk + set: expression + - match: \b(in)\b + scope: keyword.operator.comparison.awk + set: expression + - match: '[+\-*/%^]=|\+\+|--|>>|=' + scope: keyword.operator.assignment.awk + set: expression + - match: \|\||&&|! + scope: keyword.operator.boolean.awk + set: expression + - match: '[+\-*/%^]' + scope: keyword.operator.arithmetic.awk + set: expression + - match: '[?:]' + scope: keyword.operator.trinary.awk + set: expression + - match: '\[' + scope: keyword.operator.index.awk + set: expression + - match: '\]' + scope: keyword.operator.index.awk + set: expression + - match: '(?=[\S])' + pop: true diff --git a/assets/syntaxes/AsciiDoc.sublime-syntax b/assets/syntaxes/AsciiDoc.sublime-syntax new file mode 100644 index 0000000..7bc6443 --- /dev/null +++ b/assets/syntaxes/AsciiDoc.sublime-syntax @@ -0,0 +1,283 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: AsciiDoc +comment: | + A very early hack. Mostly ripped from other syntaxes. + Only the very basic stuff is working. +file_extensions: + - adoc + - asciidoc + - asc +scope: text.html.asciidoc +contexts: + main: + - include: heading_inline + - include: heading-block + - include: heading-blockattr + - match: \$\$(?!\$) + push: + - meta_scope: comment.block.passthrough.macro.doubledollar.asciidoc + - match: \$\$(?!\$) + pop: true + - match: \+\+\+(?!\+) + push: + - meta_scope: comment.block.passthrough.macro.tripeplus.asciidoc + - match: \+\+\+(?!\+) + pop: true + - match: (//).*$\n? + scope: comment.line.double-slash.asciidoc + - match: |- + (?x)^ + (?= ([/+-.*_=]{4,})\s*$ + | ([ \t]{1,}) + | [=]{1,6}\s*+ + | [ ]{,3}(?[-*_])([ ]{,2}\k){2,}[ \t]*+$ + ) + push: + - meta_scope: meta.block-level.asciidoc + - match: |- + (?x)^ + (?! \1 + | ([ \t]{1,}) + | [=]{1,6}\s*+ + | [ ]{,3}(?[-*_])([ ]{,2}\k){2,}[ \t]*+$ + ) + pop: true + - include: block_quote + - include: block_raw + - include: heading_inline + - include: heading-block + - include: separator + - match: '^[ ]{0,3}([*+-])(?=\s)' + captures: + 1: punctuation.definition.list_item.asciidoc + push: + - meta_scope: markup.list.unnumbered.asciidoc + - match: ^(?=\S) + captures: + 1: punctuation.definition.list_item.asciidoc + pop: true + - include: list-paragraph + - match: '^[ ]{0,3}[0-9]+(\.)(?=\s)' + captures: + 1: punctuation.definition.list_item.asciidoc + push: + - meta_scope: markup.list.numbered.asciidoc + - match: ^(?=\S) + captures: + 1: punctuation.definition.list_item.asciidoc + pop: true + - include: list-paragraph + - match: '^([/+-.*_=]){4,}\s*$' + push: + - meta_scope: comment.block.asciidoc + - match: '^\1{4,}\s*$' + pop: true + - match: '^([/+.]){4,}\s*$' + comment: asciidoc formatting is disabled inside certain blocks. + push: + - meta_scope: meta.disable-asciidoc + - match: '^[/+.]{4,}\s*$' + pop: true + - match: '^(?=\S)(?![=-]{3,}(?=$))(?!\.\S+)' + push: + - meta_scope: meta.paragraph.asciidoc + - match: '^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[ \t]*\n' + pop: true + - include: inline + - include: scope:text.html.basic + - match: '^(={3,})(?=[ \t]*$)' + scope: markup.heading.0.asciidoc + captures: + 1: punctuation.definition.heading.asciidoc + - match: '^(-{3,})(?=[ \t]*$)' + scope: markup.heading.1.asciidoc + captures: + 1: punctuation.definition.heading.asciidoc + - match: '^(~{3,})(?=[ \t]*$)' + scope: markup.heading.2.asciidoc + captures: + 1: punctuation.definition.heading.asciidoc + - match: '^(\^{3,})(?=[ \t]*$)' + scope: markup.heading.3.asciidoc + captures: + 1: punctuation.definition.heading.asciidoc + - match: '^(\+{3,})(?=[ \t]*$)' + scope: markup.heading.4.asciidoc + captures: + 1: punctuation.definition.heading.asciidoc + attribute-entry: + - match: '^:[-_. A-Za-z0-9]+:\s*(.*)\s*$' + scope: variable.other + attribute-reference: + - match: "{[-_. A-Za-z0-9]+}" + scope: variable.other + attribute-reference-predefined: + - match: "{(?i:amp|asciidoc-dir|asciidoc-file|asciidoc-version|author|authored|authorinitials|backend-docbook|backend-xhtml11|backend-html4|docbook-article|xhtml11-article|html4-article|docbook-book|xhtml11-book|html4-book|docbook-manpage|xhtml11-manpage|html4-manpage|backend|backslash|basebackend|brvbar|date|docdate|doctime|docname|docfile|docdir|doctitle|doctype-article|doctype-book|doctype-manpage|doctype|email|empty|encoding|filetype|firstname|gt|id|indir|infile|lastname|level|listindex|localdate|localtime|lt|manname|manpurpose|mantitle|manvolnum|middlename|nbsp|outdir|outfile|reftext|revision|sectnum|showcomments|title|two_colons|two_semicolons|user-dir|verbose)}" + scope: support.variable + block_quote: + - match: '^([/+-.*_=]){4,}\s*$' + push: + - meta_scope: comment.block.asciidoc + - match: '^\1{4,}\s*$' + pop: true + block_raw: + - match: '\G([ ]{4}|\t).*$\n?' + scope: markup.raw.block.asciidoc + bracket: + - match: '<(?![a-z/?\$!])' + comment: | + asciidoc will convert this for us. We match it so that the + HTML grammar will not mark it up as invalid. + scope: meta.other.valid-bracket.asciidoc + character-replacements: + - match: \(C\)|\(R\)|\(TM\)|--(?!-)|\.\.\.(?!\.)|->|<-|=>|<= + scope: constant.character.asciidoc + escape: + - match: '\\[-`*_#+.!(){}\[\]\\>:]' + scope: constant.character.escape.asciidoc + heading: + - match: '(?m)^(\S+)$([=-~^+])+\s*$' + scope: markup.heading.asciidoc + captures: + 1: punctuation.definition.heading.asciidoc + heading-block: + - match: ^\.(\w.*)$ + scope: markup.heading.asciidoc + captures: + 1: punctuation.definition.heading.asciidoc + heading-blockattr: + - match: '^\[\[?(\w.*)\]$' + scope: markup.heading.asciidoc + captures: + 1: punctuation.definition.heading.asciidoc + heading_inline: + - match: '\G(={1,6})(?!=)\s*(?=\S)' + captures: + 1: punctuation.definition.heading.asciidoc + push: + - meta_scope: markup.heading.asciidoc + - meta_content_scope: entity.name.section.asciidoc + - match: \s*(=*)$\n? + captures: + 1: punctuation.definition.heading.asciidoc + pop: true + - include: inline + inline: + - include: line-break + - include: line-page-break + - include: line-ruler + - include: escape + - include: passthrough-macro-trippleplus-inline + - include: passthrough-macro-doubledollar-inline + - include: character-replacements + - include: bracket + - include: raw + - include: text-quote-single + - include: text-quote-double + - include: text-quote-other + - include: text-bold-unconstrained + - include: text-italic-unconstrained + - include: text-monospace-unconstrained + - include: text-unquoted-unconstrained + - include: text-bold + - include: text-italic + - include: text-monospace + - include: text-unquoted + - include: attribute-entry + - include: attribute-reference-predefined + - include: attribute-reference + line-break: + - match: (?<=\S)\s+\+$ + scope: constant.character.escape.asciidoc + line-page-break: + - match: "^<{3,}$" + scope: constant.character.escape.asciidoc + line-ruler: + - match: "^'{3,}$" + scope: constant.character.escape.asciidoc + list-paragraph: + - match: \G\s+(?=\S) + push: + - meta_scope: meta.paragraph.list.asciidoc + - match: ^\s*$ + pop: true + - include: inline + passthrough-macro-doubledollar-inline: + - match: '(?:\[.*\])?\$\$(?!\$).+\$\$(?!\$)' + scope: comment.block.passthrough.asciidoc + passthrough-macro-trippleplus-inline: + - match: '(?:\[.*\])?\+\+\+(?!\+).+\+\+\+(?!\+)' + scope: comment.block.passthrough.asciidoc + raw: + - match: '(`+)(?:[^`]|(?!(?[a-zA-Z_][a-zA-Z0-9_]*)) # macro name + (?: # and optionally: + (\() # an open parenthesis + ( + \s* \g \s* # first argument + ((,) \s* \g \s*)* # additional arguments + (?:\.\.\.)? # varargs ellipsis? + ) + (\)) # a close parenthesis + )? + captures: + 1: keyword.control.import.define.c + 2: entity.name.function.preprocessor.c + 4: punctuation.definition.parameters.c + 5: variable.parameter.preprocessor.c + 7: punctuation.separator.parameters.c + 8: punctuation.definition.parameters.c + push: + - meta_scope: meta.preprocessor.macro.c + - match: (?=(?://|/\*))|$ + pop: true + - match: (?>\\\s*\n) + scope: punctuation.separator.continuation.c + - include: $top_level_main + - match: ^\s*#\s*(error|warning)\b + captures: + 1: keyword.control.import.error.c + push: + - meta_scope: meta.preprocessor.diagnostic.c + - match: $ + captures: + 1: keyword.control.import.error.c + pop: true + - match: (?>\\\s*\n) + scope: punctuation.separator.continuation.c + - match: ^\s*#\s*(include|import)\b\s+ + captures: + 1: keyword.control.import.include.c + push: + - meta_scope: meta.preprocessor.c.include + - match: (?=(?://|/\*))|$ + captures: + 1: keyword.control.import.include.c + pop: true + - match: (?>\\\s*\n) + scope: punctuation.separator.continuation.c + - match: '"' + captures: + 0: punctuation.definition.string.begin.c + push: + - meta_scope: string.quoted.double.include.c + - match: '"' + captures: + 0: punctuation.definition.string.end.c + pop: true + - match: < + captures: + 0: punctuation.definition.string.begin.c + push: + - meta_scope: string.quoted.other.lt-gt.include.c + - match: ">" + captures: + 0: punctuation.definition.string.end.c + pop: true + - match: '((?i)([xw][0-9]|[xw]1[0-9]||[xw]2[0-9]|[wx]30|wzr|xzr|wsp|fpsr|fpcr|[rcp]1[0-5]|[rcp][0-9]|a[1-4]|v[1-8]|sl|sb|fp|ip|sp|lr|(c|s)psr(_c)?|pc|[sd]3[0-1]|[sd][12][0-9]|[sd][0-9]|fpsid|fpscr|fpexc|q3[0-1]|q2[0-9]|q1[0-9]|q[0-9]|APSR_nzcv|sy)!?(?-i))?\b' + scope: storage.other.register + - match: \.(?i)(globl|global|macro|endm|purgem|if|elseif|else|endif|section|text|arm|align|balign|irp|rept|endr|req|unreq|error|short|func|endfunc|hidden|type|fpu|arch|code|altmacro|object_arch|word|int|string)(?-i)\b + scope: keyword.control.directive + - match: armv(2a?|3m?|4t?|5t?e?6(j|t2|zk?|-m)?|7v?e?(-(a|r|m))?|8-a(\+crc)?) + scope: keyword.control.arch.arm + - match: ^\s*#\s*(define|defined|elif|else|if|ifdef|ifndef|line|pragma|undef|endif)\b + captures: + 1: keyword.control.import.c + push: + - meta_scope: meta.preprocessor.c + - match: (?=(?://|/\*))|$ + captures: + 1: keyword.control.import.c + pop: true + - match: (?>\\\s*\n) + scope: punctuation.separator.continuation.c + - match: |- + (?x)\b((?i) + ( + (bf(c|i)|(u|s)bfx|(u|s)xta?(h|b)?) | + (v(add|cvt|sub|mov|trn|cmp|div|qdmulh|mrs|mul|ld1|qadd|qshrun|st[1234]|addw|mull|mlal|rshrn|swp|qmovun)|qmovun)(\.([isup]?8|[isupf]?16|[isuf]?32|[isu]?64))* | + (and|m(rs|sr)|eor|sub|rsb|add|adc|sbc|rsc|tst|teq|cmp|cmn|orr|mov|bic|mvn | + (neg) | + (lsr|lsl|ror|asr) # shift ops either pseudo ops or actual shifts + )s? | + (mul|mla|mull|smlabb) | + (mov(w|t)) | + rev(8|16)? | + (pld|adr|adrl|vswp) + ) + (ne|eq|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|lt|le|gt|ge|al)?(?-i))?\b + scope: support.function.mnemonic.arithmetic + - match: |- + (?x)\b((?i)( + swi|svc|wfi| + dmb | clrex | dsb | isb | + v(ldr|str|push|pop) | + (push|pop) | + (st|ld)( + p | + r(ex|s?(h|b)|d)? | + m( + (f|e)(d|a) | + (d|i)(b|a) + )? + ) | + b(l|x|lx|lr|r)? | + (i|e)?ret| + b\.(eq|ne|hs|cs|lo|cc|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al|nv)+ | + (c|t)?bn?z| + )+(ne|eq|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|lt|le|gt|ge|al)?(?-i))\b + scope: support.function.mnemonic.memory + - match: '\b((?i)(def(b|w|s)|equ|(include|get)(\s+([a-zA-Z_]+[0-9a-zA-Z_]*|[0-9]+[a-zA-Z_]+[0-9a-zA-Z_]*?)\.s)?)?(?-i))\b' + scope: meta.preprocessor.c.include + - match: \b((?i)(align)(?-i))?\b + scope: storage.type.c.memaccess + - match: \s+\".+\" + scope: string + - match: \b((?i)nop(ne|eq|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|lt|le|gt|ge|al)?(?-i))?\b + scope: comment.nop + - match: '\s\[' + push: + - meta_scope: storage.type.c.memaccess + - match: '\]' + pop: true + - match: (?>\\\s*\n) + scope: punctuation.separator.continuation.c + - include: $top_level_main + - match: (\b|\s+)\=\b + scope: keyword.control.evaluation + - match: '(\b|\s+)(\#)?-?(0x|&)[0-9a-fA-F_]+\b' + scope: constant.numeric.hex + - match: '(\b|\s+)\#-?[0-9a-zA-Z_]+\b' + scope: constant.numeric.literal + - match: '(\b|\s+)[0-9]+\b' + scope: constant.numeric.dec + - match: '\b([a-zA-Z_]+[0-9a-zA-Z_]*|[0-9]+[a-zA-Z_]+[0-9a-zA-Z_]*)\b' + scope: meta.function.source.arm.label diff --git a/assets/syntaxes/Assembly (x86_64).sublime-syntax b/assets/syntaxes/Assembly (x86_64).sublime-syntax new file mode 100644 index 0000000..1d91df8 --- /dev/null +++ b/assets/syntaxes/Assembly (x86_64).sublime-syntax @@ -0,0 +1,1367 @@ +%YAML 1.2 +--- +file_extensions: [yasm, nasm, asm, inc, mac] +scope: source.asm.x86_64 + +variables: + num_bin: '(?:[01][01_]*)' + num_oct: '(?:[0-7][0-7_]*)' + num_dec: '(?:[0-9][0-9_]*)' + num_hex: '(?:[[:xdigit:]][[:xdigit:]_]*)' + num_bin_exp: '(?:p[+-]?{{num_dec}})' + num_dec_exp: '(?:e[+-]?{{num_dec}})' + identifier_body: '(?:[[:alnum:]_$#@~.?]*)' + valid_identifier: '(?:[[:alpha:]_?]{{identifier_body}})' + +contexts: + prototype: + - include: comments + + line-continuation: + - match: '(\\)$\n' + captures: + 1: punctuation.separator.continuation.asm.x86_64 + - match: '\\(\s+?)$' + captures: + 1: invalid.illegal.space-after-continuation.asm.x86_64 + line-ending: + - match: '$\n' + pop: true + pop: + - match: '(?=.|$)' + pop: true + pop-if-not-whitespace: + - match: '(?=\S)' + set: pop + + main: + - include: comments + - include: prefixes + - include: data-types + - include: registers + - include: mnemonics + - include: strings + - include: numbers + - include: operators + - include: support + - include: directives + - include: entities + - include: structs + - include: preprocessor + - include: labels + + numbers: + - include: floating-point + - include: integers + floating-point: + # binary + - match: '(?i)\b0[by]{{num_bin}}\.(?:{{num_bin}}?{{num_bin_exp}}?\b)?' + scope: constant.numeric.binary.floating-point.asm.x86_64 + - match: '(?i)\b0[by]{{num_bin}}{{num_bin_exp}}\b' + scope: constant.numeric.binary.floating-point.asm.x86_64 + # octal + - match: '(?i)\b0[oq]{{num_oct}}\.(?:{{num_oct}}?{{num_bin_exp}}?\b)?' + scope: constant.numeric.octal.floating-point.asm.x86_64 + - match: '(?i)\b0[oq]{{num_oct}}{{num_bin_exp}}\b' + scope: constant.numeric.octal.floating-point.asm.x86_64 + # decimal + - match: '(?i)\b(?:0[dt])?{{num_dec}}\.(?:{{num_dec}}?{{num_dec_exp}}?\b)?' + scope: constant.numeric.decimal.floating-point.asm.x86_64 + - match: '(?i)\b{{num_dec}}{{num_dec_exp}}\b' + scope: constant.numeric.decimal.floating-point.asm.x86_64 + #- match: '(?i)\.{{num_dec}}{{num_dec_exp}}?\b' + # scope: invalid.illegal.constant.numeric.decimal.floating-point.asm.x86_64 + - match: '(?i)\b{{num_dec}}p{{num_dec}}?\b' + scope: constant.numeric.decimal.packed-bcd.asm.x86_64 + # hex + - match: '(?i)\b0[xh]{{num_hex}}\.(?:{{num_hex}}?{{num_bin_exp}}?\b)?' + scope: constant.numeric.hex.floating-point.asm.x86_64 + - match: '(?i)\b0[xh]{{num_hex}}{{num_bin_exp}}\b' + scope: constant.numeric.hex.floating-point.asm.x86_64 + - match: '(?i)\$[0-9]\_?{{num_hex}}?\.(?:{{num_hex}}?{{num_bin_exp}}?\b)?' + scope: constant.numeric.hex.floating-point.asm.x86_64 + - match: '(?i)\$[0-9]\_?{{num_hex}}{{num_bin_exp}}\b' + scope: constant.numeric.hex.floating-point.asm.x86_64 + integers: + - match: '(?i)\b(?:(?:0[by]{{num_bin}})|(?:{{num_bin}}[by]))\b' + scope: constant.numeric.binary.asm.x86_64 + - match: '(?i)\b(?:(?:0[oq]{{num_oct}})|(?:{{num_oct}}[oq]))\b' + scope: constant.numeric.octal.asm.x86_64 + - match: '(?i)\b(?:(?:0[dt]{{num_dec}})|(?:{{num_dec}}[dt]?))\b' + scope: constant.numeric.decimal.asm.x86_64 + - match: '(?i)(?:\$[0-9]\_?{{num_hex}}?)\b' + scope: constant.numeric.hex.asm.x86_64 + - match: '(?i)\b(?:(?:0[xh]{{num_hex}})|(?:{{num_hex}}[hxHX]))\b' + scope: constant.numeric.hex.asm.x86_64 + + labels: + # http://www.nasm.us/doc/nasmdoc3.html#section-3.9 + - match: '(\.\.@)({{valid_identifier}})(?:(\:)?|\b)' + captures: + 1: punctuation.separator.asm.x86_64 storage.modifier.asm.x86_64 + 2: entity.name.constant.special.asm.x86_64 + 3: punctuation.separator.asm.x86_64 + - match: '(?:(\.)?|\b)({{valid_identifier}})(?:(\:)?|\b)' + captures: + 1: punctuation.separator.asm.x86_64 storage.modifier.asm.x86_64 + 2: entity.name.constant.asm.x86_64 + 3: punctuation.separator.asm.x86_64 + - match: '(\.)([0-9]+{{identifier_body}})(?:(\:)?|\b)' + captures: + 1: punctuation.separator.asm.x86_64 storage.modifier.asm.x86_64 + 2: entity.name.constant.asm.x86_64 + 3: punctuation.separator.asm.x86_64 + - match: '(?:(\.)?|\b)([0-9$@~]{{identifier_body}})(?:(\:)?|\b)' + captures: + 1: punctuation.separator.asm.x86_64 storage.modifier.asm.x86_64 + 2: invalid.illegal.entity.name.constant.asm.x86_64 + 3: punctuation.separator.asm.x86_64 + - match: '((%)(\d+))' + captures: + 1: invalid.illegal.meta.preprocessor.asm.x86_64 + #1: meta.preprocessor.asm.x86_64 + 2: punctuation.definition.variable.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 3: variable.other.preprocessor.asm.x86_64 + - match: '((%%)({{valid_identifier}})(?:(\:)?|\b))' + captures: + 1: invalid.illegal.meta.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 3: entity.name.constant.special.asm.x86_64 + 4: punctuation.separator.asm.x86_64 + + data-types: + # Initialized & uninitialized data: http://www.nasm.us/doc/nasmdoc3.html#section-3.2.1 + - match: '(?i)\b(?:s?byte|(?:[doqtyz]|dq|s[dq]?)?word|(?:d|res)[bdoqtwyz]|ddq)\b' + scope: storage.type.asm.x86_64 + - match: '(?i)\b(?:incbin|equ|times)\b' + scope: support.function.asm.x86_64 + + prefixes: + - match: '(?i)\b(?:strict|nosplit|near|far|abs|rel)\b' + scope: storage.modifier.asm.x86_64 + - match: '(?i)\b(?:[ao](?:16|32|64))\b' + scope: storage.modifier.prefix.asm.x86_64 + - match: '(?i)\b(?:rep(?:n?[ez])?|lock|xacquire|xrelease|(?:no)?bnd)\b' + scope: storage.modifier.prefix.asm.x86_64 + - match: '{(vex[23]|evex)}' + captures: + 1: storage.modifier.prefix.vex.asm.x86_64 + - match: '{(k[1-7])}' + captures: + 1: storage.modifier.opmask.asm.x86_64 + - match: '{(1to(?:8|16))}' + captures: + 1: storage.modifier.precision.asm.x86_64 + - match: '{(z|(?:r[nudz]-)?sae)}' + captures: + 1: storage.modifier.rounding.asm.x86_64 + + support: + # http://www.nasm.us/doc/nasmdoc7.html#section-7.4.6 + - match: '\.\.(?:start|imagebase|tlvp|got(?:pc(?:rel)?|(?:tp)?off)?|plt|sym|tlsie)\b' + scope: support.constant.asm.x86_64 + - match: '\b__(?:utf(?:(?:16|32)(?:[lb]e)?)|float(?:8|16|32|64|80[me]|128[lh])|Infinity|[QS]?NaN)__\b' + scope: support.function.asm.x86_64 + # http://www.nasm.us/doc/nasmdoc4.html#section-4.11 + - match: '\b__NASM_(?:MAJOR|(?:SUB)?MINOR|SNAPSHOT|VER(?:SION_ID)?)__\b' + scope: support.function.asm.x86_64 + - match: '\b___NASM_PATCHLEVEL__\b' + scope: support.function.asm.x86_64 + - match: '\b__(?:FILE|LINE|BITS|OUTPUT_FORMAT)__\b' + scope: support.function.asm.x86_64 + - match: '\b__(?:(?:UTC_)?(?:DATE|TIME)(?:_NUM)?|POSIX_TIME)__\b' + scope: support.function.asm.x86_64 + - match: '\b__USE_(?:ALTREG|SMARTALIGN|FP|IFUNC)__\b' + scope: support.function.asm.x86_64 + - match: '\b__PASS__\b' + scope: invalid.deprecated.support.constant.altreg.asm.x86_64 + - match: '(?i)\balignmode\b' + scope: support.function.smartalign.asm.x86_64 + push: + - include: line-continuation + - include: line-ending + - match: '\b(?:generic|nop|k7|k8|p6)\b' + scope: support.constant.smartalign.asm.x86_64 + pop: true + - match: '\w+' + scope: invalid.illegal.constant.smartalign.asm.x86_64 + pop: true + - match: '\b__ALIGNMODE__\b' + scope: support.constant.smartalign.asm.x86_64 + - match: '\b(?:Inf|[QS]?NaN)\b' + scope: support.constant.fp.asm.x86_64 + - match: '\b(?:float(?:8|16|32|64|80[me]|128[lh]))\b' + scope: support.function.fp.asm.x86_64 + - match: '(?i)\bilog2(?:[ewfc]|[fc]w)?\b' + scope: support.function.ifunc.asm.x86_64 + + directives: + - match: '(?i)\b(?:ideal|jumps|p[345]86|end)\b' + scope: invalid.deprecated.tasm.asm.x86_64 + - match: '(?i)\b(?:bits|use(?:16|32|64)|org|uppercase|safeseh|osabi)\b' + scope: support.function.directive.asm.x86_64 + - match: '(?i)\b(default)(?:\s+(rel|abs|(?:no)?bnd))?\b' + captures: + 1: support.function.directive.asm.x86_64 + 2: support.constant.directive.asm.x86_64 + - match: '(?i)\b(?:section|segment)\b' + scope: support.function.directive.asm.x86_64 + push: [section-parameters, section-name] + - match: '(?i)\bgroup\b' + scope: support.function.directive.asm.x86_64 + push: section-name + - match: '\b(?:__SECT__|__NASMDEFSEG|_?_GLOBAL_OFFSET_TABLE_)\b' + scope: support.constant.directive.asm.x86_64 + - match: '(?i)\b(?:absolute|common)\b' + scope: support.function.directive.asm.x86_64 + - match: '(?i)\b(?:subsections_via_symbols|no_dead_strip)\b' + scope: support.function.directive.macho.asm.x86_64 + - match: '(?i)import\b' + scope: support.function.directive.asm.x86_64 + push: + - match: '{{valid_identifier}}' + scope: entity.name.function.asm.x86_64 + set: + - match: '{{valid_identifier}}' + scope: meta.path.asm.x86_64 string.unquoted.asm.x86_64 + set: + - match: '{{valid_identifier}}' + scope: variable.function.asm.x86_64 + set: + - include: comments + - match: '{{valid_identifier}}' + scope: invalid.illegal.asm.x86_64 + - include: line-continuation + - include: pop-if-not-whitespace + - include: line-ending + - include: line-continuation + - include: pop-if-not-whitespace + - include: line-ending + - include: line-continuation + - include: pop-if-not-whitespace + - include: line-ending + - include: line-continuation + - include: pop-if-not-whitespace + - include: line-ending + - match: '(?i)export\b' + scope: support.function.directive.asm.x86_64 + push: + - match: '{{valid_identifier}}' + scope: entity.name.constant.asm.x86_64 + set: + - match: '{{valid_identifier}}' + scope: variable.function.asm.x86_64 + set: export-parameters + - include: line-continuation + - include: pop-if-not-whitespace + - include: line-ending + - include: line-continuation + - include: pop-if-not-whitespace + - include: line-ending + - match: '(?i)global\b' + scope: support.function.directive.asm.x86_64 + push: + - match: '(?<=\:)(?:function|data|export)\b' + scope: storage.type.directive.asm.x86_64 + - match: '\b(?:default|internal|hidden|protected|proc|data)\b' + scope: storage.modifier.directive.asm.x86_64 variable.parameter.directive.asm.x86_64 + - include: line-continuation + - include: line-ending + - include: preprocessor-macro-parameter + - include: main + - match: '(?i)extern\b' + scope: support.function.directive.asm.x86_64 + push: + - match: '(?<=\:)(?:import)\b' + scope: storage.type.directive.asm.x86_64 + - match: '\b(?:proc|data)\b' + scope: storage.modifier.directive.asm.x86_64 variable.parameter.directive.asm.x86_64 + - include: line-continuation + - include: line-ending + - include: preprocessor-macro-parameter + - include: main + - match: '(?i)library\b' + scope: support.function.directive.asm.x86_64 + push: + - match: '{{valid_identifier}}' + scope: meta.path.asm.x86_64 string.unquoted.asm.x86_64 + pop: true + - include: line-continuation + - include: line-ending + - include: pop-if-not-whitespace + - match: '(?i)module\b' + scope: support.function.directive.asm.x86_64 + push: + - match: '\$?{{valid_identifier}}' + scope: entity.name.namespace.asm.x86_64 + pop: true + - include: line-continuation + - include: line-ending + - include: pop-if-not-whitespace + - match: '(?i)\bcpu\b' + scope: support.function.directive.asm.x86_64 + push: + - match: '(?i)\b(?:(?:80|[1-6])86|pentium|ppro|p[234]|katmai|willamette|prescott|(?:x|ia)64)\b' + scope: support.constant.directive.asm.x86_64 + pop: true + - include: line-continuation + - include: pop-if-not-whitespace + - include: line-ending + - include: main + - match: '(?i)\bfloat\b' + scope: support.function.directive.asm.x86_64 + push: + - match: '(?i)\b(?:(?:no)?daz|near|up|down|zero|default)\b' + scope: support.constant.directive.asm.x86_64 + pop: true + - include: line-continuation + - include: pop-if-not-whitespace + - include: line-ending + - include: main + - match: '(?i)(\[)\s*(warning)\b' + captures: + 2: support.function.directive.asm.x86_64 + push: + - match: '(?i)([+\-*])|(error)\s*(=)\s*' + captures: + 1: keyword.control.warning.asm.x86_64 + 2: support.constant.directive.warning.asm.x86_64 + 3: keyword.operator.assignment.asm.x86_64 + push: + - match: '(?i)\b(other|macro-(?:params|selfref|defaults)|orphan-labels|number-overflow|gnu-elf-extensions|float-(?:overflow|denorm|underflow|toolong)|user|lock|hle|bnd|zext-reloc|ptr|(?:bad|unknown|not-my)-pragma|unknown-warning|all)(?=\]|\s)' + scope: support.constant.directive.warning.asm.x86_64 + pop: true + - match: '\S+(?=\])' + scope: invalid.illegal.support.constant.directive.warning.asm.x86_64 + pop: true + - match: '\S+' + scope: invalid.illegal.support.constant.directive.warning.asm.x86_64 + pop: true + - match: '(?i)\b(?:all|error)\b' + scope: support.constant.directive.warning.asm.x86_64 + - match: ']' + pop: true + - include: line-continuation + - include: line-ending + - match: '(?i)(\[)\s*(map)\b' + captures: + 2: support.function.directive.asm.x86_64 + push: + - match: '(?i)\b(?:all|brief|sections|segments|symbols)\b' + scope: support.constant.directive.map.asm.x86_64 + - match: '(?i)\b(?:std(?:out|err))\b' + scope: meta.path.asm.x86_64 support.constant.directive.map.asm.x86_64 + - match: '{{valid_identifier}}' + scope: meta.path.asm.x86_64 string.unquoted.asm.x86_64 + - match: ']' + pop: true + - include: line-continuation + - include: line-ending + section-parameters: + - match: '=' + scope: keyword.operator.assignment.asm.x86_64 + - match: '(?i)\b(?:(?:v)?start|align|absolute)\b' + scope: variable.parameter.directive.asm.x86_64 + - match: '(?i)\b(?:(?:prog|no)bits|private|public|common|stack|code|text|data|bss|rdata|info)\b' + scope: storage.modifier.directive.asm.x86_64 variable.parameter.directive.asm.x86_64 + - match: '(?i)\b(?:mixed|zerofill|no_dead_strip|live_support|strip_static_syms)\b' + scope: storage.modifier.directive.asm.x86_64 variable.parameter.directive.macho.asm.x86_64 + - match: '(?i)\b(?:(?:no)?(?:alloc|exec|write)|tls)\b' + scope: storage.modifier.directive.asm.x86_64 variable.parameter.directive.elf.asm.x86_64 + - match: '(?i)\b(?:(?:v)?follows)\b' + scope: variable.parameter.directive.asm.x86_64 + push: + - match: '=' + scope: keyword.operator.assignment.asm.x86_64 + set: [pop, section-name] + - include: line-continuation + - include: line-ending + - match: '(?i)\b(?:class|overlay)\b' + scope: variable.parameter.directive.asm.x86_64 + push: + - match: '=' + scope: keyword.operator.assignment.asm.x86_64 + - match: '{{valid_identifier}}' + scope: entity.name.class.asm.x86_64 string.unquoted.asm.x86_64 + pop: true + - include: line-continuation + - include: line-ending + - include: line-continuation + - include: line-ending + - include: main + section-name: + - match: '(?:\.|\b)(?:text|bss|(?:[rpx]|ro)?data|code)\b' + scope: entity.name.section.asm.x86_64 string.unquoted.asm.x86_64 support.constant.section.asm.x86_64 + pop: true + - match: '\b__(?:text|const|data|bss|TEXT|CONST|DATA|BSS)\b' + scope: entity.name.section.asm.x86_64 string.unquoted.asm.x86_64 support.constant.section.macho.asm.x86_64 + pop: true + - match: '(?:\.)(?:[lt](?:data|bss)|lrodata|comment)\b' + scope: entity.name.section.asm.x86_64 string.unquoted.asm.x86_64 support.constant.section.elf.asm.x86_64 + pop: true + - match: '(?:\.|\b){{valid_identifier}}\b' + scope: entity.name.section.asm.x86_64 string.unquoted.asm.x86_64 + pop: true + - match: '(?=`|''|")' + set: + - meta_scope: entity.name.section.asm.x86_64 + - include: strings + - include: pop + - include: line-continuation + - include: pop-if-not-whitespace + - include: line-ending + export-parameters: + - match: '=' + scope: keyword.operator.assignment.asm.x86_64 + - match: '(?i)\b(?:resident|nodata)\b' + scope: storage.modifier.directive.asm.x86_64 variable.parameter.directive.asm.x86_64 + - match: '(?i)\b(?:parm)\b' + scope: variable.parameter.directive.asm.x86_64 + - include: primitive-directive-end + - include: line-continuation + - include: line-ending + - include: main + + operators: + - match: '[+\-*/]' + scope: keyword.operator.arithmetic.asm.x86_64 + - match: '(%%|%)[[:space:]]' + captures: + 1: keyword.operator.arithmetic.asm.x86_64 + - match: '[|&^~!]|<<|>>' + scope: keyword.operator.bitwise.asm.x86_64 + - match: '(?i)\b(seg|wrt)\b' + scope: keyword.operator.word.asm.x86_64 + - match: ',' + scope: operator.separator.asm.x86_64 + + structs: + - match: '(?i)\bstruc\b' + scope: support.function.asm.x86_64 meta.struct.asm.x86_64 + push: + - meta_content_scope: meta.struct.asm.x86_64.1 + - match: '{{valid_identifier}}' + scope: entity.name.struct.asm.x86_64 + set: + - meta_scope: meta.struct.asm.x86_64 + - match: '(?i)\bendstruc\b' + scope: support.function.asm.x86_64 meta.struct.asm.x86_64 + pop: true + - include: main + - match: '\w' + scope: invalid.illegal.entity.name.struct.asm.x86_64 + - match: '(?i)\bendstruc\b' + scope: invalid.illegal.support.function.asm.x86_64 meta.struct.asm.x86_64 + - match: '(?i)\bistruc\b' + scope: support.function.asm.x86_64 meta.struct.asm.x86_64 + push: + - meta_content_scope: meta.struct.asm.x86_64.1 + - match: '{{valid_identifier}}' + scope: variable.other.asm.x86_64 + set: + - meta_scope: meta.struct.asm.x86_64 + - match: '(?i)\bat\b' + scope: support.function.asm.x86_64 meta.struct.asm.x86_64 + - match: '(?i)\biend\b' + scope: support.function.asm.x86_64 meta.struct.asm.x86_64 + pop: true + - include: main + - match: '\w' + scope: invalid.illegal.variable.struct.asm.x86_64 + - match: '(?i)\biend\b' + scope: invalid.illegal.support.function.asm.x86_64 meta.struct.asm.x86_64 + - match: '(?i)\balignb?\b' + scope: support.function.asm.x86_64 + - match: '(?i)\b(sectalign)\s+(on|off)?' + captures: + 1: support.function.asm.x86_64 + 2: support.constant.asm.x86_64 + + entities: + - match: '\$@feat\.00\b' + scope: variable.language.sseh.asm.x86_64 + - match: '(\$)(?:\w+)\b' + scope: variable.other.asm.x86_64 + captures: + 1: punctuation.definition.variable.asm.x86_64 + - match: '\${3,}' + scope: invalid.illegal.variable.language.asm.x86_64 + - match: '\$' + scope: variable.language.asm.x86_64 + + comments: + - match: (?:(;)|(?:^|\s)(#)\s).*$ + scope: comment.line.asm.x86_64 + captures: + 1: punctuation.definition.comment.asm.x86_64 + 2: punctuation.definition.comment.asm.x86_64 + - match: /\* + scope: punctuation.definition.comment.asm.x86_64 + push: + - meta_scope: comment.block.asm.x86_64 + - match: \*/ + scope: punctuation.definition.comment.asm.x86_64 + pop: true + + preprocessor: # http://www.nasm.us/doc/nasmdoc4.html + - include: preprocessor-macro-multiline + - include: preprocessor-macro-define + - include: preprocessor-macro-indirection + - include: preprocessor-conditions + - include: preprocessor-other + # single-line macro + preprocessor-macro-define: + - match: '^\s*((%)x?i?define)\b' + captures: + 1: meta.preprocessor.macro.asm.x86_64 keyword.control.import.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + push: + - meta_content_scope: meta.preprocessor.macro.asm.x86_64 + - include: preprocessor-comments + - match: '(?:{{valid_identifier}})(?=\()' + scope: entity.name.function.preprocessor.asm.x86_64 + set: + - match: '\(' + scope: punctuation.section.group.begin.asm.x86_64 + set: preprocessor-macro-params + - match: '{{valid_identifier}}' + scope: entity.name.constant.preprocessor.asm.x86_64 + set: preprocessor-macro-definition + - include: line-continuation + - include: pop-if-not-whitespace + - include: line-ending + - match: '^\s*((%)(?:include|depend))\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.import.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + push: preprocessor-macro-definition + - match: '^\s*((%)use)\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.import.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + push: + - meta_content_scope: meta.preprocessor.macro.asm.x86_64 string.unquoted.asm.x86_64 + - include: strings + - include: line-ending + - include: preprocessor-macro-indirection + - match: '^\s*((%)(?:assign|i?deftok|strcat|strlen|substr|pathsearch|push|pop|repl|line|clear))\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + push: + - meta_content_scope: meta.preprocessor.macro.asm.x86_64 + - include: preprocessor-macro-indirection + - include: preprocessor-conditions-constant + - match: '^\s*((%)(?:arg|local))\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + push: + - meta_content_scope: meta.preprocessor.macro.asm.x86_64 + - match: '({{valid_identifier}})(\:)(?=\w+)' + captures: + 1: meta.preprocessor.asm.x86_64 variable.parameter.macro.asm.x86_64 + 2: punctuation.separator.asm.x86_64 + - match: '\,' + scope: punctuation.separator.asm.x86_64 + - include: data-types + - match: '\w+\b' + scope: invalid.illegal.storage.type.asm.x86_64 + - include: line-continuation + - include: line-ending + - match: '^\s*((%)stacksize)\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + push: + - meta_content_scope: meta.preprocessor.macro.asm.x86_64 + - match: '\b(flat(?:64)?|large|small)\b' + scope: support.constant.macro.asm.x86_64 + - match: '\w+\b' + scope: invalid.illegal.storage.type.asm.x86_64 + - include: line-continuation + - include: line-ending + - match: '^\s*((%)i?defstr)\s+(?:({{valid_identifier}})|(%%)({{valid_identifier}}))\b' + captures: + 1: meta.preprocessor.macro.asm.x86_64 keyword.control.import.preprocessor.assign.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + 3: entity.name.constant.preprocessor.asm.x86_64 + 4: punctuation.definition.keyword.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 5: entity.name.constant.special.asm.x86_64 + push: + - meta_content_scope: meta.preprocessor.macro.asm.x86_64 string.unquoted.asm.x86_64 + - include: preprocessor-macro-indirection + - include: line-ending + - match: '^\s*((%)(?:warning|error|fatal|pragma))(?=\s|$)' + captures: + 1: meta.preprocessor.macro.asm.x86_64 keyword.control.preprocessor.assign.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + 3: entity.name.constant.preprocessor.asm.x86_64 + push: + - meta_content_scope: meta.preprocessor.macro.asm.x86_64 string.unquoted.asm.x86_64 + - include: strings + - include: preprocessor-macro-indirection + - include: line-ending + preprocessor-macro-params-illegal: + - meta_scope: invalid.illegal.asm.x86_64 + - include: preprocessor-macro-params + preprocessor-macro-params: + - meta_scope: meta.preprocessor.macro.parameters.asm.x86_64 meta.group.asm.x86_64 + - match: '{{valid_identifier}}' + scope: variable.parameter.asm.x86_64 + - match: '\)' + scope: punctuation.section.group.end.asm.x86_64 + set: preprocessor-macro-definition + - match: ',' + scope: punctuation.separator.asm.x86_64 + push: + - match: '{{valid_identifier}}' + scope: variable.parameter.asm.x86_64 + pop: true + - include: line-continuation + - include: preprocessor-comments + - match: '\.\.\.' + scope: keyword.operator.variadic.asm.x86_64 + - match: '(?=\))' + pop: true + - match: '(/\*).*(\*/)' + scope: comment.block.asm.x86_64 + captures: + 1: punctuation.definition.comment.asm.x86_64 + 2: punctuation.definition.comment.asm.x86_64 + - match: '\S+' + scope: invalid.illegal.unexpected-character.asm.x86_64 + - include: line-continuation + - include: preprocessor-comments + - match: '\.\.\.' + scope: keyword.operator.variadic.asm.x86_64 + - match: '(/\*).*(\*/)' + scope: comment.block.asm.x86_64 + captures: + 1: punctuation.definition.comment.asm.x86_64 + 2: punctuation.definition.comment.asm.x86_64 + - match: '$\n' + scope: invalid.illegal.unexpected-end-of-line.asm.x86_64 + preprocessor-macro-definition: + - meta_content_scope: meta.preprocessor.macro.asm.x86_64 + - include: preprocessor-comments + - include: line-continuation + - include: line-ending + - include: main + preprocessor-macro-indirection: + - match: '((%)(\[))' + captures: + 1: meta.preprocessor.macro.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + 3: meta.brackets.asm.x86_64 punctuation.section.brackets.begin.asm.x86_64 + push: + - meta_scope: meta.brackets.asm.x86_64 meta.preprocessor.macro.asm.x86_64 + - include: line-continuation + - include: line-ending + - include: main + - match: '\]' + scope: punctuation.section.brackets.end.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + pop: true + - match: '((%)\+)\s+' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.operator.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + - match: '((%)(\?\??))' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.operator.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + 3: variable.language.preprocessor.asm.x86_64 + - match: '((%\$+)({{valid_identifier}})(?:(\:)?|\b))' + captures: + 1: meta.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 3: entity.name.constant.special.asm.x86_64 + 4: punctuation.separator.asm.x86_64 + - match: '((%)(\!))' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.operator.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + 3: punctuation.definition.variable.asm.x86_64 + push: + - meta_content_scope: meta.preprocessor.asm.x86_64 keyword.operator.preprocessor.asm.x86_64 variable.parameter.preprocessor.environment.asm.x86_64 + - match: '{{valid_identifier}}' + scope: variable.parameter.preprocessor.environment.unquoted.asm.x86_64 + pop: true + - match: '(?=`|''|")' + set: + - meta_scope: variable.parameter.preprocessor.environment.quoted.asm.x86_64 + - include: strings + - include: pop + - include: pop + preprocessor-conditions: # also see preprocessor-macro-conditions-multiline + - match: '^\s*((%)ifn?(?:idni?|id|num|str|token|empty|env)?)\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + push: preprocessor-conditions-content-block + - match: '^\s*((%)ifn?(?:def|ctx))\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + push: [preprocessor-conditions-content-block, preprocessor-conditions-constant] + - match: '^\s*((%)rep)\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + push: preprocessor-conditions-content-block + - match: '^\s*((%)ifn?macro)\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + push: [preprocessor-conditions-content-block, preprocessor-macro-arguments-signature] + - include: preprocessor-conditions-parity + preprocessor-conditions-constant: + - meta_content_scope: meta.preprocessor.asm.x86_64 + - match: '(?:{{valid_identifier}})(?=\()' + scope: entity.name.constant.preprocessor.asm.x86_64 + set: + - match: '\(' + scope: punctuation.section.group.begin.asm.x86_64 + set: preprocessor-macro-params-illegal + - match: '{{valid_identifier}}\b' + scope: meta.preprocessor.asm.x86_64 entity.name.constant.preprocessor.asm.x86_64 + pop: true + - include: line-continuation + - include: pop-if-not-whitespace + - include: line-ending + - include: main + preprocessor-conditions-content-block: + - meta_content_scope: meta.block.preprocessor.asm.x86_64 + - include: preprocessor-conditions-content-block-common + - include: main + preprocessor-conditions-content-block-common: + - match: '^\s*((%)(?:elifn?(?:idni?|id|num|str|token|empty|env)?|else|exitrep))\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + - match: '^\s*((%)(?:elifn?(?:def|ctx)))\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + push: preprocessor-conditions-constant + - match: '^\s*((%)elifn?macro)\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + push: preprocessor-macro-arguments-signature + - match: '^\s*((%)(?:end(?:if|rep)))\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + pop: true + preprocessor-conditions-parity: + - match: '^\s*((%)(?:elifn?(?:macro|def|ctx|idni?|id|num|str|token|empty|env)?|else|(?:end(?:if|rep))|exitrep))\b' + captures: + 1: invalid.illegal.meta.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + preprocessor-other: + - include: preprocessor-macro-indirection + - match: '^\s*((%)undef)\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + push: + - meta_scope: meta.preprocessor.asm.x86_64 + - include: line-continuation + - include: line-ending + - include: preprocessor-comments + - match: '{{valid_identifier}}' + scope: entity.name.constant.preprocessor.asm.x86_64 + pop: true + - match: '^\s*((%)unmacro)\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.import.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + push: preprocessor-macro-arguments-signature + preprocessor-macro-arguments-signature: + - meta_scope: meta.preprocessor.asm.x86_64 + - include: preprocessor-comments + - match: '({{valid_identifier}})(?:\s+(?:(\d+(?:(-)(?:\d+|\*))?)(\+)?(\.nolist\b)?))' + captures: + 1: entity.name.function.preprocessor.asm.x86_64 + 2: variable.parameter.preprocessor.asm.x86_64 + 3: keyword.operator.preprocessor.range.asm.x86_64 + 4: storage.modifier.preprocessor.greedy.asm.x86_64 + 5: storage.modifier.preprocessor.listing.asm.x86_64 + pop: true + - include: line-continuation + - include: pop-if-not-whitespace + - include: line-ending + # multi-line macro + preprocessor-macro-multiline: + - match: '^\s*((%)i?macro)\b' + captures: + 1: meta.preprocessor.macro.asm.x86_64 keyword.control.import.define.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + push: + - meta_content_scope: meta.preprocessor.macro.asm.x86_64 + - include: preprocessor-comments + - match: '(?:{{valid_identifier}})(?=\()' + scope: entity.name.constant.preprocessor.asm.x86_64 + set: + - meta_content_scope: invalid.illegal.asm.x86_64 + - match: '\(' + scope: punctuation.section.group.begin.asm.x86_64 + set: preprocessor-macro-params-illegal + - match: '({{valid_identifier}})(?:\s+(?:(\d+(?:(-)(?:\d+|\*))?)(\+)?(\.nolist\b)?))' + captures: + 1: entity.name.function.preprocessor.asm.x86_64 + 2: variable.parameter.preprocessor.asm.x86_64 + 3: keyword.operator.preprocessor.range.asm.x86_64 + 4: storage.modifier.preprocessor.greedy.asm.x86_64 + 5: storage.modifier.preprocessor.listing.asm.x86_64 + set: preprocessor-macro-definition-multiline-with-parameters + - match: '^\s*((%)endmacro)\b' + captures: + 1: invalid.illegal.meta.preprocessor.asm.x86_64 keyword.control.import.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + preprocessor-macro-parameter: + - match: '((%)(\-?\d+))' + captures: + 1: meta.preprocessor.asm.x86_64 + 2: punctuation.definition.variable.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 3: variable.other.preprocessor.asm.x86_64 + preprocessor-macro-definition-multiline-with-parameters: + - meta_content_scope: meta.preprocessor.macro.asm.x86_64 + - include: preprocessor-comments + - include: preprocessor-macro-parameter + - include: preprocessor-macro-indirection + - include: preprocessor-macro-conditions-multiline + - include: preprocessor-macro-definition-multiline + preprocessor-macro-definition-multiline: + - meta_content_scope: meta.preprocessor.macro.asm.x86_64 + - include: preprocessor-comments + - match: '^\s*((%)endmacro)\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.import.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + pop: true + - match: '((%%)({{valid_identifier}})(?:(\:)?|\b))' + captures: + 1: meta.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 3: entity.name.constant.special.asm.x86_64 + 4: punctuation.separator.asm.x86_64 + - match: '((%)({))' + captures: + 1: meta.preprocessor.macro.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + 3: meta.braces.asm.x86_64 punctuation.section.braces.begin.asm.x86_64 + push: + - meta_scope: meta.braces.asm.x86_64 meta.preprocessor.macro.asm.x86_64 + - include: preprocessor-macro-indirection + - match: ':' + scope: punctuation.separator.asm.x86_64 + - match: '}' + scope: punctuation.section.braces.end.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + pop: true + - match: '^\s*((%)(?:rotate))\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.operator.word.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + - match: '^\s*((%)(?:include|depend))\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.import.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + set: preprocessor-macro-definition-multiline-with-parameters + - match: '^\s*((%)(?:pathsearch))\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + set: [preprocessor-macro-definition-multiline-with-parameters, preprocessor-conditions-constant] + - match: '^\s*((%)x?i?define)\b' + captures: + 1: meta.preprocessor.macro.asm.x86_64 keyword.control.import.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + push: + - meta_content_scope: meta.preprocessor.macro.asm.x86_64 + - include: preprocessor-comments + - match: '(?:{{valid_identifier}})(?=\()' + scope: entity.name.function.preprocessor.asm.x86_64 + set: + - match: '\(' + scope: punctuation.section.group.begin.asm.x86_64 + set: preprocessor-macro-params + - match: '{{valid_identifier}}' + scope: entity.name.constant.preprocessor.asm.x86_64 + set: preprocessor-macro-definition-inside-multiline + - include: line-continuation + - include: pop-if-not-whitespace + - include: line-ending + + - include: preprocessor-macro-indirection + - include: preprocessor-conditions + - include: main + preprocessor-macro-conditions-multiline: # also see preprocessor-conditions + - match: '^\s*((%)ifn?(?:idni?|id|num|str|token|empty|env)?)\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + push: preprocessor-conditions-content-block-multiline + - match: '^\s*((%)ifn?(?:def|ctx))\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + push: [preprocessor-conditions-content-block-multiline, preprocessor-conditions-constant] + - match: '^\s*((%)rep)\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + push: preprocessor-conditions-content-block-multiline + - match: '^\s*((%)ifn?macro)\b' + captures: + 1: meta.preprocessor.asm.x86_64 keyword.control.preprocessor.asm.x86_64 + 2: punctuation.definition.keyword.preprocessor.asm.x86_64 + push: [preprocessor-macro-arguments-signature, preprocessor-conditions-content-block-multiline] + - include: preprocessor-conditions-parity + preprocessor-conditions-content-block-multiline: + - meta_content_scope: meta.block.preprocessor.asm.x86_64 + - include: preprocessor-conditions-content-block-common + - include: preprocessor-macro-definition-multiline-with-parameters + preprocessor-macro-definition-inside-multiline: + - meta_content_scope: meta.preprocessor.macro.asm.x86_64 + - include: preprocessor-macro-parameter + - include: preprocessor-macro-definition + + strings: # Character strings: http://www.nasm.us/doc/nasmdoc3.html#section-3.4.2 + - match: '`' + scope: punctuation.definition.string.begin.asm.x86_64 + push: string-backquote + - match: '''' + scope: punctuation.definition.string.begin.asm.x86_64 + push: string-single + - match: '"' + scope: punctuation.definition.string.begin.asm.x86_64 + push: string-double + string-content: + - match: '\\u[[:xdigit:]]{4}' + scope: constant.character.escape.asm.x86_64 + - match: '\\U[[:xdigit:]]{8}' + scope: constant.character.escape.asm.x86_64 + - match: '\\x[[:xdigit:]]{1,2}' + scope: constant.character.escape.asm.x86_64 + - match: '\\[0-7]{1,3}' + scope: constant.character.escape.asm.x86_64 + - match: '\\[''"`\\?abtnvfre]' + scope: constant.character.escape.asm.x86_64 + - match: '\\.' + scope: invalid.illegal.constant.character.escape.asm.x86_64 + string-backquote: + - meta_scope: string.quoted.other.asm.x86_64 + - meta_include_prototype: false + - include: string-content + - match: '`' + scope: punctuation.definition.string.end + pop: true + string-single: + - meta_scope: string.quoted.single.asm.x86_64 + - meta_include_prototype: false + - match: '''' + scope: punctuation.definition.string.end + pop: true + string-double: + - meta_scope: string.quoted.double.asm.x86_64 + - meta_include_prototype: false + - match: '"' + scope: punctuation.definition.string.end + pop: true + + registers: + - match: '(?i)\b(?:[abcd][hl]|[er]?[abcd]x|[er]?(?:di|si|bp|sp)|dil|sil|bpl|spl|r(?:8|9|1[0-5])[bdlw]?)\b' + scope: constant.language.register.general-purpose.asm.x86_64 + - match: '(?i)\b(?:[cdefgs]s)\b' + scope: constant.language.register.segment.asm.x86_64 + - match: '(?i)\b(?:[er]?flags)\b' + scope: constant.language.register.flags.asm.x86_64 + - match: '(?i)\b(?:[er]?ip)\b' + scope: constant.language.register.instruction-pointer.asm.x86_64 + - match: '(?i)\b(?:cr[02-4])\b' + scope: constant.language.register.control.asm.x86_64 + - match: '(?i)\b(?:(?:mm|st|fpr)[0-7])\b' + scope: constant.language.register.mmx.asm.x86_64 + - match: '(?i)\b(?:[xy]mm(?:[0-9]|1[0-5])|mxcsr)\b' + scope: constant.language.register.sse_avx.asm.x86_64 + - match: '(?i)\b(?:zmm(?:[12]?[0-9]|30|31))\b' + scope: constant.language.register.avx512.asm.x86_64 + - match: '(?i)\b(?:bnd(?:[0-3]|cfg[su]|status))\b' + scope: constant.language.register.memory-protection.asm.x86_64 + - match: '(?i)\b(?:(?:[gil]dt)r?|tr)\b' + scope: constant.language.register.system-table-pointer.asm.x86_64 + - match: '(?i)\b(?:dr[0-367])\b' + scope: constant.language.register.debug.asm.x86_64 + - match: '(?i)\b(?:cr8|dr(?:[89]|1[0-5])|efer|tpr|syscfg)\b' + scope: constant.language.register.amd.asm.x86_64 + - match: '(?i)\b(?:db[0-367]|t[67]|tr[3-7]|st)\b' + scope: invalid.deprecated.constant.language.register.asm.x86_64 + - match: '(?i)\b[xy]mm(?:1[6-9]|2[0-9]|3[01])\b' + scope: invalid.deprecated.constant.language.register.asm.x86_64 + + mnemonics: # see valid.asm for references + - include: mnemonics-general-purpose + - include: mnemonics-fpu + - include: mnemonics-mmx + - include: mnemonics-sse + - include: mnemonics-sse2 + - include: mnemonics-sse3 + - include: mnemonics-sse4 + - include: mnemonics-aesni + - include: mnemonics-avx + - include: mnemonics-avx2 + - include: mnemonics-tsx + - include: mnemonics-system + - include: mnemonics-64bit + - include: mnemonics-vmx + - include: mnemonics-smx + - include: mnemonics-intel-isa-sgx + - include: mnemonics-intel-isa-mpx + - include: mnemonics-intel-isa-sha + - include: mnemonics-supplemental-amd + - include: mnemonics-supplemental-cyrix + - include: mnemonics-supplemental-via + - include: mnemonics-undocumented + - include: mnemonics-future-intel + - include: mnemonics-pseudo-ops + #- include: mnemonics-invalid + mnemonics-general-purpose: + - match: '(?i)\b(?:mov(?:[sz]x)?|cmov(?:n?[abceglopsz]|n?[abgl]e|p[eo]))\b' + scope: keyword.operator.word.mnemonic.general-purpose.data-transfer.mov + - match: '(?i)\b(xchg|bswap|xadd|cmpxchg(8b)?)\b' + scope: keyword.operator.word.mnemonic.general-purpose.data-transfer.xchg + - match: '(?i)\b((push|pop)(ad?)?|cwde?|cdq|cbw)\b' + scope: keyword.operator.word.mnemonic.general-purpose.data-transfer.other + - match: '(?i)\b(adcx?|adox|add|sub|sbb|i?mul|i?div|inc|dec|neg|cmp)\b' + scope: keyword.operator.word.mnemonic.general-purpose.binary-arithmetic + - match: '(?i)\b(daa|das|aaa|aas|aam|aad)\b' + scope: keyword.operator.word.mnemonic.general-purpose.decimal-arithmetic + - match: '(?i)\b(and|x?or|not)\b' + scope: keyword.operator.word.mnemonic.general-purpose.logical + - match: '(?i)\b(s[ah][rl]|sh[rl]d|r[co][rl])\b' + scope: keyword.operator.word.mnemonic.general-purpose.rotate + - match: '(?i)\b(set(n?[abceglopsz]|n?[abgl]e|p[eo]))\b' + scope: keyword.operator.word.mnemonic.general-purpose.bit-and-byte.set + - match: '(?i)\b(bt[crs]?|bs[fr]|test|crc32|popcnt)\b' + scope: keyword.operator.word.mnemonic.general-purpose.bit-and-byte.other + - match: '(?i)\b(jmp|jn?[abceglopsz]|jn?[abgl]e|jp[eo]|j[er]?cxz)\b' + scope: keyword.operator.word.mnemonic.general-purpose.control-transfer.jmp + - match: '(?i)\b(loop(n?[ez])?|call|ret|iret[dq]?|into?|bound|enter|leave)\b' + scope: keyword.operator.word.mnemonic.general-purpose.control-transfer.other + - match: '(?i)\b((mov|cmp|sca|lod|sto)(s[bdw]?)|rep(n?[ez])?)\b' + scope: keyword.operator.word.mnemonic.general-purpose.strings + - match: '(?i)\b((in|out)(s[bdw]?)?)\b' + scope: keyword.operator.word.mnemonic.general-purpose.io + - match: '(?i)\b((st|cl)[cdi]|cmc|[ls]ahf|(push|pop)f[dq]?)\b' + scope: keyword.operator.word.mnemonic.general-purpose.flag-control + - match: '(?i)\b(l[defgs]s)\b' + scope: keyword.operator.word.mnemonic.general-purpose.segment-registers + - match: '(?i)\b(lea|nop|ud2|xlatb?|cpuid|movbe)\b' + scope: keyword.operator.word.mnemonic.general-purpose.misc + - match: '(?i)\b(rdrand|rdseed)\b' + scope: keyword.operator.word.mnemonic.general-purpose.rng + - match: '(?i)\b(andn|bextr|bls(i|r|msk)|bzhi|pdep|pext|[lt]zcnt|(mul|ror|sar|shl|shr)x)\b' + scope: keyword.operator.word.mnemonic.general-purpose.bmi + mnemonics-fpu: + - match: '(?i)\b(fcmov(n?([beu]|be)))\b' + scope: keyword.operator.word.mnemonic.fpu.data-transfer.mov + - match: '(?i)\b(f(i?(ld|stp?)|b(ld|stp)|xch))\b' + scope: keyword.operator.word.mnemonic.fpu.data-transfer.other + - match: '(?i)\b(f((add|div|mul|sub)p?|i(add|div|mul|sub)|(div|sub)rp?|i(div|sub)r))\b' + scope: keyword.operator.word.mnemonic.fpu.basic-arithmetic.basic + - match: '(?i)\b(f(prem1?|abs|chs|rndint|scale|sqrt|xtract))\b' + scope: keyword.operator.word.mnemonic.fpu.basic-arithmetic.other + - match: '(?i)\b(f(u?com[ip]?p?|icomp?|tst|xam))\b' + scope: keyword.operator.word.mnemonic.fpu.comparison + - match: '(?i)\b(f(sin|cos|sincos|pa?tan|2xm1|yl2x(p1)?))\b' + scope: keyword.operator.word.mnemonic.fpu.transcendental + - match: '(?i)\b(fld(1|z|pi|l2[et]|l[ng]2))\b' + scope: keyword.operator.word.mnemonic.fpu.load-constants + - match: '(?i)\b(f((inc|dec)stp|free|n?(init|clex|st[cs]w|stenv|save)|ld(cw|env)|rstor|nop)|f?wait)\b' + scope: keyword.operator.word.mnemonic.fpu.control-management + - match: '(?i)\b(fx(save|rstor)(64)?)\b' + scope: keyword.operator.word.mnemonic.fpu.state-management + mnemonics-mmx: + - match: '(?i)\b(mov[dq])\b' + scope: keyword.operator.word.mnemonic.mmx.data-transfer + - match: '(?i)\b(pack(ssdw|[su]swb)|punpck[hl](bw|dq|wd))\b' + scope: keyword.operator.word.mnemonic.mmx.conversion + - match: '(?i)\b(p(((add|sub)(d|(u?s)?[bw]))|maddwd|mul[lh]w))\b' + scope: keyword.operator.word.mnemonic.mmx.packed-arithmetic + - match: '(?i)\b(pcmp((eq|gt)[bdw]))\b' + scope: keyword.operator.word.mnemonic.mmx.comparison + - match: '(?i)\b(pandn?|px?or)\b' + scope: keyword.operator.word.mnemonic.mmx.logical + - match: '(?i)\b(ps([rl]l[dwq]|raw|rad))\b' + scope: keyword.operator.word.mnemonic.mmx.shift-and-rotate + - match: '(?i)\b(emms)\b' + scope: keyword.operator.word.mnemonic.mmx.state-management + mnemonics-sse: + - match: '(?i)\b(mov(([ahlu]|hl|lh|msk)ps|ss))\b' + scope: keyword.operator.word.mnemonic.sse.data-transfer + - match: '(?i)\b((add|div|max|min|mul|rcp|r?sqrt|sub)[ps]s)\b' + scope: keyword.operator.word.mnemonic.sse.packed-arithmetic + - match: '(?i)\b(cmp[ps]s|u?comiss)\b' + scope: keyword.operator.word.mnemonic.sse.comparison + - match: '(?i)\b((andn?|x?or)ps)\b' + scope: keyword.operator.word.mnemonic.sse.logical + - match: '(?i)\b((shuf|unpck[hl])ps)\b' + scope: keyword.operator.word.mnemonic.sse.shuffle-and-unpack + - match: '(?i)\b(cvt(pi2ps|si2ss|ps2pi|tps2pi|ss2si|tss2si))\b' + scope: keyword.operator.word.mnemonic.sse.conversion + - match: '(?i)\b((ld|st)mxcsr)\b' + scope: keyword.operator.word.mnemonic.sse.state-management + - match: '(?i)\b(p(avg[bw]|extrw|insrw|(max|min)(sw|ub)|sadbw|shufw|mulhuw|movmskb))\b' + scope: keyword.operator.word.mnemonic.sse.simd-integer + - match: '(?i)\b(maskmovq|movntps|sfence)\b' + scope: keyword.operator.word.mnemonic.sse.cacheability-control + - match: '(?i)\b(prefetch(nta|t[0-2]|w(t1)?))\b' + scope: keyword.operator.word.mnemonic.sse.prefetch + mnemonics-sse2: + - match: '(?i)\b(mov([auhl]|msk)pd)\b' + scope: keyword.operator.word.mnemonic.sse2.data-transfer + - match: '(?i)\b((add|div|max|min|mul|sub|sqrt)[ps]d)\b' + scope: keyword.operator.word.mnemonic.sse2.packed-arithmetic + - match: '(?i)\b((andn?|x?or)pd)\b' + scope: keyword.operator.word.mnemonic.sse2.logical + - match: '(?i)\b((cmpp|u?comis)d)\b' + scope: keyword.operator.word.mnemonic.sse2.compare + - match: '(?i)\b((shuf|unpck[hl])pd)\b' + scope: keyword.operator.word.mnemonic.sse2.shuffle-and-unpack + - match: '(?i)\b(cvt(dq2pd|pi2pd|ps2pd|pd2ps|si2sd|sd2ss|ss2sd|t?(pd2dq|pd2pi|sd2si)))\b' + scope: keyword.operator.word.mnemonic.sse2.conversion + - match: '(?i)\b(cvt(dq2ps|ps2dq|tps2dq))\b' + scope: keyword.operator.word.mnemonic.sse2.packed-floating-point + - match: '(?i)\b(mov(dq[au]|q2dq|dq2q))\b' + scope: keyword.operator.word.mnemonic.sse2.simd-integer.mov + - match: '(?i)\b(p((add|sub|(s[lr]l|mulu|unpck[hl]q)d)q|shuf(d|[hl]w)))\b' + scope: keyword.operator.word.mnemonic.sse2.simd-integer.other + - match: '(?i)\b(clflush|[lm]fence|pause|maskmovdqu|movnt(dq|i|pd))\b' + scope: keyword.operator.word.mnemonic.sse2.cacheability-control + mnemonics-sse3: + - match: '(?i)\b(fisttp|lddqu|(addsub|h(add|sub))p[sd]|mov(sh|sl|d)dup|monitor|mwait)\b' + scope: keyword.operator.word.mnemonic.sse3 + - match: '(?i)\b(ph(add|sub)(s?w|d))\b' + scope: keyword.operator.word.mnemonic.sse3.supplimental.horizontal-packed-arithmetic + - match: '(?i)\b(p((abs|sign)[bdw]|maddubsw|mulhrsw|shufb|alignr))\b' + scope: keyword.operator.word.mnemonic.sse3.supplimental.other + mnemonics-sse4: + - match: '(?i)\b(pmul(ld|dq)|dpp[ds])\b' + scope: keyword.operator.word.mnemonic.sse4.1.arithmetic + - match: '(?i)\b(movntdqa)\b' + scope: keyword.operator.word.mnemonic.sse4.1.load-hint + - match: '(?i)\b(blendv?p[ds]|pblend(vb|w))\b' + scope: keyword.operator.word.mnemonic.sse4.1.packed-blending + - match: '(?i)\b(p(min|max)(u[dw]|s[bd]))\b' + scope: keyword.operator.word.mnemonic.sse4.1.packed-integer + - match: '(?i)\b(round[ps][sd])\b' + scope: keyword.operator.word.mnemonic.sse4.1.packed-floating-point + - match: '(?i)\b((extract|insert)ps|p((ins|ext)(r[bdq])))\b' + scope: keyword.operator.word.mnemonic.sse4.1.insertion-and-extraction + - match: '(?i)\b(pmov([sz]x(b[dqw]|dq|wd|wq)))\b' + scope: keyword.operator.word.mnemonic.sse4.1.conversion + - match: '(?i)\b(mpsadbw|phminposuw|ptest|pcmpeqq|packusdw)\b' + scope: keyword.operator.word.mnemonic.sse4.1.other + - match: '(?i)\b(pcmp([ei]str[im]|gtq))\b' + scope: keyword.operator.word.mnemonic.sse4.2 + mnemonics-aesni: + - match: '(?i)\b(aes((dec|enc)(last)?|imc|keygenassist)|pclmulqdq)\b' + scope: keyword.operator.word.mnemonic.aesni + mnemonics-avx: + - match: '(?i)\b(v((test|permil|maskmov)p[ds]|zero(all|upper)|(perm2|insert|extract|broadcast)f128|broadcasts[ds]))\b' + scope: keyword.operator.word.mnemonic.avx + - match: '(?i)\b(vaes((dec|enc)(last)?|imc|keygenassist)|vpclmulqdq)\b' + scope: keyword.operator.word.mnemonic.avx.promoted.aes + - match: '(?i)\b(v((cmp[ps]|u?comis)[ds]|pcmp([ei]str[im]|(eq|gt)[bdqw])))\b' + scope: keyword.operator.word.mnemonic.avx.promoted.comparison + - match: '(?i)\b(v(cvt(dq2pd|dq2ps|pd2ps|ps2pd|sd2ss|si2sd|si2ss|ss2sd|t?(pd2dq|ps2dq|sd2si|ss2si))))\b' + scope: keyword.operator.word.mnemonic.avx.promoted.conversion + - match: '(?i)\b(vh((add|sub)p[ds])|vph((add|sub)([dw]|sw)|minposuw))\b' + scope: keyword.operator.word.mnemonic.avx.promoted.horizontal-packed-arithmetic + - match: '(?i)\b(v((andn?|x?or)p[ds]))\b' + scope: keyword.operator.word.mnemonic.avx.promoted.logical + - match: '(?i)\b(v(mov(([ahl]|msk|nt|u)p[ds]|(hl|lh)ps|s([ds]|[hl]dup)|q)))\b' + scope: keyword.operator.word.mnemonic.avx.promoted.mov + - match: '(?i)\b(v((add|div|mul|sub|max|min|round|sqrt)[ps][ds]|(addsub|dp)p[ds]|(rcp|rsqrt)[ps]s))\b' + scope: keyword.operator.word.mnemonic.avx.promoted.packed-arithmetic + - match: '(?i)\b(v(pack[su]s(dw|wb)|punpck[hl](bw|dq|wd|qdq)|unpck[hl]p[ds]))\b' + scope: keyword.operator.word.mnemonic.avx.promoted.packed-conversion + - match: '(?i)\b(vp(shuf([bd]|[hl]w))|vshufp[ds])\b' + scope: keyword.operator.word.mnemonic.avx.promoted.packed-shuffle + - match: '(?i)\b(vp((abs|sign|(max|min)[su])[bdw]|(add|sub)([bdqw]|u?s[bw])|avg[bw]|extr[bdqw]|madd(wd|ubsw)|mul(hu?w|hrsw|l[dw]|u?dq)|sadbw))\b' + scope: keyword.operator.word.mnemonic.avx.promoted.supplemental.arithmetic + - match: '(?i)\b(vp(andn?|x?or))\b' + scope: keyword.operator.word.mnemonic.avx.promoted.supplemental.logical + - match: '(?i)\b(vpblend(vb|w))\b' + scope: keyword.operator.word.mnemonic.avx.promoted.supplemental.blending + - match: '(?i)\b(vpmov(mskb|[sz]x(b[dqw]|w[dq]|dq)))\b' + scope: keyword.operator.word.mnemonic.avx.promoted.supplemental.mov + - match: '(?i)\b(vp(insr[bdqw]|sll(dq|[dqw])|srl(dq)))\b' + scope: keyword.operator.word.mnemonic.avx.promoted.simd-integer + - match: '(?i)\b(vp(sra[dwq]|srl[dqw]))\b' + scope: keyword.operator.word.mnemonic.avx.promoted.shift-and-rotate + - match: '(?i)\b(vblendv?p[ds])\b' + scope: keyword.operator.word.mnemonic.avx.promoted.packed-blending + - match: '(?i)\b(vp(test|alignr))\b' + scope: keyword.operator.word.mnemonic.avx.promoted.packed-other + - match: '(?i)\b(vmov(d(dup|qa|qu)?))\b' + scope: keyword.operator.word.mnemonic.avx.promoted.simd-integer.mov + - match: '(?i)\b(v((extract|insert)ps|lddqu|(ld|st)mxcsr|mpsadbw))\b' + scope: keyword.operator.word.mnemonic.avx.promoted.other + - match: '(?i)\b(v(maskmovdqu|movntdqa?))\b' + scope: keyword.operator.word.mnemonic.avx.promoted.cacheability-control + - match: '(?i)\b(vcvt(ph2ps|ps2ph))\b' + scope: keyword.operator.word.mnemonic.16-bit-floating-point-conversion + - match: '(?i)\b(vfn?m((add|sub)(132|213|231)[ps][ds])|vfm((addsub|subadd)(132|213|231)p[ds]))\b' + scope: keyword.operator.word.mnemonic.fma + mnemonics-avx2: + - match: '(?i)\b(v((broadcast|extract|insert|perm2)i128|pmaskmov[dq]|perm([dsq]|p[sd])))\b' + scope: keyword.operator.word.mnemonic.avx2.promoted.simd + - match: '(?i)\b(vpbroadcast[bdqw])\b' + scope: keyword.operator.word.mnemonic.avx2.promoted.packed + - match: '(?i)\b(vp(blendd|s[lr]lv[dq]|sravd))\b' + scope: keyword.operator.word.mnemonic.avx2.blend + - match: '(?i)\b(vp?gather[dq][dq]|vgather([dq]|dq)p[ds])\b' + scope: keyword.operator.word.mnemonic.avx2.gather + mnemonics-tsx: + - match: '(?i)\b(x(abort|acquire|release|begin|end|test))\b' + scope: keyword.operator.word.mnemonic.tsx + mnemonics-system: + - match: '(?i)\b((cl|st)ac|[ls]([gli]dt|tr|msw)|clts|arpl|lar|lsl|ver[rw]|inv(d|lpg|pcid)|wbinvd)\b' + scope: keyword.operator.word.mnemonic.system + - match: '(?i)\b(lock|hlt|rsm|(rd|wr)(msr|pkru|[fg]sbase)|rd(pmc|tscp?)|sys(enter|exit))\b' + scope: keyword.operator.word.mnemonic.system + - match: '(?i)\b(x((save(c|opt|s)?|rstors?)(64)?|[gs]etbv))\b' + scope: keyword.operator.word.mnemonic.system + mnemonics-64bit: + - match: '(?i)\b(cdqe|cqo|(cmp|lod|mov|sto)sq|cmpxchg16b|mov(ntq|sxd)|scasq|swapgs|sys(call|ret))\b' + scope: keyword.operator.word.mnemonic.64-bit-mode + mnemonics-vmx: + - match: '(?i)\b(vm(ptr(ld|st)|clear|read|write|launch|resume|xo(ff|n)|call|func)|inv(ept|vpid))\b' + scope: keyword.operator.word.mnemonic.vmx + mnemonics-smx: + - match: '(?i)\b(getsec)\b' + scope: keyword.operator.word.mnemonic.smx.getsec + - match: '(?i)\b(capabilities|enteraccs|exitac|senter|sexit|parameters|smctrl|wakeup)\b' + scope: support.constant + mnemonics-intel-isa-sgx: + - match: '(?i)\be(add|block|create|dbg(rd|wr)|extend|init|ld[bu]|pa|remove|track|wb)\b' + scope: keyword.operator.word.mnemonic.sgx1.supervisor + - match: '(?i)\be(enter|exit|getkey|report|resume)\b' + scope: keyword.operator.word.mnemonic.sgx1.user + - match: '(?i)\be(aug|mod(pr|t))\b' + scope: keyword.operator.word.mnemonic.sgx2.supervisor + - match: '(?i)\be(accept(copy)?|modpe)\b' + scope: keyword.operator.word.mnemonic.sgx2.user + mnemonics-intel-isa-mpx: + - match: '(?i)\b(bnd(mk|c[lnu]|mov|ldx|stx))\b' + scope: keyword.operator.word.mnemonic.mpx + mnemonics-intel-isa-sha: + - match: '(?i)\b(sha(1rnds4|256rnds2|1nexte|(1|256)msg[12]))\b' + scope: keyword.operator.word.mnemonic.sha + mnemonics-supplemental-amd: + - match: '(?i)\b(bl([cs](fill|ic?|msk)|cs)|t1mskc|tzmsk)\b' + scope: keyword.operator.word.mnemonic.supplemental.amd.general-purpose + - match: '(?i)\b(clgi|int3|invlpga|iretw|skinit|stgi|vm(load|mcall|run|save)|monitorx|mwaitx)\b' + scope: keyword.operator.word.mnemonic.supplemental.amd.system + - match: '(?i)\b([ls]lwpcb|lwp(ins|val))\b' + scope: keyword.operator.word.mnemonic.supplemental.amd.profiling + - match: '(?i)\b(movnts[ds])\b' + scope: keyword.operator.word.mnemonic.supplemental.amd.memory-management + - match: '(?i)\b(prefetch|clzero)\b' + scope: keyword.operator.word.mnemonic.supplemental.amd.cache-management + - match: '(?i)\b((extr|insert)q)\b' + scope: keyword.operator.word.mnemonic.supplemental.amd.sse4.a + - match: '(?i)\b(vfn?m((add|sub)[ps][ds])|vfm((addsub|subadd)p[ds]))\b' + scope: keyword.operator.word.mnemonic.supplemental.amd.fma4 + - match: '(?i)\b(vp(cmov|(comu?|rot|sh[al])[bdqw]|mac(s?s(d(d|q[hl])|w[dw]))|madcss?wd|perm))\b' + scope: keyword.operator.word.mnemonic.supplemental.amd.xop.simd + - match: '(?i)\b(vph(addu?(b[dqw]|w[dq]|dq)|sub(bw|dq|wd)))\b' + scope: keyword.operator.word.mnemonic.supplemental.amd.xop.simd-horizontal + - match: '(?i)\b(vfrcz[ps][ds]|vpermil2p[ds])\b' + scope: keyword.operator.word.mnemonic.supplemental.amd.xop.other + - match: '(?i)\b(femms)\b' + scope: keyword.operator.word.mnemonic.supplemental.amd.3dnow + - match: '(?i)\b(p(avgusb|(f2i|i2f)[dw]|mulhrw|swapd)|pf((p?n)?acc|add|max|min|mul|rcp(it[12])?|rsqit1|rsqrt|subr?))\b' + scope: keyword.operator.word.mnemonic.supplemental.amd.3dnow.simd + - match: '(?i)\b(pfcmp(eq|ge|gt))\b' + scope: keyword.operator.word.mnemonic.supplemental.amd.3dnow.comparison + mnemonics-supplemental-cyrix: + - match: '(?i)\b((sv|rs)dc|(wr|rd)shr|paddsiw)\b' + scope: keyword.operator.word.mnemonic.supplemental.cyrix + mnemonics-supplemental-via: + - match: '(?i)\b(montmul)\b' + scope: keyword.operator.word.mnemonic.supplemental.via + - match: '(?i)\b(x(store(rng)?|crypt(ecb|cbc|ctr|cfb|ofb)|sha(1|256)))\b' + scope: keyword.operator.word.mnemonic.supplemental.via.padlock + mnemonics-undocumented: + - match: '(?i)\b(ret[nf]|icebp|int1|int03|smi|ud1)\b' + scope: keyword.operator.word.mnemonic.undocumented + mnemonics-future-intel: + - include: mnemonics-future-intel-avx512 + - include: mnemonics-future-intel-opmask + - include: mnemonics-future-intel-cet + - include: mnemonics-future-intel-other + mnemonics-future-intel-avx512: + - match: '(?i)\b(vblendm(pd|ps)|vpblendm[bdqw])\b' + scope: keyword.operator.word.mnemonic.avx512.blend + - match: '(?i)\b(vbroadcast[fi](32x[248]|64x[24])|v(extract|insert)[fi](32x[48]|64x[24])|vshuf[fi](32x4|64x2)|vpbroadcastm(b2q|w2d))\b' + scope: keyword.operator.word.mnemonic.avx512.bits-mov + - match: '(?i)\b(v(compress|expand)p[ds]|vp(compress|expand|conflict)[dq])\b' + scope: keyword.operator.word.mnemonic.avx512.compress + - match: '(?i)\b(vcvt(t?p[sd]2(udq|u?qq)|(udq|u?qq)2p[ds]|t?s[ds]2usi|usi2s[ds]))\b' + scope: keyword.operator.word.mnemonic.avx512.conversion + - match: '(?i)\b(v(fixupimm|fpclass|get(exp|mant)|range|(rcp|rsqrt)(14|28)|reduce|rndscale|scalef)([ps][ds]))\b' + scope: keyword.operator.word.mnemonic.avx512.math + - match: '(?i)\b(v(exp2p[ds]|(scatter|(gather|scatter)pf[01])[dq]p[ds]))\b' + scope: keyword.operator.word.mnemonic.avx512.math + - match: '(?i)\b(vmovdq(a(32|64)|u(8|16|32|64)))\b' + scope: keyword.operator.word.mnemonic.avx512.simd-integer + - match: '(?i)\b(vp(andn?|x?or)[dq])\b' + scope: keyword.operator.word.mnemonic.avx512.logical + - match: '(?i)\b(vpcmpu?[dqw])\b' + scope: keyword.operator.word.mnemonic.avx512.packed-comparison + - match: '(?i)\b(vp(absq|(lzcnt|ternlog)[dq]|madd52[lh]uq|(max|min)[su]q|mullq))\b' + scope: keyword.operator.word.mnemonic.avx512.packed-math + - match: '(?i)\b(vpmov(m2[bdqw]|[bdqw]2m|(u?s)?([qd][bw]|qd|wb)))\b' + scope: keyword.operator.word.mnemonic.avx512.packed-mov + - match: '(?i)\b(vp(ro[rl]v?[dq]|scatter[dq][dq]))\b' + scope: keyword.operator.word.mnemonic.avx512.packed-shift + - match: '(?i)\b(vptestn?m[bdqw])\b' + scope: keyword.operator.word.mnemonic.avx512.packed-test + - match: '(?i)\b(vperm([bdw]|[it]2([bdwq]|p[ds])))\b' + scope: keyword.operator.word.mnemonic.avx512.permutations + - match: '(?i)\b(valign[dq]|vdbpsadbw|vpmultishiftqb|vpsrav[dqw])\b' + scope: keyword.operator.word.mnemonic.avx512.other + mnemonics-future-intel-opmask: + - match: '(?i)\b(k(add|andn?|(xn?)?or|mov|not|(or)?test|shift[lr])[bdqw]|kunpck(bw|wd|dq))\b' + scope: keyword.operator.word.mnemonic.opmask + mnemonics-future-intel-cet: + - match: '(?i)\b((inc|save|rstor)ssp|wru?ss|(set|clr)ssbsy|endbranch|endbr(32|64))\b' + scope: keyword.operator.word.mnemonic.cet + mnemonics-future-intel-other: + - match: '(?i)\b(clflushopt|clwb|pcommit)\b' + scope: keyword.operator.word.mnemonic.other + mnemonics-pseudo-ops: + - match: '(?i)\b(cmp(n?(eq|lt|le)|(un)?ord)[ps][ds])\b' + scope: keyword.pseudo-mnemonic.sse2.compare + - match: '(?i)\b(v?pclmul([hl]q[hl]q|[hl]qh)dq)\b' + scope: keyword.pseudo-mnemonic.avx.promoted.aes + - match: '(?i)\b(vcmp(eq(_(os|uq|us))?|neq(_(oq|os|us))?|[gl][et](_oq)?|n[gl][et](_uq)?|(un)?ord(_s)?|false(_os)?|true(_us)?)[ps][ds])\b' + scope: keyword.pseudo-mnemonic.avx.promoted.comparison + - match: '(?i)\b(vpcom(n?eq|[gl][et]|false|true)(b|uw))\b' + scope: keyword.pseudo-mnemonic.supplemental.amd.xop.simd + mnemonics-invalid: + - include: mnemonics-invalid-amd-sse5 + mnemonics-invalid-amd-sse5: + - match: '(?i)\b(com[ps][ds]|pcomu?[bdqw])\b' + scope: invalid.keyword.operator.word.mnemonic.sse5.comparison + - match: '(?i)\b(cvtp(h2ps|s2ph)|frcz[ps][ds])\b' + scope: invalid.keyword.operator.word.mnemonic.sse5.conversion + - match: '(?i)\b(fn?m((add|sub)[ps][ds])|ph(addu?(b[dqw]|w[dq]|dq)|sub(bw|dq|wd))|pma(css?(d(d|q[hl])|w[dw])|dcss?wd))\b' + scope: invalid.keyword.operator.word.mnemonic.sse5.packed-arithmetic + - match: '(?i)\b(pcmov|permp[ds]|pperm|prot[bdqw]|psh[al][bdqw])\b' + scope: invalid.keyword.operator.word.mnemonic.sse5.simd-integer +... \ No newline at end of file diff --git a/assets/syntaxes/CMake C Header.sublime-syntax b/assets/syntaxes/CMake C Header.sublime-syntax new file mode 100644 index 0000000..105d655 --- /dev/null +++ b/assets/syntaxes/CMake C Header.sublime-syntax @@ -0,0 +1,40 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: CMake C Header +file_extensions: [h.in] +scope: source.cmake.config.c +variables: + identifier: '\b[[:alpha:]_][[:alnum:]_]*\b' +contexts: + main: + - match: "" + push: "Packages/C++/C.sublime-syntax" + with_prototype: + - match: \$\{ + scope: keyword.other.block.start.cmake + push: + - meta_include_prototype: true + - meta_scope: variable.cmake + - match: \} + scope: keyword.other.block.end.cmake + pop: true + - match: \@ + scope: keyword.other.block.start.cmake + push: + - meta_include_prototype: true + - meta_scope: variable.cmake + - match: \@ + scope: keyword.other.block.end.cmake + pop: true + - match: ^\s*(\#\s*cmakedefine)\b + captures: + 1: meta.preprocessor.macro.c keyword.control.import.cmakedefine.c + push: + - meta_content_scope: meta.preprocessor.macro.c + - include: scope:source.c#preprocessor-line-continuation + - include: scope:source.c#preprocessor-line-ending + - include: scope:source.c#preprocessor-comments + - match: '{{identifier}}' + scope: entity.name.variable.cmake + pop: true diff --git a/assets/syntaxes/CMake C++ Header.sublime-syntax b/assets/syntaxes/CMake C++ Header.sublime-syntax new file mode 100644 index 0000000..344860d --- /dev/null +++ b/assets/syntaxes/CMake C++ Header.sublime-syntax @@ -0,0 +1,40 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: CMake C++ Header +file_extensions: [hh.in, hpp.in, hxx.in, h++.in] +scope: source.cmake.config.c++ +variables: + identifier: '\b[[:alpha:]_][[:alnum:]_]*\b' +contexts: + main: + - match: "" + push: "Packages/C++/C++.sublime-syntax" + with_prototype: + - match: \$\{ + scope: keyword.other.block.start.cmake + push: + - meta_include_prototype: true + - meta_scope: variable.cmake + - match: \} + scope: keyword.other.block.end.cmake + pop: true + - match: \@ + scope: keyword.other.block.start.cmake + push: + - meta_include_prototype: true + - meta_scope: variable.cmake + - match: \@ + scope: keyword.other.block.end.cmake + pop: true + - match: ^\s*(\#\s*cmakedefine)\b + captures: + 1: meta.preprocessor.macro.c++ keyword.control.import.cmakedefine.c++ + push: + - meta_content_scope: meta.preprocessor.macro.c++ + - include: scope:source.c++#preprocessor-line-continuation + - include: scope:source.c++#preprocessor-line-ending + - include: scope:source.c++#preprocessor-comments + - match: '{{identifier}}' + scope: entity.name.variable.cmake + pop: true diff --git a/assets/syntaxes/CMake.sublime-syntax b/assets/syntaxes/CMake.sublime-syntax new file mode 100644 index 0000000..d3578a5 --- /dev/null +++ b/assets/syntaxes/CMake.sublime-syntax @@ -0,0 +1,671 @@ +%YAML 1.2 +# https://www.sublimetext.com/docs/3/syntax.html +# https://cmake.org/cmake/help/v3.0/manual/cmake-language.7.html +--- #--------------------------------------------------------------------------- +name: CMake +comment: Written by Raoul Wols , 2017 +file_extensions: [CMakeLists.txt, cmake] +scope: source.cmake +#------------------------------------------------------------------------------- +variables: + # Note: we're not doing legacy + unquoted_argument_element: "[^ \t()#\"\\']" + unquoted_argument: "{{unquoted_argument_element}}+" + identifier: \b[[:alpha:]_][[:alnum:]_]*\b + generic_named_parameter: \b@?[A-Z_][A-Z0-9_]*(?=[^\w\-<>=\$]) +#------------------------------------------------------------------------------- +contexts: + prototype: + - include: comment-block + - include: comment-line + - include: variable-substitution + - include: generator-expression + + main: + - include: scope:commands.builtin.cmake#main + - include: if + - include: foreach + - include: while + - include: set + - include: function + - include: macro + - include: include + - include: illegal-command + - include: generic-command + + illegal-command: + - match: (?i)\bendif\b + scope: invalid.illegal.stray.endif.cmake + - match: (?i)\belse\b + scope: invalid.illegal.stray.else.cmake + - match: (?i)\belseif\b + scope: invalid.illegal.stray.elseif.cmake + - match: (?i)\bendforeach\b + scope: invalid.illegal.stray.endforeach.cmake + - match: (?i)\bendwhile\b + scope: invalid.illegal.stray.endwhile.cmake + - match: (?i)\bbreak\b + scope: invalid.illegal.stray.break.cmake + - match: (?i)\bendfunction\b + scope: invalid.illegal.stray.endfunction.cmake + - match: (?i)\bendmacro\b + scope: invalid.illegal.stray.endmacro.cmake + + args-illegal-boilerplate: + - match: \s+ + - match: \n + - match: .+ + scope: invalid.illegal.expected-opening-brace.cmake + pop: true + + # --- INCLUDE ---------------------------------------------------------------- + + include: + - match: (?i)\binclude\b + scope: keyword.control.import.cmake + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: include-args + - include: args-illegal-boilerplate + + include-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bOPTIONAL\b + scope: variable.parameter.include.OPTIONAL.cmake + - match: \bNO_POLICY_SCOPE\b + scope: variable.parameter.include.NO_POLICY_SCOPE.cmake + - match: \bRESULT_VARIABLE\b + scope: variable.parameter.include.RESULT_VARIABLE.cmake + push: + - match: \b{{identifier}}\b + scope: variable.other.readwrite.cmake + pop: true + - match: \s+ + - match: \n + - match: '' + pop: true + - include: args-common + + # --- FUNCTION / ENDFUNCTION ------------------------------------------------- + + function: + - match: (?i)\bfunction\b + scope: support.function.function.cmake + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: [function-body, function-args-first] + - include: args-illegal-boilerplate + + function-args-first: + - meta_scope: meta.function-call.arguments.cmake + - match: '{{identifier}}' + scope: entity.name.function.cmake + set: function-args-rest + - include: variable-substitution + - match: \s+ + - match: '' + set: function-args-rest + + function-args-rest: + - meta_scope: meta.function-call.arguments.cmake + - include: args-common + - match: '{{identifier}}' + scope: variable.parameter.cmake + + function-body: + - meta_scope: meta.group.function.cmake + - include: endfunction + - include: main + + endfunction: + - match: (?i)\bendfunction\b + scope: support.function.endfunction.cmake + set: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: generic-args + - include: args-illegal-boilerplate + + # --- MACRO / ENDMACRO ------------------------------------------------------- + + macro: + - match: (?i)\bmacro\b + scope: support.function.macro.cmake + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: [macro-body, macro-args-first] + - include: args-illegal-boilerplate + + macro-args-first: + - meta_scope: meta.function-call.arguments.cmake + - match: '{{identifier}}' + scope: entity.name.function.cmake + set: macro-args-rest + - include: variable-substitution + - match: \s+ + - match: '' + set: macro-args-rest + + macro-args-rest: + - meta_scope: meta.function-call.arguments.cmake + - include: args-common + - match: '{{identifier}}' + scope: variable.parameter.cmake + + macro-body: + - meta_scope: meta.group.function.cmake + - include: endmacro + - include: main + + endmacro: + - match: (?i)\bendmacro\b + scope: support.function.endmacro.cmake + set: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: generic-args + - include: args-illegal-boilerplate + + # --- IF / ELSEIF / ELSE / ENDIF --------------------------------------------- + + if: + - match: (?i)\bif\b + scope: keyword.control.if.cmake + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: [if-body, if-args] + - include: args-illegal-boilerplate + + if-body: + - meta_scope: meta.group.if.cmake + - include: else + - include: elseif + - include: endif + - include: break + - include: main + + if-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \( + scope: punctuation.section.parens.begin.cmake + push: if-args + - match: \bDEFINED\b + scope: variable.parameter.if.DEFINED.cmake + - match: \bSTREQUAL\b + scope: variable.parameter.if.STREQUAL.cmake + - match: \bNOT\b + scope: keyword.operator.logical.NOT.cmake + - match: \bAND\b + scope: keyword.operator.logical.AND.cmake + - match: \bOR\b + scope: keyword.operator.logical.OR.cmake + - match: \bCOMMAND\b + scope: variable.parameter.if.COMMAND.cmake + - match: \bPOLICY\b + scope: variable.parameter.if.POLICY.cmake + - match: \bTARGET\b + scope: variable.parameter.if.TARGET.cmake + - match: \bTEST\b + scope: variable.parameter.if.TEST.cmake + - match: \bEXISTS\b + scope: variable.parameter.if.EXISTS.cmake + - match: \bIS_NEWER_THAN\b + scope: variable.parameter.if.IS_NEWER_THAN.cmake + - match: \bIS_DIRECTORY\b + scope: variable.parameter.if.IS_DIRECTORY.cmake + - match: \bIS_SYMLINK\b + scope: variable.parameter.if.IS_SYMLINK.cmake + - match: \bIS_ABSOLUTE\b + scope: variable.parameter.if.IS_ABSOLUTE.cmake + - match: \b(VERSION_|STR)?LESS\b + scope: variable.parameter.if.LESS.cmake + - match: \b(VERSION_|STR)?GREATER\b + scope: variable.parameter.if.GREATER.cmake + - match: \b(VERSION_|STR)?EQUAL\b + scope: variable.parameter.if.EQUAL.cmake + - match: \b(VERSION_|STR)?LESS_EQUAL\b + scope: variable.parameter.if.LESS_EQUAL.cmake + - match: \b(VERSION_|STR)?GREATER_EQUAL\b + scope: variable.parameter.if.GREATER_EQUAL.cmake + - match: \bMATCHES\b + scope: variable.parameter.if.MATCHES.cmake + push: + - match: \[(=*)\[ + captures: + 1: punctuation.definition.string.begin.cmake + push: + - meta_include_prototype: false + - meta_scope: string.regexp.cmake + - match: \]\1\] + scope: punctuation.definition.string.end.cmake + pop: true + - include: scope:source.regexp#base + - match: \s+ + - match: \n + - match: '' + pop: true + - include: args-common + + elseif: + - match: (?i)\belseif\b + scope: keyword.control.elseif.cmake + set: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: [elseif-body, if-args] + - include: args-illegal-boilerplate + + elseif-body: + - meta_scope: meta.group.elseif.cmake + - include: elseif + - include: else + - include: endif + - include: break + - include: main + + else: + - match: (?i)\b\belse\b + scope: keyword.control.else.cmake + set: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: [else-body, if-args] + - include: args-illegal-boilerplate + + else-body: + - meta_scope: meta.group.else.cmake + - include: endif + - include: break + - include: main + - match: (?i)\belse\b + scope: invalid.illegal.stray.else.cmake + - match: (?i)\belseif\b + scope: invalid.illegal.stray.elseif.cmake + + endif: + - match: (?i)\bendif\b + scope: keyword.control.endif.cmake + set: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: if-args + - include: args-illegal-boilerplate + + # --- FOREACH / ENDFOREACH --------------------------------------------------- + + foreach: + - match: (?i)\bforeach\b + scope: keyword.control.foreach.cmake + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: [foreach-body, foreach-args] + - include: args-illegal-boilerplate + + foreach-args: + - meta_scope: meta.function-call.arguments.cmake + - include: args-common + - match: \bIN\b + scope: variable.parameter.foreach.IN.cmake + - match: \bLISTS\b + scope: variable.parameter.foreach.LISTS.cmake + - match: \bITEMS\b + scope: variable.parameter.foreach.ITEMS.cmake + - match: \bRANGE\b + scope: variable.parameter.foreach.RANGE.cmake + + foreach-body: + - meta_scope: meta.group.foreach.cmake + - include: break + - include: continue + - include: endforeach + - include: main + + endforeach: + - match: (?i)\bendforeach\b + scope: keyword.control.endforeach.cmake + set: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: foreach-args + - include: args-illegal-boilerplate + + # --- WHILE / ENDWHILE ------------------------------------------------------- + + while: + - match: (?i)\bwhile\b + scope: keyword.control.while.cmake + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: [while-body, if-args] + - include: args-illegal-boilerplate + + while-body: + - meta_scope: meta.group.while.cmake + - include: break + - include: continue + - include: endwhile + - include: main + + endwhile: + - match: (?i)\bendwhile\b + scope: keyword.control.endwhile.cmake + set: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: if-args + - include: args-illegal-boilerplate + + # --- BREAK ------------------------------------------------------------------ + + break: + - match: (?i)\bbreak\b + scope: keyword.control.break.cmake + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: break-args + - include: args-illegal-boilerplate + + break-args: + - meta_scope: meta.function-call.arguments.cmake + - include: args-common + + #--- CONTINUE ---------------------------------------------------------------- + + continue: + - match: (?i)\bcontinue\b + scope: keyword.control.continue.cmake + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: continue-args + - include: args-illegal-boilerplate + + continue-args: + - meta_scope: meta.function-call.arguments.cmake + - include: args-common + + #--- SET --------------------------------------------------------------------- + + set: + - match: (?i)\bset\b + scope: support.function.set.cmake + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: [set-args-rest, set-args-first] + + set-args-first: + - match: '{{identifier}}' + scope: variable.other.readwrite.assignment.cmake + pop: true + - include: variable-substitution + - match: \s+ + - match: '' + pop: true + + set-args-rest: + - meta_scope: meta.function-call.arguments.cmake + - match: \bFORCE\b + scope: variable.parameter.foreach.FORCE.cmake + - match: \bPARENT_SCOPE\b + scope: variable.parameter.foreach.PARENT_SCOPE.cmake + - match: \bCACHE\b + scope: variable.parameter.foreach.CACHE.cmake + push: + - match: \s*(FILEPATH) + captures: + 1: storage.type.FILEPATH.cmake + pop: true + - match: \s*(PATH) + captures: + 1: storage.type.PATH.cmake + pop: true + - match: \s*(STRING) + captures: + 1: storage.type.STRING.cmake + pop: true + - match: \s*(BOOL) + captures: + 1: storage.type.BOOL.cmake + pop: true + - match: \s*(INTERNAL) + captures: + 1: storage.type.INTERNAL.cmake + pop: true + # anything else we scope as an error + - match: \s*([^\s]*) + captures: + 1: invalid.illegal.expected-type.cmake + pop: true + - include: args-common + + #--- COMMON FUNCTIONALITY FOR COMMANDS --------------------------------------- + + args-common: + - match: \) + scope: punctuation.section.parens.end.cmake + pop: true + - match: \( + scope: invalid.illegal.stray.parenthesis.cmake + - include: string + + generic-command: + - match: \b{{identifier}}\b + scope: variable.function.generic.cmake + push: + - meta_scope: meta.function-call.generic.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: generic-args + + generic-args: + - meta_scope: meta.function-call.arguments.generic.cmake + - match: \) + scope: punctuation.section.parens.end.cmake + pop: true + - match: (?={{generic_named_parameter}}) + push: unquoted-argument-or-keyword + - include: string-unquoted + - include: string-quoted-double + - include: string-quoted-single + + # https://cmake.org/cmake/help/v3.0/manual/cmake-language.7.html#unquoted-argument + unquoted-argument-or-keyword: + - meta_scope: variable.parameter.generic.cmake + - match: (?=\t| |\(|\)|\#|\"|\\) + pop: true + + #--- STRING HANDLING --------------------------------------------------------- + + string: + - include: string-raw + - include: string-quoted-double + - include: string-quoted-single + - include: string-unquoted + + string-raw: + - match: \[(=*)\[ + scope: punctuation.definition.string.begin.cmake + push: + - meta_include_prototype: false + - meta_scope: string.raw.cmake + - match: \]\1\] + scope: punctuation.definition.string.end.cmake + pop: true + + string-quoted-double: + - match: '"' + scope: punctuation.definition.string.begin.cmake + push: + - meta_include_prototype: false + - meta_scope: string.quoted.double.cmake + - match: '"' + scope: punctuation.definition.string.end.cmake + pop: true + - include: escape-sequences + - include: highlight-semicolon + - include: variable-substitution + - include: generator-expression + + string-quoted-single: + - match: "'" + scope: punctuation.definition.string.begin.cmake + push: + - meta_include_prototype: false + - meta_scope: string.quoted.single.cmake + - match: "'" + scope: punctuation.definition.string.end.cmake + pop: true + - include: escape-sequences + - include: highlight-semicolon + - include: variable-substitution + - include: generator-expression + + string-unquoted: + - match: (?={{unquoted_argument}}) + push: + - meta_include_prototype: false + - meta_scope: meta.string.unquoted.cmake + - include: variable-substitution + - include: generator-expression + - match: \\[; ()#"\\] + scope: constant.character.escape.cmake + - match: \\. + scope: invalid.illegal.character.escape.cmake + - match: (?=\t| |\(|\)|\#|\"|\\|\n) + pop: true + - match: (?=\s*$) + set: + - match: \s*$ + pop: true + - match: (?=\s*#) + set: prototype + - include: highlight-semicolon + + highlight-semicolon: + - match: ; + scope: punctuation.separator.cmake + + escape-sequences: + - match: \\[()#" \\$@^trn;] + scope: constant.character.escape.cmake + - match: \\. + scope: invalid.illegal.character.escape.cmake + + #--- VARIABLES AND GENERATOR EXPRESSIONS ------------------------------------- + + variable-substitution: + - match: (\$)(ENV)?(\{) + captures: + 1: punctuation.definition.variable.substitution.cmake + 2: keyword.operator.word.cmake + 3: punctuation.section.braces.begin.cmake + push: + - meta_scope: meta.text-substitution.cmake + - match: \} + scope: punctuation.section.braces.end.cmake + pop: true + - match: '{{identifier}}' + scope: variable.other.readwrite.cmake + - include: prototype + + generator-expression: + - match: (\$)(<) + captures: + 1: punctuation.definition.variable.generator-expression.cmake + 2: punctuation.section.block.begin.cmake + push: + - meta_scope: meta.generator-expression.cmake + - include: generator-expression-common + - match: ':' + scope: punctuation.separator.generator-expression.cmake + set: + - meta_content_scope: meta.generator-expression.cmake + - match: ':' + scope: invalid.illegal.too-many-colons.cmake + - include: generator-expression-common + - include: prototype + - include: prototype + + generator-expression-common: + - match: '>' + scope: punctuation.section.block.end.cmake + pop: true + - match: '{{identifier}}' + scope: variable.other.readwrite.cmake + + #--- COMMENT HANDLING -------------------------------------------------------- + + comment-block: + - match: \#\[(=*)\[ + scope: punctuation.definition.comment.begin.cmake + push: + - meta_scope: comment.block.cmake + - match: \]\1\] + scope: punctuation.definition.comment.end.cmake + pop: true + + comment-line: + - match: \# + scope: punctuation.definition.comment.cmake + push: + - meta_scope: comment.line.cmake + - match: $ + pop: true diff --git a/assets/syntaxes/CMakeCache.sublime-syntax b/assets/syntaxes/CMakeCache.sublime-syntax new file mode 100644 index 0000000..b8fbfde --- /dev/null +++ b/assets/syntaxes/CMakeCache.sublime-syntax @@ -0,0 +1,54 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: CMakeCache +file_extensions: [CMakeCache.txt] +first_line_match: "# This is the CMakeCache file." +scope: source.cmakecache + +variables: + identifier: '[a-zA-Z0-9\-_:\\/ .]+' + +contexts: + main: + - include: comments + - include: key-value-pair + + comments: + - match: \/\/ + scope: punctuation.definition.comment.cmakecache + push: + - meta_scope: comment.line.double-slash.doc.cmakecache + - match: $ + pop: true + - match: \# + scope: punctuation.definition.comment.cmakecache + push: + - meta_scope: comment.line.number-sign.cmakecache + - match: $ + pop: true + + key-value-pair: + - match: ^(\w|-)+ + scope: variable.parameter.cmakecache + set: expect-type + - match: . + scope: invalid.illegal.cmakecache + + expect-type: + - match: ':' + scope: punctuation.separator.cmakecache + - match: '{{identifier}}' + scope: storage.type.cmakecache + set: expect-value + - match: . + scope: invalid.illegal.cmakecache + + expect-value: + - match: '=' + scope: keyword.operator.assignment.cmakecache + - match: $ + pop: true + - match: .* + scope: string.unquoted.cmakecache + pop: true diff --git a/assets/syntaxes/CMakeCommands.sublime-syntax b/assets/syntaxes/CMakeCommands.sublime-syntax new file mode 100644 index 0000000..5d95c53 --- /dev/null +++ b/assets/syntaxes/CMakeCommands.sublime-syntax @@ -0,0 +1,2328 @@ +%YAML 1.2 +--- +# Automatically generated file -- do not edit! +contexts: + add_compile_options-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + add_custom_command-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bOUTPUT\b + scope: variable.parameter.OUTPUT.cmake + - match: \bCOMMAND\b + scope: variable.parameter.COMMAND.cmake + - match: \bARGS\b + scope: variable.parameter.ARGS.cmake + - match: \bMAIN_DEPENDENCY\b + scope: variable.parameter.MAIN_DEPENDENCY.cmake + - match: \bDEPENDS\b + scope: variable.parameter.DEPENDS.cmake + - match: \bBYPRODUCTS\b + scope: variable.parameter.BYPRODUCTS.cmake + - match: \bIMPLICIT_DEPENDS\b + scope: variable.parameter.IMPLICIT_DEPENDS.cmake + - match: \bWORKING_DIRECTORY\b + scope: variable.parameter.WORKING_DIRECTORY.cmake + - match: \bCOMMENT\b + scope: variable.parameter.COMMENT.cmake + - match: \bDEPFILE\b + scope: variable.parameter.DEPFILE.cmake + - match: \bVERBATIM\b + scope: variable.parameter.VERBATIM.cmake + - match: \bAPPEND\b + scope: variable.parameter.APPEND.cmake + - match: \bUSES_TERMINAL COMMAND_EXPAND_LISTS\b + scope: variable.parameter.USES_TERMINAL COMMAND_EXPAND_LISTS.cmake + - match: \bTARGET\b + scope: variable.parameter.TARGET.cmake + - match: \bPRE_BUILD\b + scope: variable.parameter.PRE_BUILD.cmake + - match: \bPRE_LINK\b + scope: variable.parameter.PRE_LINK.cmake + - match: \bPOST_BUILD\b + scope: variable.parameter.POST_BUILD.cmake + - include: scope:source.cmake#args-common + add_custom_target-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bALL\b + scope: variable.parameter.ALL.cmake + - match: \bCOMMAND\b + scope: variable.parameter.COMMAND.cmake + - match: \bDEPENDS\b + scope: variable.parameter.DEPENDS.cmake + - match: \bBYPRODUCTS\b + scope: variable.parameter.BYPRODUCTS.cmake + - match: \bWORKING_DIRECTORY\b + scope: variable.parameter.WORKING_DIRECTORY.cmake + - match: \bCOMMENT\b + scope: variable.parameter.COMMENT.cmake + - match: \bVERBATIM\b + scope: variable.parameter.VERBATIM.cmake + - match: \bUSES_TERMINAL\b + scope: variable.parameter.USES_TERMINAL.cmake + - match: \bCOMMAND_EXPAND_LISTS\b + scope: variable.parameter.COMMAND_EXPAND_LISTS.cmake + - match: \bSOURCES\b + scope: variable.parameter.SOURCES.cmake + - include: scope:source.cmake#args-common + add_definitions-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + add_dependencies-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + add_executable-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bWIN32\b + scope: variable.parameter.WIN32.cmake + - match: \bMACOSX_BUNDLE\b + scope: variable.parameter.MACOSX_BUNDLE.cmake + - match: \bEXCLUDE_FROM_ALL\b + scope: variable.parameter.EXCLUDE_FROM_ALL.cmake + - match: \bIMPORTED\b + scope: variable.parameter.IMPORTED.cmake + - match: \bGLOBAL\b + scope: variable.parameter.GLOBAL.cmake + - match: \bALIAS\b + scope: variable.parameter.ALIAS.cmake + - include: scope:source.cmake#args-common + add_library-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bSTATIC\b + scope: variable.parameter.STATIC.cmake + - match: \bSHARED\b + scope: variable.parameter.SHARED.cmake + - match: \bMODULE\b + scope: variable.parameter.MODULE.cmake + - match: \bEXCLUDE_FROM_ALL\b + scope: variable.parameter.EXCLUDE_FROM_ALL.cmake + - match: \bUNKNOWN\b + scope: variable.parameter.UNKNOWN.cmake + - match: \bIMPORTED\b + scope: variable.parameter.IMPORTED.cmake + - match: \bGLOBAL\b + scope: variable.parameter.GLOBAL.cmake + - match: \bOBJECT\b + scope: variable.parameter.OBJECT.cmake + - match: \bALIAS\b + scope: variable.parameter.ALIAS.cmake + - match: \bINTERFACE\b + scope: variable.parameter.INTERFACE.cmake + - include: scope:source.cmake#args-common + add_subdirectory-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bEXCLUDE_FROM_ALL\b + scope: variable.parameter.EXCLUDE_FROM_ALL.cmake + - include: scope:source.cmake#args-common + add_test-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bNAME\b + scope: variable.parameter.NAME.cmake + - match: \bCOMMAND\b + scope: variable.parameter.COMMAND.cmake + - match: \bCONFIGURATIONS\b + scope: variable.parameter.CONFIGURATIONS.cmake + - match: \bWORKING_DIRECTORY\b + scope: variable.parameter.WORKING_DIRECTORY.cmake + - include: scope:source.cmake#args-common + aux_source_directory-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + build_command-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bCONFIGURATION\b + scope: variable.parameter.CONFIGURATION.cmake + - match: \bTARGET\b + scope: variable.parameter.TARGET.cmake + - match: \bPROJECT_NAME\b + scope: variable.parameter.PROJECT_NAME.cmake + - include: scope:source.cmake#args-common + build_name-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + cmake_host_system_information-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bRESULT\b + scope: variable.parameter.RESULT.cmake + - match: \bQUERY\b + scope: variable.parameter.QUERY.cmake + - include: scope:source.cmake#args-common + cmake_minimum_required-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bVERSION\b + scope: variable.parameter.VERSION.cmake + - match: \bFATAL_ERROR\b + scope: variable.parameter.FATAL_ERROR.cmake + - include: scope:source.cmake#args-common + cmake_parse_arguments-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + cmake_policy-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bVERSION\b + scope: variable.parameter.VERSION.cmake + - match: \bGET\b + scope: variable.parameter.GET.cmake + - match: \bSET\b + scope: variable.parameter.SET.cmake + - match: \bNEW\b + scope: variable.parameter.NEW.cmake + - match: \bOLD\b + scope: variable.parameter.OLD.cmake + - match: \bPUSH\b + scope: variable.parameter.PUSH.cmake + - match: \bPOP\b + scope: variable.parameter.POP.cmake + - include: scope:source.cmake#args-common + configure_file-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bCOPYONLY\b + scope: variable.parameter.COPYONLY.cmake + - match: \bESCAPE_QUOTES\b + scope: variable.parameter.ESCAPE_QUOTES.cmake + - match: \b@ONLY\b + scope: variable.parameter.@ONLY.cmake + - match: \bNEWLINE_STYLE\b + scope: variable.parameter.NEWLINE_STYLE.cmake + - include: scope:source.cmake#args-common + create_test_sourcelist-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bEXTRA_INCLUDE\b + scope: variable.parameter.EXTRA_INCLUDE.cmake + - match: \bFUNCTION\b + scope: variable.parameter.FUNCTION.cmake + - include: scope:source.cmake#args-common + ctest_build-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bBUILD\b + scope: variable.parameter.BUILD.cmake + - match: \bAPPEND\b + scope: variable.parameter.APPEND.cmake + - match: \bCONFIGURATION\b + scope: variable.parameter.CONFIGURATION.cmake + - match: \bFLAGS\b + scope: variable.parameter.FLAGS.cmake + - match: \bPROJECT_NAME\b + scope: variable.parameter.PROJECT_NAME.cmake + - match: \bTARGET\b + scope: variable.parameter.TARGET.cmake + - match: \bNUMBER_ERRORS\b + scope: variable.parameter.NUMBER_ERRORS.cmake + - match: \bNUMBER_WARNINGS\b + scope: variable.parameter.NUMBER_WARNINGS.cmake + - match: \bRETURN_VALUE\b + scope: variable.parameter.RETURN_VALUE.cmake + - match: \bCAPTURE_CMAKE_ERROR\b + scope: variable.parameter.CAPTURE_CMAKE_ERROR.cmake + - include: scope:source.cmake#args-common + ctest_configure-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bBUILD\b + scope: variable.parameter.BUILD.cmake + - match: \bSOURCE\b + scope: variable.parameter.SOURCE.cmake + - match: \bAPPEND\b + scope: variable.parameter.APPEND.cmake + - match: \bOPTIONS\b + scope: variable.parameter.OPTIONS.cmake + - match: \bRETURN_VALUE\b + scope: variable.parameter.RETURN_VALUE.cmake + - match: \bQUIET\b + scope: variable.parameter.QUIET.cmake + - match: \bCAPTURE_CMAKE_ERROR\b + scope: variable.parameter.CAPTURE_CMAKE_ERROR.cmake + - include: scope:source.cmake#args-common + ctest_coverage-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bBUILD\b + scope: variable.parameter.BUILD.cmake + - match: \bAPPEND\b + scope: variable.parameter.APPEND.cmake + - match: \bLABELS\b + scope: variable.parameter.LABELS.cmake + - match: \bRETURN_VALUE\b + scope: variable.parameter.RETURN_VALUE.cmake + - match: \bCAPTURE_CMAKE_ERROR\b + scope: variable.parameter.CAPTURE_CMAKE_ERROR.cmake + - match: \bQUIET\b + scope: variable.parameter.QUIET.cmake + - include: scope:source.cmake#args-common + ctest_empty_binary_directory-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + ctest_memcheck-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bBUILD\b + scope: variable.parameter.BUILD.cmake + - match: \bAPPEND\b + scope: variable.parameter.APPEND.cmake + - match: \bSTART\b + scope: variable.parameter.START.cmake + - match: \bEND\b + scope: variable.parameter.END.cmake + - match: \bSTRIDE\b + scope: variable.parameter.STRIDE.cmake + - match: \bEXCLUDE\b + scope: variable.parameter.EXCLUDE.cmake + - match: \bINCLUDE\b + scope: variable.parameter.INCLUDE.cmake + - match: \bEXCLUDE_LABEL\b + scope: variable.parameter.EXCLUDE_LABEL.cmake + - match: \bINCLUDE_LABEL\b + scope: variable.parameter.INCLUDE_LABEL.cmake + - match: \bPARALLEL_LEVEL\b + scope: variable.parameter.PARALLEL_LEVEL.cmake + - match: \bTEST_LOAD\b + scope: variable.parameter.TEST_LOAD.cmake + - match: \bSCHEDULE_RANDOM\b + scope: variable.parameter.SCHEDULE_RANDOM.cmake + - match: \bSTOP_TIME\b + scope: variable.parameter.STOP_TIME.cmake + - match: \bRETURN_VALUE\b + scope: variable.parameter.RETURN_VALUE.cmake + - match: \bDEFECT_COUNT\b + scope: variable.parameter.DEFECT_COUNT.cmake + - match: \bQUIET\b + scope: variable.parameter.QUIET.cmake + - include: scope:source.cmake#args-common + ctest_read_custom_files-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + ctest_run_script-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bNEW_PROCESS\b + scope: variable.parameter.NEW_PROCESS.cmake + - match: \bRETURN_VALUE\b + scope: variable.parameter.RETURN_VALUE.cmake + - include: scope:source.cmake#args-common + ctest_sleep-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + ctest_start-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bTRACK\b + scope: variable.parameter.TRACK.cmake + - match: \bAPPEND\b + scope: variable.parameter.APPEND.cmake + - match: \bQUIET\b + scope: variable.parameter.QUIET.cmake + - include: scope:source.cmake#args-common + ctest_submit-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bPARTS\b + scope: variable.parameter.PARTS.cmake + - match: \bFILES\b + scope: variable.parameter.FILES.cmake + - match: \bRETRY_COUNT\b + scope: variable.parameter.RETRY_COUNT.cmake + - match: \bRETRY_DELAY\b + scope: variable.parameter.RETRY_DELAY.cmake + - match: \bRETURN_VALUE\b + scope: variable.parameter.RETURN_VALUE.cmake + - match: \bQUIET\b + scope: variable.parameter.QUIET.cmake + - match: \bCDASH_UPLOAD\b + scope: variable.parameter.CDASH_UPLOAD.cmake + - match: \bCDASH_UPLOAD_TYPE\b + scope: variable.parameter.CDASH_UPLOAD_TYPE.cmake + - include: scope:source.cmake#args-common + ctest_test-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bBUILD\b + scope: variable.parameter.BUILD.cmake + - match: \bAPPEND\b + scope: variable.parameter.APPEND.cmake + - match: \bSTART\b + scope: variable.parameter.START.cmake + - match: \bEND\b + scope: variable.parameter.END.cmake + - match: \bSTRIDE\b + scope: variable.parameter.STRIDE.cmake + - match: \bEXCLUDE\b + scope: variable.parameter.EXCLUDE.cmake + - match: \bINCLUDE\b + scope: variable.parameter.INCLUDE.cmake + - match: \bEXCLUDE_LABEL\b + scope: variable.parameter.EXCLUDE_LABEL.cmake + - match: \bINCLUDE_LABEL\b + scope: variable.parameter.INCLUDE_LABEL.cmake + - match: \bPARALLEL_LEVEL\b + scope: variable.parameter.PARALLEL_LEVEL.cmake + - match: \bTEST_LOAD\b + scope: variable.parameter.TEST_LOAD.cmake + - match: \bSCHEDULE_RANDOM\b + scope: variable.parameter.SCHEDULE_RANDOM.cmake + - match: \bSTOP_TIME\b + scope: variable.parameter.STOP_TIME.cmake + - match: \bRETURN_VALUE\b + scope: variable.parameter.RETURN_VALUE.cmake + - match: \bCAPTURE_CMAKE_ERROR\b + scope: variable.parameter.CAPTURE_CMAKE_ERROR.cmake + - match: \bQUIET\b + scope: variable.parameter.QUIET.cmake + - include: scope:source.cmake#args-common + ctest_update-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bSOURCE\b + scope: variable.parameter.SOURCE.cmake + - match: \bRETURN_VALUE\b + scope: variable.parameter.RETURN_VALUE.cmake + - match: \bQUIET\b + scope: variable.parameter.QUIET.cmake + - include: scope:source.cmake#args-common + ctest_upload-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bFILES\b + scope: variable.parameter.FILES.cmake + - match: \bQUIET\b + scope: variable.parameter.QUIET.cmake + - match: \bCAPTURE_CMAKE_ERROR\b + scope: variable.parameter.CAPTURE_CMAKE_ERROR.cmake + - include: scope:source.cmake#args-common + define_property-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bGLOBAL\b + scope: variable.parameter.GLOBAL.cmake + - match: \bDIRECTORY\b + scope: variable.parameter.DIRECTORY.cmake + - match: \bTARGET\b + scope: variable.parameter.TARGET.cmake + - match: \bSOURCE\b + scope: variable.parameter.SOURCE.cmake + - match: \bTEST\b + scope: variable.parameter.TEST.cmake + - match: \bVARIABLE\b + scope: variable.parameter.VARIABLE.cmake + - match: \bCACHED_VARIABLE\b + scope: variable.parameter.CACHED_VARIABLE.cmake + - match: \bPROPERTY\b + scope: variable.parameter.PROPERTY.cmake + - match: \bINHERITED\b + scope: variable.parameter.INHERITED.cmake + - match: \bBRIEF_DOCS\b + scope: variable.parameter.BRIEF_DOCS.cmake + - match: \bFULL_DOCS\b + scope: variable.parameter.FULL_DOCS.cmake + - include: scope:source.cmake#args-common + enable_language-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bOPTIONAL\b + scope: variable.parameter.OPTIONAL.cmake + - include: scope:source.cmake#args-common + enable_testing-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + exec_program-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bARGS\b + scope: variable.parameter.ARGS.cmake + - match: \bOUTPUT_VARIABLE\b + scope: variable.parameter.OUTPUT_VARIABLE.cmake + - match: \bRETURN_VALUE\b + scope: variable.parameter.RETURN_VALUE.cmake + - include: scope:source.cmake#args-common + execute_process-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bCOMMAND\b + scope: variable.parameter.COMMAND.cmake + - match: \bWORKING_DIRECTORY\b + scope: variable.parameter.WORKING_DIRECTORY.cmake + - match: \bTIMEOUT\b + scope: variable.parameter.TIMEOUT.cmake + - match: \bRESULT_VARIABLE\b + scope: variable.parameter.RESULT_VARIABLE.cmake + - match: \bOUTPUT_VARIABLE\b + scope: variable.parameter.OUTPUT_VARIABLE.cmake + - match: \bERROR_VARIABLE\b + scope: variable.parameter.ERROR_VARIABLE.cmake + - match: \bINPUT_FILE\b + scope: variable.parameter.INPUT_FILE.cmake + - match: \bOUTPUT_FILE\b + scope: variable.parameter.OUTPUT_FILE.cmake + - match: \bERROR_FILE\b + scope: variable.parameter.ERROR_FILE.cmake + - match: \bOUTPUT_QUIET\b + scope: variable.parameter.OUTPUT_QUIET.cmake + - match: \bERROR_QUIET\b + scope: variable.parameter.ERROR_QUIET.cmake + - match: \bOUTPUT_STRIP_TRAILING_WHITESPACE\b + scope: variable.parameter.OUTPUT_STRIP_TRAILING_WHITESPACE.cmake + - match: \bERROR_STRIP_TRAILING_WHITESPACE\b + scope: variable.parameter.ERROR_STRIP_TRAILING_WHITESPACE.cmake + - match: \bENCODING\b + scope: variable.parameter.ENCODING.cmake + - include: scope:source.cmake#args-common + export-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bEXPORT\b + scope: variable.parameter.EXPORT.cmake + - match: \bNAMESPACE\b + scope: variable.parameter.NAMESPACE.cmake + - match: \bFILE\b + scope: variable.parameter.FILE.cmake + - match: \bTARGETS\b + scope: variable.parameter.TARGETS.cmake + - match: \bAPPEND\b + scope: variable.parameter.APPEND.cmake + - match: \bEXPORT_LINK_INTERFACE_LIBRARIES\b + scope: variable.parameter.EXPORT_LINK_INTERFACE_LIBRARIES.cmake + - match: \bPACKAGE\b + scope: variable.parameter.PACKAGE.cmake + - match: \bANDROID_MK\b + scope: variable.parameter.ANDROID_MK.cmake + - include: scope:source.cmake#args-common + export_library_dependencies-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bAPPEND\b + scope: variable.parameter.APPEND.cmake + - include: scope:source.cmake#args-common + file-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bWRITE\b + scope: variable.parameter.WRITE.cmake + - match: \bAPPEND\b + scope: variable.parameter.APPEND.cmake + - match: \bREAD\b + scope: variable.parameter.READ.cmake + - match: \bOFFSET\b + scope: variable.parameter.OFFSET.cmake + - match: \bLIMIT\b + scope: variable.parameter.LIMIT.cmake + - match: \bHEX\b + scope: variable.parameter.HEX.cmake + - match: \bSTRINGS\b + scope: variable.parameter.STRINGS.cmake + - match: \bHASH\b + scope: variable.parameter.HASH.cmake + - match: \bGLOB\b + scope: variable.parameter.GLOB.cmake + - match: \bLIST_DIRECTORIES\b + scope: variable.parameter.LIST_DIRECTORIES.cmake + - match: \bRELATIVE\b + scope: variable.parameter.RELATIVE.cmake + - match: \bGLOB_RECURSE\b + scope: variable.parameter.GLOB_RECURSE.cmake + - match: \bFOLLOW_SYMLINKS\b + scope: variable.parameter.FOLLOW_SYMLINKS.cmake + - match: \bRENAME\b + scope: variable.parameter.RENAME.cmake + - match: \bREMOVE\b + scope: variable.parameter.REMOVE.cmake + - match: \bREMOVE_RECURSE\b + scope: variable.parameter.REMOVE_RECURSE.cmake + - match: \bMAKE_DIRECTORY\b + scope: variable.parameter.MAKE_DIRECTORY.cmake + - match: \bRELATIVE_PATH\b + scope: variable.parameter.RELATIVE_PATH.cmake + - match: \bTO_CMAKE_PATH\b + scope: variable.parameter.TO_CMAKE_PATH.cmake + - match: \bTO_NATIVE_PATH\b + scope: variable.parameter.TO_NATIVE_PATH.cmake + - match: \bDOWNLOAD\b + scope: variable.parameter.DOWNLOAD.cmake + - match: \bUPLOAD\b + scope: variable.parameter.UPLOAD.cmake + - match: \bTIMESTAMP\b + scope: variable.parameter.TIMESTAMP.cmake + - match: \bUTC\b + scope: variable.parameter.UTC.cmake + - match: \bGENERATE\b + scope: variable.parameter.GENERATE.cmake + - match: \bOUTPUT\b + scope: variable.parameter.OUTPUT.cmake + - match: \bINPUT\b + scope: variable.parameter.INPUT.cmake + - match: \bCONTENT\b + scope: variable.parameter.CONTENT.cmake + - match: \bCONDITION\b + scope: variable.parameter.CONDITION.cmake + - match: \bCOPY\b + scope: variable.parameter.COPY.cmake + - match: \bINSTALL\b + scope: variable.parameter.INSTALL.cmake + - match: \bDESTINATION\b + scope: variable.parameter.DESTINATION.cmake + - match: \bFILE_PERMISSIONS\b + scope: variable.parameter.FILE_PERMISSIONS.cmake + - match: \bDIRECTORY_PERMISSIONS\b + scope: variable.parameter.DIRECTORY_PERMISSIONS.cmake + - match: \bNO_SOURCE_PERMISSIONS\b + scope: variable.parameter.NO_SOURCE_PERMISSIONS.cmake + - match: \bUSE_SOURCE_PERMISSIONS\b + scope: variable.parameter.USE_SOURCE_PERMISSIONS.cmake + - match: \bFILES_MATCHING\b + scope: variable.parameter.FILES_MATCHING.cmake + - match: \bPATTERN\b + scope: variable.parameter.PATTERN.cmake + - match: \bREGEX\b + scope: variable.parameter.REGEX.cmake + - match: \bEXCLUDE\b + scope: variable.parameter.EXCLUDE.cmake + - match: \bPERMISSIONS\b + scope: variable.parameter.PERMISSIONS.cmake + - match: \bLOCK\b + scope: variable.parameter.LOCK.cmake + - match: \bDIRECTORY\b + scope: variable.parameter.DIRECTORY.cmake + - match: \bRELEASE\b + scope: variable.parameter.RELEASE.cmake + - match: \bGUARD\b + scope: variable.parameter.GUARD.cmake + - match: \bRESULT_VARIABLE\b + scope: variable.parameter.RESULT_VARIABLE.cmake + - match: \bTIMEOUT\b + scope: variable.parameter.TIMEOUT.cmake + - include: scope:source.cmake#args-common + find_file-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bNAMES\b + scope: variable.parameter.NAMES.cmake + - match: \bHINTS\b + scope: variable.parameter.HINTS.cmake + - match: \bPATHS\b + scope: variable.parameter.PATHS.cmake + - match: \bPATH_SUFFIXES\b + scope: variable.parameter.PATH_SUFFIXES.cmake + - match: \bDOC\b + scope: variable.parameter.DOC.cmake + - match: \bNO_DEFAULT_PATH\b + scope: variable.parameter.NO_DEFAULT_PATH.cmake + - match: \bNO_CMAKE_ENVIRONMENT_PATH\b + scope: variable.parameter.NO_CMAKE_ENVIRONMENT_PATH.cmake + - match: \bNO_CMAKE_PATH\b + scope: variable.parameter.NO_CMAKE_PATH.cmake + - match: \bNO_SYSTEM_ENVIRONMENT_PATH\b + scope: variable.parameter.NO_SYSTEM_ENVIRONMENT_PATH.cmake + - match: \bNO_CMAKE_SYSTEM_PATH\b + scope: variable.parameter.NO_CMAKE_SYSTEM_PATH.cmake + - match: \bCMAKE_FIND_ROOT_PATH_BOTH\b + scope: variable.parameter.CMAKE_FIND_ROOT_PATH_BOTH.cmake + - match: \bONLY_CMAKE_FIND_ROOT_PATH\b + scope: variable.parameter.ONLY_CMAKE_FIND_ROOT_PATH.cmake + - match: \bNO_CMAKE_FIND_ROOT_PATH\b + scope: variable.parameter.NO_CMAKE_FIND_ROOT_PATH.cmake + - include: scope:source.cmake#args-common + find_library-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bNAMES\b + scope: variable.parameter.NAMES.cmake + - match: \bNAMES_PER_DIR\b + scope: variable.parameter.NAMES_PER_DIR.cmake + - match: \bHINTS\b + scope: variable.parameter.HINTS.cmake + - match: \bPATHS\b + scope: variable.parameter.PATHS.cmake + - match: \bPATH_SUFFIXES\b + scope: variable.parameter.PATH_SUFFIXES.cmake + - match: \bDOC\b + scope: variable.parameter.DOC.cmake + - match: \bNO_DEFAULT_PATH\b + scope: variable.parameter.NO_DEFAULT_PATH.cmake + - match: \bNO_CMAKE_ENVIRONMENT_PATH\b + scope: variable.parameter.NO_CMAKE_ENVIRONMENT_PATH.cmake + - match: \bNO_CMAKE_PATH\b + scope: variable.parameter.NO_CMAKE_PATH.cmake + - match: \bNO_SYSTEM_ENVIRONMENT_PATH\b + scope: variable.parameter.NO_SYSTEM_ENVIRONMENT_PATH.cmake + - match: \bNO_CMAKE_SYSTEM_PATH\b + scope: variable.parameter.NO_CMAKE_SYSTEM_PATH.cmake + - match: \bCMAKE_FIND_ROOT_PATH_BOTH\b + scope: variable.parameter.CMAKE_FIND_ROOT_PATH_BOTH.cmake + - match: \bONLY_CMAKE_FIND_ROOT_PATH\b + scope: variable.parameter.ONLY_CMAKE_FIND_ROOT_PATH.cmake + - match: \bNO_CMAKE_FIND_ROOT_PATH\b + scope: variable.parameter.NO_CMAKE_FIND_ROOT_PATH.cmake + - include: scope:source.cmake#args-common + find_package-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bEXACT\b + scope: variable.parameter.EXACT.cmake + - match: \bQUIET\b + scope: variable.parameter.QUIET.cmake + - match: \bREQUIRED\b + scope: variable.parameter.REQUIRED.cmake + - match: \bCOMPONENTS\b + scope: variable.parameter.COMPONENTS.cmake + - match: \bCONFIG\b + scope: variable.parameter.CONFIG.cmake + - match: \bNO_MODULE\b + scope: variable.parameter.NO_MODULE.cmake + - match: \bNO_POLICY_SCOPE\b + scope: variable.parameter.NO_POLICY_SCOPE.cmake + - match: \bNAMES\b + scope: variable.parameter.NAMES.cmake + - match: \bCONFIGS\b + scope: variable.parameter.CONFIGS.cmake + - match: \bHINTS\b + scope: variable.parameter.HINTS.cmake + - match: \bPATHS\b + scope: variable.parameter.PATHS.cmake + - match: \bPATH_SUFFIXES\b + scope: variable.parameter.PATH_SUFFIXES.cmake + - match: \bNO_DEFAULT_PATH\b + scope: variable.parameter.NO_DEFAULT_PATH.cmake + - match: \bNO_CMAKE_ENVIRONMENT_PATH\b + scope: variable.parameter.NO_CMAKE_ENVIRONMENT_PATH.cmake + - match: \bNO_CMAKE_PATH\b + scope: variable.parameter.NO_CMAKE_PATH.cmake + - match: \bNO_SYSTEM_ENVIRONMENT_PATH\b + scope: variable.parameter.NO_SYSTEM_ENVIRONMENT_PATH.cmake + - match: \bNO_CMAKE_PACKAGE_REGISTRY\b + scope: variable.parameter.NO_CMAKE_PACKAGE_REGISTRY.cmake + - match: \bNO_CMAKE_BUILDS_PATH\b + scope: variable.parameter.NO_CMAKE_BUILDS_PATH.cmake + - match: \bNO_CMAKE_SYSTEM_PATH\b + scope: variable.parameter.NO_CMAKE_SYSTEM_PATH.cmake + - match: \bNO_CMAKE_SYSTEM_PACKAGE_REGISTRY\b + scope: variable.parameter.NO_CMAKE_SYSTEM_PACKAGE_REGISTRY.cmake + - match: \bCMAKE_FIND_ROOT_PATH_BOTH\b + scope: variable.parameter.CMAKE_FIND_ROOT_PATH_BOTH.cmake + - match: \bONLY_CMAKE_FIND_ROOT_PATH\b + scope: variable.parameter.ONLY_CMAKE_FIND_ROOT_PATH.cmake + - match: \bNO_CMAKE_FIND_ROOT_PATH\b + scope: variable.parameter.NO_CMAKE_FIND_ROOT_PATH.cmake + - include: scope:source.cmake#args-common + find_path-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bNAMES\b + scope: variable.parameter.NAMES.cmake + - match: \bHINTS\b + scope: variable.parameter.HINTS.cmake + - match: \bPATHS\b + scope: variable.parameter.PATHS.cmake + - match: \bPATH_SUFFIXES\b + scope: variable.parameter.PATH_SUFFIXES.cmake + - match: \bDOC\b + scope: variable.parameter.DOC.cmake + - match: \bNO_DEFAULT_PATH\b + scope: variable.parameter.NO_DEFAULT_PATH.cmake + - match: \bNO_CMAKE_ENVIRONMENT_PATH\b + scope: variable.parameter.NO_CMAKE_ENVIRONMENT_PATH.cmake + - match: \bNO_CMAKE_PATH\b + scope: variable.parameter.NO_CMAKE_PATH.cmake + - match: \bNO_SYSTEM_ENVIRONMENT_PATH\b + scope: variable.parameter.NO_SYSTEM_ENVIRONMENT_PATH.cmake + - match: \bNO_CMAKE_SYSTEM_PATH\b + scope: variable.parameter.NO_CMAKE_SYSTEM_PATH.cmake + - match: \bCMAKE_FIND_ROOT_PATH_BOTH\b + scope: variable.parameter.CMAKE_FIND_ROOT_PATH_BOTH.cmake + - match: \bONLY_CMAKE_FIND_ROOT_PATH\b + scope: variable.parameter.ONLY_CMAKE_FIND_ROOT_PATH.cmake + - match: \bNO_CMAKE_FIND_ROOT_PATH\b + scope: variable.parameter.NO_CMAKE_FIND_ROOT_PATH.cmake + - include: scope:source.cmake#args-common + find_program-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bNAMES\b + scope: variable.parameter.NAMES.cmake + - match: \bHINTS\b + scope: variable.parameter.HINTS.cmake + - match: \bPATHS\b + scope: variable.parameter.PATHS.cmake + - match: \bPATH_SUFFIXES\b + scope: variable.parameter.PATH_SUFFIXES.cmake + - match: \bDOC\b + scope: variable.parameter.DOC.cmake + - match: \bNO_DEFAULT_PATH\b + scope: variable.parameter.NO_DEFAULT_PATH.cmake + - match: \bNO_CMAKE_ENVIRONMENT_PATH\b + scope: variable.parameter.NO_CMAKE_ENVIRONMENT_PATH.cmake + - match: \bNO_CMAKE_PATH\b + scope: variable.parameter.NO_CMAKE_PATH.cmake + - match: \bNO_SYSTEM_ENVIRONMENT_PATH\b + scope: variable.parameter.NO_SYSTEM_ENVIRONMENT_PATH.cmake + - match: \bNO_CMAKE_SYSTEM_PATH\b + scope: variable.parameter.NO_CMAKE_SYSTEM_PATH.cmake + - match: \bCMAKE_FIND_ROOT_PATH_BOTH\b + scope: variable.parameter.CMAKE_FIND_ROOT_PATH_BOTH.cmake + - match: \bONLY_CMAKE_FIND_ROOT_PATH\b + scope: variable.parameter.ONLY_CMAKE_FIND_ROOT_PATH.cmake + - match: \bNO_CMAKE_FIND_ROOT_PATH\b + scope: variable.parameter.NO_CMAKE_FIND_ROOT_PATH.cmake + - include: scope:source.cmake#args-common + fltk_wrap_ui-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + get_cmake_property-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + get_directory_property-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bDIRECTORY\b + scope: variable.parameter.DIRECTORY.cmake + - match: \bDEFINITION\b + scope: variable.parameter.DEFINITION.cmake + - include: scope:source.cmake#args-common + get_filename_component-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bDIRECTORY\b + scope: variable.parameter.DIRECTORY.cmake + - match: \bNAME\b + scope: variable.parameter.NAME.cmake + - match: \bEXT\b + scope: variable.parameter.EXT.cmake + - match: \bNAME_WE\b + scope: variable.parameter.NAME_WE.cmake + - match: \bPATH\b + scope: variable.parameter.PATH.cmake + - match: \bBASE_DIR\b + scope: variable.parameter.BASE_DIR.cmake + - match: \bCACHE\b + scope: variable.parameter.CACHE.cmake + - match: \bPROGRAM\b + scope: variable.parameter.PROGRAM.cmake + - match: \bPROGRAM_ARGS\b + scope: variable.parameter.PROGRAM_ARGS.cmake + - include: scope:source.cmake#args-common + get_property-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bGLOBAL\b + scope: variable.parameter.GLOBAL.cmake + - match: \bDIRECTORY\b + scope: variable.parameter.DIRECTORY.cmake + - match: \bTARGET\b + scope: variable.parameter.TARGET.cmake + - match: \bSOURCE\b + scope: variable.parameter.SOURCE.cmake + - match: \bINSTALL\b + scope: variable.parameter.INSTALL.cmake + - match: \bTEST\b + scope: variable.parameter.TEST.cmake + - match: \bCACHE\b + scope: variable.parameter.CACHE.cmake + - match: \bVARIABLE\b + scope: variable.parameter.VARIABLE.cmake + - match: \bPROPERTY\b + scope: variable.parameter.PROPERTY.cmake + - match: \bSET\b + scope: variable.parameter.SET.cmake + - match: \bDEFINED\b + scope: variable.parameter.DEFINED.cmake + - match: \bBRIEF_DOCS\b + scope: variable.parameter.BRIEF_DOCS.cmake + - match: \bFULL_DOCS\b + scope: variable.parameter.FULL_DOCS.cmake + - include: scope:source.cmake#args-common + get_source_file_property-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + get_target_property-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + get_test_property-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + include_directories-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bAFTER\b + scope: variable.parameter.AFTER.cmake + - match: \bBEFORE\b + scope: variable.parameter.BEFORE.cmake + - match: \bSYSTEM\b + scope: variable.parameter.SYSTEM.cmake + - include: scope:source.cmake#args-common + include_external_msproject-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bTYPE\b + scope: variable.parameter.TYPE.cmake + - match: \bGUID\b + scope: variable.parameter.GUID.cmake + - match: \bPLATFORM\b + scope: variable.parameter.PLATFORM.cmake + - include: scope:source.cmake#args-common + include_regular_expression-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + install-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bTARGETS\b + scope: variable.parameter.TARGETS.cmake + - match: \bEXPORT\b + scope: variable.parameter.EXPORT.cmake + - match: \bARCHIVE\b + scope: variable.parameter.ARCHIVE.cmake + - match: \bLIBRARY\b + scope: variable.parameter.LIBRARY.cmake + - match: \bRUNTIME\b + scope: variable.parameter.RUNTIME.cmake + - match: \bFRAMEWORK\b + scope: variable.parameter.FRAMEWORK.cmake + - match: \bBUNDLE\b + scope: variable.parameter.BUNDLE.cmake + - match: \bPRIVATE_HEADER\b + scope: variable.parameter.PRIVATE_HEADER.cmake + - match: \bPUBLIC_HEADER\b + scope: variable.parameter.PUBLIC_HEADER.cmake + - match: \bRESOURCE\b + scope: variable.parameter.RESOURCE.cmake + - match: \bDESTINATION\b + scope: variable.parameter.DESTINATION.cmake + - match: \bPERMISSIONS\b + scope: variable.parameter.PERMISSIONS.cmake + - match: \bCONFIGURATIONS\b + scope: variable.parameter.CONFIGURATIONS.cmake + - match: \bCOMPONENT\b + scope: variable.parameter.COMPONENT.cmake + - match: \bOPTIONAL\b + scope: variable.parameter.OPTIONAL.cmake + - match: \bEXCLUDE_FROM_ALL\b + scope: variable.parameter.EXCLUDE_FROM_ALL.cmake + - match: \bNAMELINK_ONLY\b + scope: variable.parameter.NAMELINK_ONLY.cmake + - match: \bNAMELINK_SKIP\b + scope: variable.parameter.NAMELINK_SKIP.cmake + - match: \bINCLUDES DESTINATION\b + scope: variable.parameter.INCLUDES DESTINATION.cmake + - include: scope:source.cmake#args-common + install_files-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bFILES\b + scope: variable.parameter.FILES.cmake + - include: scope:source.cmake#args-common + install_programs-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bFILES\b + scope: variable.parameter.FILES.cmake + - include: scope:source.cmake#args-common + install_targets-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bRUNTIME_DIRECTORY\b + scope: variable.parameter.RUNTIME_DIRECTORY.cmake + - include: scope:source.cmake#args-common + link_directories-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + link_libraries-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bdebug\b + scope: variable.parameter.debug.cmake + - match: \boptimized\b + scope: variable.parameter.optimized.cmake + - match: \bgeneral\b + scope: variable.parameter.general.cmake + - include: scope:source.cmake#args-common + list-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bLENGTH\b + scope: variable.parameter.LENGTH.cmake + - match: \bGET\b + scope: variable.parameter.GET.cmake + - match: \bAPPEND\b + scope: variable.parameter.APPEND.cmake + - match: \bFILTER\b + scope: variable.parameter.FILTER.cmake + - match: \bINCLUDE\b + scope: variable.parameter.INCLUDE.cmake + - match: \bEXCLUDE\b + scope: variable.parameter.EXCLUDE.cmake + - match: \bREGEX\b + scope: variable.parameter.REGEX.cmake + - match: \bFIND\b + scope: variable.parameter.FIND.cmake + - match: \bINSERT\b + scope: variable.parameter.INSERT.cmake + - match: \bREMOVE_ITEM\b + scope: variable.parameter.REMOVE_ITEM.cmake + - match: \bREMOVE_AT\b + scope: variable.parameter.REMOVE_AT.cmake + - match: \bREMOVE_DUPLICATES\b + scope: variable.parameter.REMOVE_DUPLICATES.cmake + - match: \bREVERSE\b + scope: variable.parameter.REVERSE.cmake + - match: \bSORT\b + scope: variable.parameter.SORT.cmake + - include: scope:source.cmake#args-common + load_cache-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bREAD_WITH_PREFIX\b + scope: variable.parameter.READ_WITH_PREFIX.cmake + - match: \bEXCLUDE\b + scope: variable.parameter.EXCLUDE.cmake + - match: \bINCLUDE_INTERNALS\b + scope: variable.parameter.INCLUDE_INTERNALS.cmake + - include: scope:source.cmake#args-common + load_command-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bCOMMAND_NAME\b + scope: variable.parameter.COMMAND_NAME.cmake + - include: scope:source.cmake#args-common + main: + - match: (?i)\bfind_package\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: find_package-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.find_package.cmake + - match: (?i)\bget_property\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: get_property-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.get_property.cmake + - match: (?i)\btry_compile\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: try_compile-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.try_compile.cmake + - match: (?i)\bget_source_file_property\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: get_source_file_property-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.get_source_file_property.cmake + - match: (?i)\bcmake_host_system_information\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: cmake_host_system_information-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.cmake_host_system_information.cmake + - match: (?i)\bcmake_policy\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: cmake_policy-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.cmake_policy.cmake + - match: (?i)\bmark_as_advanced\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: mark_as_advanced-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.mark_as_advanced.cmake + - match: (?i)\bload_cache\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: load_cache-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.load_cache.cmake + - match: (?i)\badd_dependencies\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: add_dependencies-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.add_dependencies.cmake + - match: (?i)\bctest_start\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: ctest_start-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.ctest_start.cmake + - match: (?i)\bvariable_requires\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: variable_requires-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.variable_requires.cmake + - match: (?i)\bexecute_process\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: execute_process-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.execute_process.cmake + - match: (?i)\badd_definitions\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: add_definitions-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.add_definitions.cmake + - match: (?i)\binstall_programs\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: install_programs-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.install_programs.cmake + - match: (?i)\bctest_test\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: ctest_test-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.ctest_test.cmake + - match: (?i)\btry_run\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: try_run-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.try_run.cmake + - match: (?i)\bctest_sleep\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: ctest_sleep-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.ctest_sleep.cmake + - match: (?i)\bmessage\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: message-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.message.cmake + - match: (?i)\bfind_library\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: find_library-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.find_library.cmake + - match: (?i)\bbuild_command\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: build_command-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.build_command.cmake + - match: (?i)\bcmake_parse_arguments\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: cmake_parse_arguments-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.cmake_parse_arguments.cmake + - match: (?i)\badd_executable\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: add_executable-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.add_executable.cmake + - match: (?i)\bfltk_wrap_ui\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: fltk_wrap_ui-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.fltk_wrap_ui.cmake + - match: (?i)\bdefine_property\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: define_property-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.define_property.cmake + - match: (?i)\bset_tests_properties\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: set_tests_properties-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.set_tests_properties.cmake + - match: (?i)\buse_mangled_mesa\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: use_mangled_mesa-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.use_mangled_mesa.cmake + - match: (?i)\bexport_library_dependencies\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: export_library_dependencies-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.export_library_dependencies.cmake + - match: (?i)\btarget_link_libraries\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: target_link_libraries-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.target_link_libraries.cmake + - match: (?i)\breturn\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: return-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.return.cmake + - match: (?i)\bstring\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: string-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.string.cmake + - match: (?i)\blink_directories\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: link_directories-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.link_directories.cmake + - match: (?i)\bfind_path\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: find_path-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.find_path.cmake + - match: (?i)\benable_language\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: enable_language-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.enable_language.cmake + - match: (?i)\badd_test\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: add_test-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.add_test.cmake + - match: (?i)\btarget_compile_definitions\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: target_compile_definitions-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.target_compile_definitions.cmake + - match: (?i)\binclude_directories\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: include_directories-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.include_directories.cmake + - match: (?i)\bctest_build\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: ctest_build-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.ctest_build.cmake + - match: (?i)\bbuild_name\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: build_name-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.build_name.cmake + - match: (?i)\bget_cmake_property\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: get_cmake_property-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.get_cmake_property.cmake + - match: (?i)\bfind_program\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: find_program-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.find_program.cmake + - match: (?i)\bremove_definitions\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: remove_definitions-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.remove_definitions.cmake + - match: (?i)\bctest_configure\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: ctest_configure-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.ctest_configure.cmake + - match: (?i)\bctest_submit\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: ctest_submit-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.ctest_submit.cmake + - match: (?i)\bsource_group\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: source_group-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.source_group.cmake + - match: (?i)\blist\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: list-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.list.cmake + - match: (?i)\bremove\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: remove-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.remove.cmake + - match: (?i)\btarget_compile_options\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: target_compile_options-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.target_compile_options.cmake + - match: (?i)\binstall_targets\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: install_targets-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.install_targets.cmake + - match: (?i)\bconfigure_file\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: configure_file-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.configure_file.cmake + - match: (?i)\binstall\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: install-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.install.cmake + - match: (?i)\bcreate_test_sourcelist\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: create_test_sourcelist-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.create_test_sourcelist.cmake + - match: (?i)\blink_libraries\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: link_libraries-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.link_libraries.cmake + - match: (?i)\bload_command\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: load_command-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.load_command.cmake + - match: (?i)\bset_source_files_properties\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: set_source_files_properties-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.set_source_files_properties.cmake + - match: (?i)\binclude_external_msproject\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: include_external_msproject-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.include_external_msproject.cmake + - match: (?i)\bsite_name\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: site_name-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.site_name.cmake + - match: (?i)\binstall_files\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: install_files-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.install_files.cmake + - match: (?i)\bqt_wrap_ui\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: qt_wrap_ui-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.qt_wrap_ui.cmake + - match: (?i)\bctest_read_custom_files\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: ctest_read_custom_files-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.ctest_read_custom_files.cmake + - match: (?i)\bexport\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: export-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.export.cmake + - match: (?i)\badd_library\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: add_library-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.add_library.cmake + - match: (?i)\bfile\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: file-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.file.cmake + - match: (?i)\bwrite_file\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: write_file-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.write_file.cmake + - match: (?i)\bget_test_property\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: get_test_property-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.get_test_property.cmake + - match: (?i)\bvariable_watch\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: variable_watch-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.variable_watch.cmake + - match: (?i)\boption\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: option-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.option.cmake + - match: (?i)\boutput_required_files\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: output_required_files-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.output_required_files.cmake + - match: (?i)\bproject\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: project-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.project.cmake + - match: (?i)\butility_source\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: utility_source-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.utility_source.cmake + - match: (?i)\bfind_file\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: find_file-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.find_file.cmake + - match: (?i)\bget_filename_component\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: get_filename_component-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.get_filename_component.cmake + - match: (?i)\bqt_wrap_cpp\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: qt_wrap_cpp-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.qt_wrap_cpp.cmake + - match: (?i)\bsubdirs\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: subdirs-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.subdirs.cmake + - match: (?i)\badd_compile_options\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: add_compile_options-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.add_compile_options.cmake + - match: (?i)\bget_directory_property\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: get_directory_property-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.get_directory_property.cmake + - match: (?i)\bexec_program\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: exec_program-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.exec_program.cmake + - match: (?i)\bmath\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: math-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.math.cmake + - match: (?i)\bget_target_property\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: get_target_property-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.get_target_property.cmake + - match: (?i)\btarget_sources\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: target_sources-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.target_sources.cmake + - match: (?i)\bset_directory_properties\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: set_directory_properties-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.set_directory_properties.cmake + - match: (?i)\bsubdir_depends\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: subdir_depends-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.subdir_depends.cmake + - match: (?i)\bset_target_properties\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: set_target_properties-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.set_target_properties.cmake + - match: (?i)\benable_testing\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: enable_testing-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.enable_testing.cmake + - match: (?i)\bctest_coverage\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: ctest_coverage-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.ctest_coverage.cmake + - match: (?i)\btarget_include_directories\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: target_include_directories-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.target_include_directories.cmake + - match: (?i)\bctest_empty_binary_directory\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: ctest_empty_binary_directory-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.ctest_empty_binary_directory.cmake + - match: (?i)\bmake_directory\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: make_directory-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.make_directory.cmake + - match: (?i)\bctest_memcheck\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: ctest_memcheck-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.ctest_memcheck.cmake + - match: (?i)\btarget_compile_features\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: target_compile_features-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.target_compile_features.cmake + - match: (?i)\badd_subdirectory\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: add_subdirectory-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.add_subdirectory.cmake + - match: (?i)\binclude_regular_expression\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: include_regular_expression-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.include_regular_expression.cmake + - match: (?i)\badd_custom_command\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: add_custom_command-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.add_custom_command.cmake + - match: (?i)\bctest_upload\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: ctest_upload-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.ctest_upload.cmake + - match: (?i)\bctest_run_script\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: ctest_run_script-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.ctest_run_script.cmake + - match: (?i)\bctest_update\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: ctest_update-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.ctest_update.cmake + - match: (?i)\bcmake_minimum_required\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: cmake_minimum_required-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.cmake_minimum_required.cmake + - match: (?i)\bseparate_arguments\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: separate_arguments-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.separate_arguments.cmake + - match: (?i)\badd_custom_target\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: add_custom_target-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.add_custom_target.cmake + - match: (?i)\baux_source_directory\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: aux_source_directory-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.aux_source_directory.cmake + - match: (?i)\bset_property\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: set_property-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.set_property.cmake + - match: (?i)\bunset\b + push: + - meta_scope: meta.function-call.cmake + - match: (?=\() + set: + - match: \( + scope: punctuation.section.parens.begin.cmake + set: unset-args + - include: scope:source.cmake#args-illegal-boilerplate + scope: support.function.unset.cmake + make_directory-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + mark_as_advanced-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bCLEAR\b + scope: variable.parameter.CLEAR.cmake + - match: \bFORCE\b + scope: variable.parameter.FORCE.cmake + - include: scope:source.cmake#args-common + math-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bEXPR\b + scope: variable.parameter.EXPR.cmake + - include: scope:source.cmake#args-common + message-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bSTATUS\b + scope: variable.parameter.STATUS.cmake + - match: \bWARNING\b + scope: variable.parameter.WARNING.cmake + - match: \bAUTHOR_WARNING\b + scope: variable.parameter.AUTHOR_WARNING.cmake + - match: \bSEND_ERROR\b + scope: variable.parameter.SEND_ERROR.cmake + - match: \bFATAL_ERROR\b + scope: variable.parameter.FATAL_ERROR.cmake + - match: \bDEPRECATION\b + scope: variable.parameter.DEPRECATION.cmake + - include: scope:source.cmake#args-common + option-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + output_required_files-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + project-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bLANGUAGES\b + scope: variable.parameter.LANGUAGES.cmake + - match: \bVERSION\b + scope: variable.parameter.VERSION.cmake + - include: scope:source.cmake#args-common + prototype: + - include: scope:source.cmake#prototype + qt_wrap_cpp-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + qt_wrap_ui-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + remove-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + remove_definitions-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + return-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + separate_arguments-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bUNIX_COMMAND\b + scope: variable.parameter.UNIX_COMMAND.cmake + - match: \bWINDOWS_COMMAND\b + scope: variable.parameter.WINDOWS_COMMAND.cmake + - include: scope:source.cmake#args-common + set_directory_properties-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bPROPERTIES\b + scope: variable.parameter.PROPERTIES.cmake + - include: scope:source.cmake#args-common + set_property-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bGLOBAL\b + scope: variable.parameter.GLOBAL.cmake + - match: \bDIRECTORY\b + scope: variable.parameter.DIRECTORY.cmake + - match: \bTARGET\b + scope: variable.parameter.TARGET.cmake + - match: \bSOURCE\b + scope: variable.parameter.SOURCE.cmake + - match: \bINSTALL\b + scope: variable.parameter.INSTALL.cmake + - match: \bTEST\b + scope: variable.parameter.TEST.cmake + - match: \bCACHE\b + scope: variable.parameter.CACHE.cmake + - match: \bAPPEND\b + scope: variable.parameter.APPEND.cmake + - match: \bAPPEND_STRING\b + scope: variable.parameter.APPEND_STRING.cmake + - match: \bPROPERTY\b + scope: variable.parameter.PROPERTY.cmake + - include: scope:source.cmake#args-common + set_source_files_properties-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bPROPERTIES\b + scope: variable.parameter.PROPERTIES.cmake + - include: scope:source.cmake#args-common + set_target_properties-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bPROPERTIES\b + scope: variable.parameter.PROPERTIES.cmake + - include: scope:source.cmake#args-common + set_tests_properties-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bPROPERTIES\b + scope: variable.parameter.PROPERTIES.cmake + - include: scope:source.cmake#args-common + site_name-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + source_group-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bFILES\b + scope: variable.parameter.FILES.cmake + - match: \bREGULAR_EXPRESSION\b + scope: variable.parameter.REGULAR_EXPRESSION.cmake + - match: \bTREE\b + scope: variable.parameter.TREE.cmake + - match: \bPREFIX\b + scope: variable.parameter.PREFIX.cmake + - include: scope:source.cmake#args-common + string-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bFIND\b + scope: variable.parameter.FIND.cmake + - match: \bREVERSE\b + scope: variable.parameter.REVERSE.cmake + - match: \bREPLACE\b + scope: variable.parameter.REPLACE.cmake + - match: \bREGEX\b + scope: variable.parameter.REGEX.cmake + - match: \bMATCH\b + scope: variable.parameter.MATCH.cmake + - match: \bMATCHALL\b + scope: variable.parameter.MATCHALL.cmake + - match: \bREPLACE\b + scope: variable.parameter.REPLACE.cmake + - match: \bAPPEND\b + scope: variable.parameter.APPEND.cmake + - match: \bCONCAT\b + scope: variable.parameter.CONCAT.cmake + - match: \bTOLOWER\b + scope: variable.parameter.TOLOWER.cmake + - match: \bTOUPPER\b + scope: variable.parameter.TOUPPER.cmake + - match: \bLENGTH\b + scope: variable.parameter.LENGTH.cmake + - match: \bSUBSTRING\b + scope: variable.parameter.SUBSTRING.cmake + - match: \bSTRIP\b + scope: variable.parameter.STRIP.cmake + - match: \bGENEX_STRIP\b + scope: variable.parameter.GENEX_STRIP.cmake + - match: \bCOMPARE\b + scope: variable.parameter.COMPARE.cmake + - match: \bLESS\b + scope: variable.parameter.LESS.cmake + - match: \bGREATER\b + scope: variable.parameter.GREATER.cmake + - match: \bEQUAL\b + scope: variable.parameter.EQUAL.cmake + - match: \bNOTEQUAL\b + scope: variable.parameter.NOTEQUAL.cmake + - match: \bLESS_EQUAL\b + scope: variable.parameter.LESS_EQUAL.cmake + - match: \bGREATER_EQUAL\b + scope: variable.parameter.GREATER_EQUAL.cmake + - match: \bMD5\b + scope: variable.parameter.MD5.cmake + - match: \bSHA1\b + scope: variable.parameter.SHA1.cmake + - match: \bSHA224\b + scope: variable.parameter.SHA224.cmake + - match: \bSHA256\b + scope: variable.parameter.SHA256.cmake + - match: \bSHA384\b + scope: variable.parameter.SHA384.cmake + - match: \bSHA512\b + scope: variable.parameter.SHA512.cmake + - match: \bSHA3_224\b + scope: variable.parameter.SHA3_224.cmake + - match: \bSHA3_256\b + scope: variable.parameter.SHA3_256.cmake + - match: \bSHA3_384\b + scope: variable.parameter.SHA3_384.cmake + - match: \bSHA3_512\b + scope: variable.parameter.SHA3_512.cmake + - match: \bASCII\b + scope: variable.parameter.ASCII.cmake + - match: \bCONFIGURE\b + scope: variable.parameter.CONFIGURE.cmake + - match: \b@ONLY\b + scope: variable.parameter.@ONLY.cmake + - match: \bESCAPE_QUOTES\b + scope: variable.parameter.ESCAPE_QUOTES.cmake + - match: \bRANDOM\b + scope: variable.parameter.RANDOM.cmake + - match: \bALPHABET\b + scope: variable.parameter.ALPHABET.cmake + - match: \bRANDOM_SEED\b + scope: variable.parameter.RANDOM_SEED.cmake + - match: \bTIMESTAMP\b + scope: variable.parameter.TIMESTAMP.cmake + - match: \bUTC\b + scope: variable.parameter.UTC.cmake + - match: \bMAKE_C_IDENTIFIER\b + scope: variable.parameter.MAKE_C_IDENTIFIER.cmake + - match: \bUUID\b + scope: variable.parameter.UUID.cmake + - match: \bNAMESPACE\b + scope: variable.parameter.NAMESPACE.cmake + - match: \bNAME\b + scope: variable.parameter.NAME.cmake + - match: \bTYPE\b + scope: variable.parameter.TYPE.cmake + - match: \bUPPER\b + scope: variable.parameter.UPPER.cmake + - include: scope:source.cmake#args-common + subdir_depends-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + subdirs-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bEXCLUDE_FROM_ALL\b + scope: variable.parameter.EXCLUDE_FROM_ALL.cmake + - match: \bPREORDER\b + scope: variable.parameter.PREORDER.cmake + - include: scope:source.cmake#args-common + target_compile_definitions-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bINTERFACE\b + scope: variable.parameter.INTERFACE.cmake + - match: \bPUBLIC\b + scope: variable.parameter.PUBLIC.cmake + - match: \bPRIVATE\b + scope: variable.parameter.PRIVATE.cmake + - include: scope:source.cmake#args-common + target_compile_features-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bINTERFACE\b + scope: variable.parameter.INTERFACE.cmake + - match: \bPUBLIC\b + scope: variable.parameter.PUBLIC.cmake + - match: \bPRIVATE\b + scope: variable.parameter.PRIVATE.cmake + - include: scope:source.cmake#args-common + target_compile_options-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bINTERFACE\b + scope: variable.parameter.INTERFACE.cmake + - match: \bPUBLIC\b + scope: variable.parameter.PUBLIC.cmake + - match: \bPRIVATE\b + scope: variable.parameter.PRIVATE.cmake + - match: \bBEFORE\b + scope: variable.parameter.BEFORE.cmake + - include: scope:source.cmake#args-common + target_include_directories-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bSYSTEM\b + scope: variable.parameter.SYSTEM.cmake + - match: \bBEFORE\b + scope: variable.parameter.BEFORE.cmake + - match: \bINTERFACE\b + scope: variable.parameter.INTERFACE.cmake + - match: \bPUBLIC\b + scope: variable.parameter.PUBLIC.cmake + - match: \bPRIVATE\b + scope: variable.parameter.PRIVATE.cmake + - include: scope:source.cmake#args-common + target_link_libraries-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bINTERFACE\b + scope: variable.parameter.INTERFACE.cmake + - match: \bPUBLIC\b + scope: variable.parameter.PUBLIC.cmake + - match: \bPRIVATE\b + scope: variable.parameter.PRIVATE.cmake + - match: \bLINK_PUBLIC\b + scope: variable.parameter.LINK_PUBLIC.cmake + - match: \bLINK_PRIVATE\b + scope: variable.parameter.LINK_PRIVATE.cmake + - match: \bLINK_INTERFACE_LIBRARIES\b + scope: variable.parameter.LINK_INTERFACE_LIBRARIES.cmake + - include: scope:source.cmake#args-common + target_sources-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bINTERFACE\b + scope: variable.parameter.INTERFACE.cmake + - match: \bPUBLIC\b + scope: variable.parameter.PUBLIC.cmake + - match: \bPRIVATE\b + scope: variable.parameter.PRIVATE.cmake + - include: scope:source.cmake#args-common + try_compile-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bCMAKE_FLAGS\b + scope: variable.parameter.CMAKE_FLAGS.cmake + - match: \bOUTPUT_VARIABLE\b + scope: variable.parameter.OUTPUT_VARIABLE.cmake + - match: \bSOURCES\b + scope: variable.parameter.SOURCES.cmake + - match: \bCOMPILE_DEFINITIONS\b + scope: variable.parameter.COMPILE_DEFINITIONS.cmake + - match: \bLINK_LIBRARIES\b + scope: variable.parameter.LINK_LIBRARIES.cmake + - match: \bCOPY_FILE\b + scope: variable.parameter.COPY_FILE.cmake + - match: \bCOPY_FILE_ERROR\b + scope: variable.parameter.COPY_FILE_ERROR.cmake + - match: \bC_STANDARD_REQUIRED\b + scope: variable.parameter.C_STANDARD_REQUIRED.cmake + - match: \bCXX_STANDARD_REQUIRED\b + scope: variable.parameter.CXX_STANDARD_REQUIRED.cmake + - match: \bCUDA_STANDARD_REQUIRED\b + scope: variable.parameter.CUDA_STANDARD_REQUIRED.cmake + - match: \bC_EXTENSIONS\b + scope: variable.parameter.C_EXTENSIONS.cmake + - match: \bCXX_EXTENSIONS\b + scope: variable.parameter.CXX_EXTENSIONS.cmake + - match: \bCUDA_EXTENSIONS\b + scope: variable.parameter.CUDA_EXTENSIONS.cmake + - include: scope:source.cmake#args-common + try_run-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bCMAKE_FLAGS\b + scope: variable.parameter.CMAKE_FLAGS.cmake + - match: \bCOMPILE_DEFINITIONS\b + scope: variable.parameter.COMPILE_DEFINITIONS.cmake + - match: \bCOMPILE_OUTPUT_VARIABLE\b + scope: variable.parameter.COMPILE_OUTPUT_VARIABLE.cmake + - match: \bLINK_LIBRARIES\b + scope: variable.parameter.LINK_LIBRARIES.cmake + - match: \bOUTPUT_VARIABLE\b + scope: variable.parameter.OUTPUT_VARIABLE.cmake + - match: \bRUN_OUTPUT_VARIABLE\b + scope: variable.parameter.RUN_OUTPUT_VARIABLE.cmake + - match: \bARGS\b + scope: variable.parameter.ARGS.cmake + - include: scope:source.cmake#args-common + unset-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bCACHE\b + scope: variable.parameter.CACHE.cmake + - match: \bPARENT_SCOPE\b + scope: variable.parameter.PARENT_SCOPE.cmake + - include: scope:source.cmake#args-common + use_mangled_mesa-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + utility_source-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + variable_requires-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + variable_watch-args: + - meta_scope: meta.function-call.arguments.cmake + - include: scope:source.cmake#args-common + write_file-args: + - meta_scope: meta.function-call.arguments.cmake + - match: \bAPPEND\b + scope: variable.parameter.APPEND.cmake + - include: scope:source.cmake#args-common +hidden: true +scope: commands.builtin.cmake diff --git a/assets/syntaxes/CSV.sublime-syntax b/assets/syntaxes/CSV.sublime-syntax new file mode 100644 index 0000000..1bbc5b9 --- /dev/null +++ b/assets/syntaxes/CSV.sublime-syntax @@ -0,0 +1,46 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: Advanced CSV +file_extensions: + - csv + - tsv +scope: text.advanced_csv +contexts: + main: + - match: (\") + captures: + 1: string.quoted.double.advanced_csv + push: + - meta_scope: meta.quoted.advanced_csv + - match: (\") + captures: + 1: string.quoted.double.advanced_csv + pop: true + - include: main + - match: '(\[([+-]?\d*)(\:)?([+-]?\d*)(\,)?([+-]?\d*)(\:)?([+-]?\d*)\])?\s*([<>v^])?\s*(=)' + captures: + 1: keyword.operator.advanced_csv + 2: constant.numeric.formula.advanced_csv + 4: constant.numeric.formula.advanced_csv + 6: constant.numeric.formula.advanced_csv + 8: constant.numeric.formula.advanced_csv + 9: keyword.operator.advanced_csv + 10: keyword.operator.advanced_csv + push: + - meta_scope: meta.range.advanced_csv + - match: (?=(\")|$) + pop: true + - include: scope:source.python + - match: '(?<=^|,|\s|\")([0-9.eE+-]+)(?=$|,|\s|\")' + scope: meta.number.advanced_csv + captures: + 1: constant.numeric.advanced_csv + - match: '(?<=^|,|\s|\")([^, \t\"]+)(?=$|,|\s|\")' + scope: meta.nonnumber.advanced_csv + captures: + 1: storage.type.advanced_csv + - match: (\,) + scope: meta.delimiter.advanced_csv + captures: + 1: keyword.operator.advanced_csv diff --git a/assets/syntaxes/Cabal.sublime-syntax b/assets/syntaxes/Cabal.sublime-syntax new file mode 100644 index 0000000..b6e0dac --- /dev/null +++ b/assets/syntaxes/Cabal.sublime-syntax @@ -0,0 +1,47 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: Cabal +file_extensions: + - cabal +scope: source.cabal +contexts: + main: + - match: ^(\s*)(exposed-modules):$ + captures: + 2: constant.other.cabal + push: + - meta_scope: exposed.modules.cabal + - match: ^(?!\1\s) + pop: true + - include: module_name + - match: ^(\s*)(build-depends):$ + captures: + 2: constant.other.cabal + push: + - meta_scope: exposed.modules.cabal + - match: ^(?!\1\s) + pop: true + - match: "([<>=]+)|([&|]+)" + scope: keyword.operator.haskell + - match: ((\d+|\*)\.)*(\d+|\*) + scope: constant.numeric.haskell + - match: '([\w\-]+)' + scope: support.function.haskell + - match: '^\s*([a-zA-Z_-]+)(:)\s+' + scope: entity.cabal + captures: + 1: constant.other.cabal + 2: punctuation.entity.cabal + - match: '^(?i)(executable|library|test-suite|benchmark|flag|source-repository)\s+([^\s,]+)\s*$' + scope: entity.cabal + captures: + 1: keyword.entity.cabal + 2: string.cabal + - match: ^(?i)library\s*$ + scope: keyword.entity.cabal + - match: "--.*$" + scope: comment.cabal + module_name: + - match: '([A-Z][A-Za-z_''0-9]*)(\.[A-Z][A-Za-z_''0-9]*)*' + scope: storage.module.haskell diff --git a/assets/syntaxes/Crystal.sublime-syntax b/assets/syntaxes/Crystal.sublime-syntax new file mode 100644 index 0000000..7e86483 --- /dev/null +++ b/assets/syntaxes/Crystal.sublime-syntax @@ -0,0 +1,1036 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: Crystal +comment: | + TODO: unresolved issues + + text: + "p << end + print me! + end" + symptoms: + not recognized as a heredoc + solution: + there is no way to distinguish perfectly between the << operator and the start + of a heredoc. Currently, we require assignment to recognize a heredoc. More + refinement is possible. + • Heredocs with indented terminators (<<-) are always distinguishable, however. + • Nested heredocs are not really supportable at present + + text: + print <<-'THERE' + This is single quoted. + The above used #{Time.now} + THERE + symtoms: + From Programming Ruby p306; should be a non-interpolated heredoc. + + text: + "a\332a" + symptoms: + '\332' is not recognized as slash3.. which should be octal 332. + solution: + plain regexp.. should be easy. + + text: + val?(a):p(b) + val?'a':'b' + symptoms: + ':p' is recognized as a symbol.. its 2 things ':' and 'p'. + :'b' has same problem. + solution: + ternary operator rule, precedence stuff, symbol rule. + but also consider 'a.b?(:c)' ?? +file_extensions: + - cr +first_line_match: ^#!/.*\bcrystal +scope: source.crystal +contexts: + main: + - match: |- + (?x) + ^ + \s* + (abstract)? + \s* + (class|struct|union) + \s+ + ( + ( + [.A-Z_:\x{80}-\x{10FFFF}][.\w:\x{80}-\x{10FFFF}]* + (\(([,\s.a-zA-Z0-9_:\x{80}-\x{10FFFF}]+)\))? + ( + \s*(<)\s* + [.:A-Z\x{80}-\x{10FFFF}][.:\w\x{80}-\x{10FFFF}]* + (\(([.a-zA-Z0-9_:]+\s,)\))? + )? + )|( + (<<) + \s* + [.A-Z0-9_:\x{80}-\x{10FFFF}]+ + ) + ) + scope: meta.class.crystal + captures: + 1: keyword.control.class.crystal + 2: keyword.control.class.crystal + 3: entity.name.type.class.crystal + 5: punctuation.separator.crystal + 6: support.class.other.type-param.crystal + 7: entity.other.inherited-class.crystal + 8: punctuation.separator.crystal + 9: punctuation.separator.crystal + 10: support.class.other.type-param.crystal + 11: punctuation.definition.variable.crystal + - match: '^\s*(module)\s+(([A-Z\x{80}-\x{10FFFF}][\w\x{80}-\x{10FFFF}]*(::))?([A-Z\x{80}-\x{10FFFF}][\w\x{80}-\x{10FFFF}]*(::))?([A-Z\x{80}-\x{10FFFF}][\w\x{80}-\x{10FFFF}]*(::))*[A-Z\x{80}-\x{10FFFF}][\w\x{80}-\x{10FFFF}]*)' + scope: meta.module.crystal + captures: + 1: keyword.control.module.crystal + 2: entity.name.type.module.crystal + 3: entity.other.inherited-class.module.first.crystal + 4: punctuation.separator.inheritance.crystal + 5: entity.other.inherited-class.module.second.crystal + 6: punctuation.separator.inheritance.crystal + 7: entity.other.inherited-class.module.third.crystal + 8: punctuation.separator.inheritance.crystal + - match: '^\s*(lib)\s+(([A-Z]\w*(::))?([A-Z]\w*(::))?([A-Z]\w*(::))*[A-Z]\w*)' + scope: meta.lib.crystal + captures: + 1: keyword.control.lib.crystal + 2: entity.name.type.lib.crystal + 3: entity.other.inherited-class.lib.first.crystal + 4: punctuation.separator.inheritance.crystal + 5: entity.other.inherited-class.lib.second.crystal + 6: punctuation.separator.inheritance.crystal + 7: entity.other.inherited-class.lib.third.crystal + 8: punctuation.separator.inheritance.crystal + - match: (?|_|\*|\$|\?|:|"|-[0adFiIlpv])' + scope: variable.other.readwrite.global.pre-defined.crystal + captures: + 1: punctuation.definition.variable.crystal + - match: '\b(ENV)\[' + captures: + 1: variable.other.constant.crystal + push: + - meta_scope: meta.environment-variable.crystal + - match: '\]' + pop: true + - include: main + - match: '\b[A-Z\x{80}-\x{10FFFF}][\w\x{80}-\x{10FFFF}]*' + scope: support.class.crystal + - match: '\b[A-Z\x{80}-\x{10FFFF}][\w\x{80}-\x{10FFFF}]*\b' + scope: variable.other.constant.crystal + - match: |- + (?x) + (?=def\b) # an optimization to help Oniguruma fail fast + (?<=^|\s)(def)\s+ # the def keyword + ( (?>[a-zA-Z_\x{80}-\x{10FFFF}][\x{80}-\x{10FFFF}\w]*(?>\.|::))? # a method name prefix + (?>[a-zA-Z_\x{80}-\x{10FFFF}][\x{80}-\x{10FFFF}\w]*(?>[?!]|=(?!>))? # the method name + |===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?) ) # …or an operator method + \s*(\() # the openning parenthesis for arguments + comment: the method pattern comes from the symbol pattern, see there for a explaination + captures: + 1: keyword.control.def.crystal + 2: entity.name.function.crystal + 3: punctuation.definition.parameters.crystal + push: + - meta_scope: meta.function.method.with-arguments.crystal + - meta_content_scope: variable.parameter.function.crystal + - match: \)\s*$|\)\s*:|\)\s*; + captures: + 0: punctuation.definition.parameters.crystal + pop: true + - include: main + - match: |- + (?x) + (?=def\b) # an optimization to help Oniguruma fail fast + (?<=^|\s)(def)\s+ # the def keyword + ( (?>[a-zA-Z_\x{80}-\x{10FFFF}][\w\x{80}-\x{10FFFF}]*(?>\.|::))? # a method name prefix + (?>[a-zA-Z_\x{80}-\x{10FFFF}][\w\x{80}-\x{10FFFF}]*(?>[?!]|=(?!>))? # the method name + |===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?) ) # …or an operator method + [ \t] # the space separating the arguments + (?=[ \t]*[^\s#;]) # make sure arguments and not a comment follow + comment: same as the previous rule, but without parentheses around the arguments + captures: + 1: keyword.control.def.crystal + 2: entity.name.function.crystal + push: + - meta_scope: meta.function.method.with-arguments.crystal + - meta_content_scope: variable.parameter.function.crystal + - match: $ + pop: true + - include: main + - match: |- + (?x) + (?=def\b) # an optimization to help Oniguruma fail fast + (?<=^|\s)(def)\b # the def keyword + ( \s+ # an optional group of whitespace followed by… + ( (?>[a-zA-Z_\x{80}-\x{10FFFF}][\w\x{80}-\x{10FFFF}]*(?>\.|::))? # a method name prefix + (?>[a-zA-Z_\x{80}-\x{10FFFF}][\w\x{80}-\x{10FFFF}]*(?>[?!]|=(?!>))? # the method name + |===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?) ) )? # …or an operator method + comment: the optional name is just to catch the def also without a method-name + scope: meta.function.method.without-arguments.crystal + captures: + 1: keyword.control.def.crystal + 3: entity.name.function.crystal + - match: '\b(0[xX]\h(?>_?\h)*|\d(?>_?\d)*(\.(?![^[:space:][:digit:]])(?>_?\d)*)?([eE][-+]?\d(?>_?\d)*)?|0[bB][01]+|0o[0-7]+)(_?(u8|u16|u32|u64|i8|i16|i32|i64|f32|f64))?\b' + scope: constant.numeric.crystal + - match: ":'" + captures: + 0: punctuation.definition.constant.crystal + push: + - meta_scope: constant.other.symbol.single-quoted.crystal + - match: "'" + captures: + 0: punctuation.definition.constant.crystal + pop: true + - match: '\\[''\\]' + scope: constant.character.escape.crystal + - match: ':"' + captures: + 0: punctuation.definition.constant.crystal + push: + - meta_scope: constant.other.symbol.double-quoted.crystal + - match: '"' + captures: + 0: punctuation.definition.constant.crystal + pop: true + - include: interpolated_crystal + - include: escaped_char + - match: /= + comment: Needs higher precidence than regular expressions. + scope: keyword.operator.assignment.augmented.crystal + - match: "'" + comment: single quoted string (does not allow interpolation) + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.quoted.single.crystal + - match: "'" + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - match: \\'|\\\\ + scope: constant.character.escape.crystal + - match: '"' + comment: double quoted string (allows for interpolation) + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.quoted.double.crystal + - match: '"' + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: interpolated_crystal + - include: escaped_char + - match: "`" + comment: execute string (allows for interpolation) + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.interpolated.crystal + - match: "`" + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: interpolated_crystal + - include: escaped_char + - match: '%x\{' + comment: execute string (allow for interpolation) + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.interpolated.crystal + - match: '\}' + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: interpolated_crystal + - include: escaped_char + - include: nest_curly_i + - match: '%x\[' + comment: execute string (allow for interpolation) + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.interpolated.crystal + - match: '\]' + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: interpolated_crystal + - include: escaped_char + - include: nest_brackets_i + - match: '%x\<' + comment: execute string (allow for interpolation) + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.interpolated.crystal + - match: \> + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: interpolated_crystal + - include: escaped_char + - include: nest_ltgt_i + - match: '%x\(' + comment: execute string (allow for interpolation) + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.interpolated.crystal + - match: \) + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: interpolated_crystal + - include: escaped_char + - include: nest_parens_i + - match: '%x([^\w])' + comment: execute string (allow for interpolation) + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.interpolated.crystal + - match: \1 + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: interpolated_crystal + - include: escaped_char + - match: |- + (?x) + (?: + ^ # beginning of line + | (?<= # or look-behind on: + [=>~(?:\[,|&;] + | [\s;]if\s # keywords + | [\s;]elsif\s + | [\s;]while\s + | [\s;]unless\s + | [\s;]when\s + | [\s;]assert_match\s + | [\s;]or\s # boolean opperators + | [\s;]and\s + | [\s;]not\s + | [\s.]index\s # methods + | [\s.]scan\s + | [\s.]sub\s + | [\s.]sub!\s + | [\s.]gsub\s + | [\s.]gsub!\s + | [\s.]match\s + ) + | (?<= # or a look-behind with line anchor: + ^when\s # duplication necessary due to limits of regex + | ^if\s + | ^elsif\s + | ^while\s + | ^unless\s + ) + ) + \s*((/))(?![*+{}?]) + comment: | + regular expressions (normal) + we only start a regexp if the character before it (excluding whitespace) + is what we think is before a regexp + captures: + 1: string.regexp.classic.crystal + 2: punctuation.definition.string.crystal + push: + - meta_content_scope: string.regexp.classic.crystal + - match: "((/[eimnosux]*))" + captures: + 1: string.regexp.classic.crystal + 2: punctuation.definition.string.crystal + pop: true + - include: regex_sub + - match: '%r\{' + comment: regular expressions (literal) + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.regexp.mod-r.crystal + - match: '\}[eimnosux]*' + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: regex_sub + - include: nest_curly_r + - match: '%r\[' + comment: regular expressions (literal) + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.regexp.mod-r.crystal + - match: '\][eimnosux]*' + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: regex_sub + - include: nest_brackets_r + - match: '%r\(' + comment: regular expressions (literal) + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.regexp.mod-r.crystal + - match: '\)[eimnosux]*' + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: regex_sub + - include: nest_parens_r + - match: '%r\<' + comment: regular expressions (literal) + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.regexp.mod-r.crystal + - match: '\>[eimnosux]*' + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: regex_sub + - include: nest_ltgt_r + - match: '%r([^\w])' + comment: regular expressions (literal) + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.regexp.mod-r.crystal + - match: '\1[eimnosux]*' + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: regex_sub + - match: '%[QWSR]?\(' + comment: literal capable of interpolation () + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.quoted.other.literal.upper.crystal + - match: \) + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: interpolated_crystal + - include: escaped_char + - include: nest_parens_i + - match: '%[QWSR]?\[' + comment: "literal capable of interpolation []" + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.quoted.other.literal.upper.crystal + - match: '\]' + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: interpolated_crystal + - include: escaped_char + - include: nest_brackets_i + - match: '%[QWSR]?\<' + comment: literal capable of interpolation <> + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.quoted.other.literal.upper.crystal + - match: \> + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: interpolated_crystal + - include: escaped_char + - include: nest_ltgt_i + - match: '%[QWSR]?\{' + comment: "literal capable of interpolation -- {}" + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.quoted.double.crystal.mod + - match: '\}' + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: interpolated_crystal + - include: escaped_char + - include: nest_curly_i + - match: '%[QWSR]([^\w])' + comment: literal capable of interpolation -- wildcard + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.quoted.other.literal.upper.crystal + - match: \1 + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: interpolated_crystal + - include: escaped_char + - match: '%[qws]\(' + comment: literal incapable of interpolation -- () + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.quoted.other.literal.lower.crystal + - match: \) + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - match: \\\)|\\\\ + scope: constant.character.escape.crystal + - include: nest_parens + - match: '%[qws]\<' + comment: literal incapable of interpolation -- <> + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.quoted.other.literal.lower.crystal + - match: \> + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - match: \\\>|\\\\ + scope: constant.character.escape.crystal + - include: nest_ltgt + - match: '%[qws]\[' + comment: "literal incapable of interpolation -- []" + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.quoted.other.literal.lower.crystal + - match: '\]' + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - match: '\\\]|\\\\' + scope: constant.character.escape.crystal + - include: nest_brackets + - match: '%[qws]\{' + comment: "literal incapable of interpolation -- {}" + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.quoted.other.literal.lower.crystal + - match: '\}' + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - match: '\\\}|\\\\' + scope: constant.character.escape.crystal + - include: nest_curly + - match: '%[qws]([^\w])' + comment: literal incapable of interpolation -- wildcard + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.quoted.other.literal.lower.crystal + - match: \1 + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - match: \\. + comment: Cant be named because its not neccesarily an escape. + - match: '(?[a-zA-Z_\x{80}-\x{10FFFF}][\w\x{80}-\x{10FFFF}]*(?>[?!]|=(?![>=]))?|===?|>[>=]?|<[<=]?|<=>|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?|@@?[a-zA-Z_\x{80}-\x{10FFFF}][\w\x{80}-\x{10FFFF}]*)' + comment: symbols + scope: constant.other.symbol.crystal + captures: + 1: punctuation.definition.constant.crystal + - match: '(?>[a-zA-Z_\x{80}-\x{10FFFF}][\w\x{80}-\x{10FFFF}]*(?>[?!])?)(:)(?!:)' + comment: symbols + scope: constant.other.symbol.crystal.19syntax + captures: + 1: punctuation.definition.constant.crystal + - match: '(?:^[ \t]+)?(#).*$\n?' + scope: comment.line.number-sign.crystal + captures: + 1: punctuation.definition.comment.crystal + - match: ^__END__\n + comment: __END__ marker + captures: + 0: string.unquoted.program-block.crystal + push: + - meta_content_scope: text.plain + - match: (?=not)impossible + captures: + 0: string.unquoted.program-block.crystal + pop: true + - match: (?=<<-("?)((?:[_\w]+_|)HTML)\b\1)' + comment: heredoc with embedded HTML and indented terminator + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.unquoted.embedded.html.crystal + - meta_content_scope: text.html.embedded.crystal + - match: \s*\2$ + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: heredoc + - include: scope:text.html.basic + - include: interpolated_crystal + - include: escaped_char + - match: '(?><<-("?)((?:[_\w]+_|)SQL)\b\1)' + comment: heredoc with embedded SQL and indented terminator + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.unquoted.embedded.sql.crystal + - meta_content_scope: text.sql.embedded.crystal + - match: \s*\2$ + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: heredoc + - include: scope:source.sql + - include: interpolated_crystal + - include: escaped_char + - match: '(?><<-("?)((?:[_\w]+_|)CSS)\b\1)' + comment: heredoc with embedded css and intented terminator + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.unquoted.embedded.css.crystal + - meta_content_scope: text.css.embedded.crystal + - match: \s*\2$ + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: heredoc + - include: scope:source.css + - include: interpolated_crystal + - include: escaped_char + - match: '(?><<-("?)((?:[_\w]+_|)CPP)\b\1)' + comment: heredoc with embedded c++ and intented terminator + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.unquoted.embedded.cplusplus.crystal + - meta_content_scope: text.c++.embedded.crystal + - match: \s*\2$ + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: heredoc + - include: scope:source.c++ + - include: interpolated_crystal + - include: escaped_char + - match: '(?><<-("?)((?:[_\w]+_|)C)\b\1)' + comment: heredoc with embedded c++ and intented terminator + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.unquoted.embedded.c.crystal + - meta_content_scope: text.c.embedded.crystal + - match: \s*\2$ + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: heredoc + - include: scope:source.c + - include: interpolated_crystal + - include: escaped_char + - match: '(?><<-("?)((?:[_\w]+_|)(?:JS|JAVASCRIPT))\b\1)' + comment: heredoc with embedded javascript and intented terminator + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.unquoted.embedded.js.crystal + - meta_content_scope: text.js.embedded.crystal + - match: \s*\2$ + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: heredoc + - include: scope:source.js + - include: interpolated_crystal + - include: escaped_char + - match: '(?><<-("?)((?:[_\w]+_|)JQUERY)\b\1)' + comment: heredoc with embedded javascript and intented terminator + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.unquoted.embedded.js.jquery.crystal + - meta_content_scope: text.js.jquery.embedded.crystal + - match: \s*\2$ + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: heredoc + - include: scope:source.js.jquery + - include: interpolated_crystal + - include: escaped_char + - match: '(?><<-("?)((?:[_\w]+_|)(?:SH|SHELL))\b\1)' + comment: heredoc with embedded shell and intented terminator + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.unquoted.embedded.shell.crystal + - meta_content_scope: text.shell.embedded.crystal + - match: \s*\2$ + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: heredoc + - include: scope:source.shell + - include: interpolated_crystal + - include: escaped_char + - match: '(?><<-("?)((?:[_\w]+_|)RUBY)\b\1)' + comment: heredoc with embedded crystal and intented terminator + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.unquoted.embedded.crystal.crystal + - meta_content_scope: text.crystal.embedded.crystal + - match: \s*\2$ + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: heredoc + - include: scope:source.crystal + - include: interpolated_crystal + - include: escaped_char + - match: (?>\=\s*<<(\w+)) + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.unquoted.heredoc.crystal + - match: ^\1$ + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: heredoc + - include: interpolated_crystal + - include: escaped_char + - match: (?><<-(\w+)) + comment: heredoc with indented terminator + captures: + 0: punctuation.definition.string.begin.crystal + push: + - meta_scope: string.unquoted.heredoc.crystal + - match: \s*\1$ + captures: + 0: punctuation.definition.string.end.crystal + pop: true + - include: heredoc + - include: interpolated_crystal + - include: escaped_char + - match: '(?<=\{|do|\{\s|do\s)(\|)' + captures: + 1: punctuation.separator.variable.crystal + push: + - match: (\|) + captures: + 1: punctuation.separator.variable.crystal + pop: true + - match: "[_a-zA-Z][_a-zA-Z0-9]*" + scope: variable.other.block.crystal + - match: "," + scope: punctuation.separator.variable.crystal + - match: "=>" + scope: punctuation.separator.key-value + - match: '<<=|%=|&=|\*=|\*\*=|\+=|\-=|\^=|\|{1,2}=|<<' + scope: keyword.operator.assignment.augmented.crystal + - match: '<=>|<(?!<|=)|>(?!<|=|>)|<=|>=|===|==|=~|!=|!~|(?<=[ \t])\?' + scope: keyword.operator.comparison.crystal + - match: '(?<=[ \t])!+|\bnot\b|&&|\band\b|\|\||\bor\b|\^' + scope: keyword.operator.logical.crystal + - match: '(\{\%|\%\}|\{\{|\}\})' + scope: keyword.operator.macro.crystal + - match: (%|&|\*\*|\*|\+|\-|/) + scope: keyword.operator.arithmetic.crystal + - match: "=" + scope: keyword.operator.assignment.crystal + - match: \||~|>> + scope: keyword.operator.other.crystal + - match: ":" + scope: punctuation.separator.other.crystal + - match: \; + scope: punctuation.separator.statement.crystal + - match: "," + scope: punctuation.separator.object.crystal + - match: '\.|::' + scope: punctuation.separator.method.crystal + - match: '\{|\}' + scope: punctuation.section.scope.crystal + - match: '\[|\]' + scope: punctuation.section.array.crystal + - match: \(|\) + scope: punctuation.section.function.crystal + escaped_char: + - match: '\\(?:[0-7]{1,3}|x[\da-fA-F]{1,2}|.)' + scope: constant.character.escape.crystal + heredoc: + - match: ^<<-?\w+ + push: + - match: $ + pop: true + - include: main + interpolated_crystal: + - match: '#\{(\})' + scope: source.crystal.embedded.source + captures: + 0: punctuation.section.embedded.crystal + 1: source.crystal.embedded.source.empty + - match: '#\{' + captures: + 0: punctuation.section.embedded.crystal + push: + - meta_scope: source.crystal.embedded.source + - match: '\}' + captures: + 0: punctuation.section.embedded.crystal + pop: true + - include: nest_curly_and_self + - include: main + - match: '(#@)[a-zA-Z_]\w*' + scope: variable.other.readwrite.instance.crystal + captures: + 1: punctuation.definition.variable.crystal + - match: '(#@@)[a-zA-Z_]\w*' + scope: variable.other.readwrite.class.crystal + captures: + 1: punctuation.definition.variable.crystal + - match: '(#\$)[a-zA-Z_]\w*' + scope: variable.other.readwrite.global.crystal + captures: + 1: punctuation.definition.variable.crystal + nest_brackets: + - match: '\[' + captures: + 0: punctuation.section.scope.crystal + push: + - match: '\]' + captures: + 0: punctuation.section.scope.crystal + pop: true + - include: nest_brackets + nest_brackets_i: + - match: '\[' + captures: + 0: punctuation.section.scope.crystal + push: + - match: '\]' + captures: + 0: punctuation.section.scope.crystal + pop: true + - include: interpolated_crystal + - include: escaped_char + - include: nest_brackets_i + nest_brackets_r: + - match: '\[' + captures: + 0: punctuation.section.scope.crystal + push: + - match: '\]' + captures: + 0: punctuation.section.scope.crystal + pop: true + - include: regex_sub + - include: nest_brackets_r + nest_curly: + - match: '\{' + captures: + 0: punctuation.section.scope.crystal + push: + - match: '\}' + captures: + 0: punctuation.section.scope.crystal + pop: true + - include: nest_curly + nest_curly_and_self: + - match: '\{' + captures: + 0: punctuation.section.scope.crystal + push: + - match: '\}' + captures: + 0: punctuation.section.scope.crystal + pop: true + - include: nest_curly_and_self + - include: main + nest_curly_i: + - match: '\{' + captures: + 0: punctuation.section.scope.crystal + push: + - match: '\}' + captures: + 0: punctuation.section.scope.crystal + pop: true + - include: interpolated_crystal + - include: escaped_char + - include: nest_curly_i + nest_curly_r: + - match: '\{' + captures: + 0: punctuation.section.scope.crystal + push: + - match: '\}' + captures: + 0: punctuation.section.scope.crystal + pop: true + - include: regex_sub + - include: nest_curly_r + nest_ltgt: + - match: \< + captures: + 0: punctuation.section.scope.crystal + push: + - match: \> + captures: + 0: punctuation.section.scope.crystal + pop: true + - include: nest_ltgt + nest_ltgt_i: + - match: \< + captures: + 0: punctuation.section.scope.crystal + push: + - match: \> + captures: + 0: punctuation.section.scope.crystal + pop: true + - include: interpolated_crystal + - include: escaped_char + - include: nest_ltgt_i + nest_ltgt_r: + - match: \< + captures: + 0: punctuation.section.scope.crystal + push: + - match: \> + captures: + 0: punctuation.section.scope.crystal + pop: true + - include: regex_sub + - include: nest_ltgt_r + nest_parens: + - match: \( + captures: + 0: punctuation.section.scope.crystal + push: + - match: \) + captures: + 0: punctuation.section.scope.crystal + pop: true + - include: nest_parens + nest_parens_i: + - match: \( + captures: + 0: punctuation.section.scope.crystal + push: + - match: \) + captures: + 0: punctuation.section.scope.crystal + pop: true + - include: interpolated_crystal + - include: escaped_char + - include: nest_parens_i + nest_parens_r: + - match: \( + captures: + 0: punctuation.section.scope.crystal + push: + - match: \) + captures: + 0: punctuation.section.scope.crystal + pop: true + - include: regex_sub + - include: nest_parens_r + regex_sub: + - include: interpolated_crystal + - include: escaped_char + - match: '(\{)\d+(,\d+)?(\})' + scope: string.regexp.arbitrary-repitition.crystal + captures: + 1: punctuation.definition.arbitrary-repitition.crystal + 3: punctuation.definition.arbitrary-repitition.crystal + - match: '\[(?:\^?\])?' + captures: + 0: punctuation.definition.character-class.crystal + push: + - meta_scope: string.regexp.character-class.crystal + - match: '\]' + captures: + 0: punctuation.definition.character-class.crystal + pop: true + - include: escaped_char + - match: \( + captures: + 0: punctuation.definition.group.crystal + push: + - meta_scope: string.regexp.group.crystal + - match: \) + captures: + 0: punctuation.definition.group.crystal + pop: true + - include: regex_sub + - match: '(?<=^|\s)(#)\s[[a-zA-Z0-9,. \t?!-][^\x{00}-\x{7F}]]*$' + 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. + scope: comment.line.number-sign.crystal + captures: + 1: punctuation.definition.comment.crystal diff --git a/assets/syntaxes/Dart.sublime-syntax b/assets/syntaxes/Dart.sublime-syntax new file mode 100644 index 0000000..34ed01e --- /dev/null +++ b/assets/syntaxes/Dart.sublime-syntax @@ -0,0 +1,369 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: Dart +file_extensions: + - dart +scope: source.dart +contexts: + main: + - match: ^(#!.*)$ + scope: meta.preprocessor.script.dart + - match: ^\s*\b(library|import|export|part of|part)\b + captures: + 0: keyword.other.import.dart + push: + - meta_scope: meta.declaration.dart + - match: ; + captures: + 0: punctuation.terminator.dart + pop: true + - include: strings + - match: \b(as|show|hide|deferred)\b + scope: keyword.other.import.dart + - include: comments + - include: constants-and-special-vars + - include: annotations + - include: decl-typedef + - include: decl-class + - include: decl-enum + - include: decl-function + - include: keywords + - include: strings + annotations: + - match: '^(?:\s*)((@)([a-zA-Z0-9_]+))' + captures: + 1: annotation.dart + 2: entity.name.function.annotation.dart + 3: support.type.dart + comments: + - match: /\*\*/ + scope: comment.block.empty.dart + captures: + 0: punctuation.definition.comment.dart + - include: comments-inline + comments-inline: + - match: /\* + push: + - meta_scope: comment.block.dart + - match: \*/ + pop: true + - include: scope:text.dart-doccomments + - match: (///) + captures: + 1: marker.dart + push: + - meta_scope: comment.line.triple-slash.dart + - match: $ + pop: true + - include: scope:text.dart-doccomments + - match: (//) + captures: + 1: marker.dart + push: + - meta_scope: comment.line.double-slash.dart + - match: $ + pop: true + - include: scope:text.dart-doccomments + constants-and-special-vars: + - match: \b(true|false|null)\b + scope: constant.language.dart + - match: \b(this|super)\b + scope: variable.language.dart + - match: '\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b' + scope: constant.numeric.dart + decl-class: + - match: \bclass\b + captures: + 0: keyword.control.new.dart + push: + - meta_scope: meta.declaration.class.dart + - match: "(?={)" + pop: true + - include: keywords + - match: "[A-Za-z_][A-Za-z0-9_]*" + scope: class.name.dart + decl-enum: + - match: \benum\b + captures: + 0: keyword.declaration.dart + push: + - meta_scope: meta.declaration.enum.dart + - match: "(?={)" + pop: true + - include: keywords + - match: "[A-Za-z_][A-Za-z0-9_]*" + scope: enum.name.dart + decl-function: + - match: ^\s*(?:\b(void|bool|num|int|double|dynamic|var|String|List|Map)\b)\s+(get)\s+(\w+)\s+(?==>) + comment: A getter with a primitive return type. + scope: meta.declaration.function.dart + captures: + 1: storage.type.primitive.dart + 2: keyword.declaration.dart + 3: function.name.dart + - match: ^\s*(?:\b(\w+)\b\s+)?(get)\s+(\w+)\s+(?==>) + comment: A getter with a user-defined return type or no return type. + scope: meta.declaration.function.dart + captures: + 1: type.user-defined.dart + 2: keyword.declaration.dart + 3: function.name.dart + - match: ^\s*(set)\s+(\w+)(?=\() + comment: A setter. + captures: + 1: keyword.declaration.dart + 2: function.name.dart + push: + - meta_scope: meta.declaration.function.dart + - match: \) + pop: true + - include: comments-inline + - include: decl-function-parameter + - include: strings + - include: keywords + - match: ^\s*(?:\b(void|bool|num|int|double|dynamic|var|String|List|Map)\b)\s+(\w+)(?=\() + comment: A function with a primitive return type. + captures: + 1: storage.type.primitive.dart + 2: function.name.dart + push: + - meta_scope: meta.declaration.function.dart + - match: \) + pop: true + - include: comments-inline + - include: decl-function-parameter + - include: strings + - include: keywords + - match: ^\s*(?:\b(return)\b)\s+(\w+)(?=\() + comment: A function invocation after 'return' + captures: + 1: keyword.control.dart + 2: function.name.dart + push: + - meta_scope: meta.invocation.function.dart + - match: \) + pop: true + - include: comments-inline + - include: decl-function-parameter + - include: strings + - include: keywords + - match: ^\s*\b(new)\b\s+(\w+)(?=\() + comment: A class instantiation after 'new' + captures: + 1: keyword.declaration.dart + 2: function.name.dart + push: + - meta_scope: meta.invocation.function.dart + - match: \) + pop: true + - include: comments-inline + - include: decl-function-parameter + - include: strings + - include: keywords + decl-function-parameter: + - include: constants-and-special-vars + - match: (?:\b(void|bool|num|int|double|dynamic|var|String|List|Map)\b)\s+(\w+)(?=\() + comment: A function with a primitive return type. + captures: + 1: storage.type.primitive.dart + 2: function.name.dart + push: + - meta_scope: meta.parameter.function.dart + - match: \) + pop: true + - include: decl-function-parameter + - include: strings + - include: keywords + - match: \b(new)\b\s+(\w+)(?=\() + comment: A class instantiation after 'new' + captures: + 1: keyword.declaration.dart + 2: function.name.dart + push: + - meta_scope: meta.invocation.function.dart + - match: \) + pop: true + - include: decl-function-parameter + - include: strings + - include: keywords + - match: (?:\b(\w+)\b)\s+(\w+)(?=\() + comment: A function with a user-defined return type. + captures: + 1: type.user-defined.dart + 2: function.name.dart + push: + - meta_scope: meta.parameter.function.dart + - match: \) + pop: true + - include: decl-function-parameter + - include: strings + - include: keywords + - match: (\w+)(?=\() + comment: A function with no return type. + captures: + 1: function.name.dart + push: + - meta_scope: meta.parameter.function.dart + - match: \) + pop: true + - include: decl-function-parameter + - include: strings + - include: keywords + decl-typedef: + - match: typedef + captures: + 0: keyword.control.new.dart + push: + - meta_scope: meta.declaration.typedef.dart + - match: ; + captures: + 0: punctuation.terminator.dart + pop: true + - match: '(?:\b(void|bool|num|int|double|dynamic|var|String|List|Map)\b|([a-zA-Z_][a-zA-Z0-9_]*))\s+([a-zA-Z_][a-zA-Z0-9_]+)' + captures: + 1: storage.type.primitive.dart + 2: typedef.return.dart + 3: typedef.name.dart + - match: \( + push: + - meta_scope: typedef.params.dart + - match: \) + pop: true + - include: keywords + keywords: + - match: \bassert\b + scope: keyword.control.assert.dart + - match: \bas\b + scope: keyword.cast.dart + - match: \b(try|catch|finally|throw|on|rethrow)\b + scope: keyword.control.catch-exception.dart + - match: \s+\?\s+|\s+:\s+ + scope: keyword.control.ternary.dart + - match: \b(break|case|continue|default|do|else|for|if|in|return|switch|while)\b + scope: keyword.control.dart + - match: \b(async\*|async|await\*|await|yield)\b + scope: keyword.control.async.dart + - match: \b(new)\b + scope: keyword.control.new.dart + - match: \b(abstract|extends|external|factory|implements|with|interface|get|native|operator|set|typedef)\b + scope: keyword.declaration.dart + - match: \b(is\!?)\b + scope: keyword.operator.dart + - match: (<<|>>>?|~|\^|\||&) + scope: keyword.operator.bitwise.dart + - match: ((&|\^|\||<<|>>>?)=) + scope: keyword.operator.assignment.bitwise.dart + - match: (===?|!==?|<=?|>=?) + scope: keyword.operator.comparison.dart + - match: '(([+*/%-]|\~)=)' + scope: keyword.operator.assignment.arithmetic.dart + - match: (=) + scope: keyword.operator.assignment.dart + - match: (\-\-|\+\+) + scope: keyword.operator.increment-decrement.dart + - match: (\-|\+|\*|\/|\~\/|%) + scope: keyword.operator.arithmetic.dart + - match: (!|&&|\|\|) + scope: keyword.operator.logical.dart + - match: ; + scope: punctuation.terminator.dart + - match: \b(static|final|const)\b + scope: storage.modifier.dart + - match: \b(?:void|bool|num|int|double|dynamic|var|String|List|Map)\b + scope: storage.type.primitive.dart + regexp: + - match: '\\[^''"]' + scope: constant.character.escaped.regex.dart + - match: \( + push: + - meta_content_scope: meta.capture.regex.dart + - match: \) + pop: true + - match: \?(:|=|!) + scope: ignore.capture.regex.dart + - match: \*|\+|\?|\.|\| + scope: keyword.other.regex.dart + - match: \^|\$ + scope: keyword.other.regex.dart + - match: \. + scope: constant.other.regex.dart + - match: '\[(\^)?' + captures: + 1: keyword.other.negation.regex.dart + push: + - meta_scope: constant.character.range.regex.dart + - match: '\]' + pop: true + - match: '\\[^"'']' + scope: constant.character.escaped.regex.dart + - match: '\{(?:\d+)?,(?:\d+)?\}' + scope: keyword.other.regex.dart + string-interp: + - match: '(\$)(\{)' + captures: + 1: keyword.other.dart + 2: keyword.other.dart + push: + - meta_scope: interpolation.dart + - meta_content_scope: source.dart + - match: '(\})' + captures: + 1: keyword.other.dart + pop: true + - include: main + - match: (\$)(\w+) + captures: + 1: keyword.other.dart + 2: variable.parameter.dart + - match: \\. + scope: constant.character.escape.dart + strings: + - match: (?) + captures: + 1: keyword.control.elixir + push: + - match: $ + pop: true + - include: core_syntax + - match: \b(fn)\b(?=.*->) + captures: + 1: keyword.control.elixir + push: + - match: (?>(->)|(when)|(\))) + captures: + 1: keyword.operator.other.elixir + 2: keyword.control.elixir + 3: punctuation.definition.parameters.elixir + pop: true + - include: core_syntax + - include: core_syntax + - match: ^(?=.*->)((?![^"']*("|'')[^"']*->)|(?=.*->[^"']*("|'')[^"']*->))((?!.*\([^\)]*->)|(?=[^\(\)]*->)|(?=\s*\(.*\).*->))((?!.*\b(fn)\b)|(?=.*->.*\bfn\b)) + captures: + 1: keyword.control.elixir + push: + - match: (?>(->)|(when)|(\)|)) + captures: + 1: keyword.operator.other.elixir + 2: keyword.control.elixir + 3: punctuation.definition.parameters.elixir + pop: true + - include: core_syntax + + function_body: + - meta_scope: meta.function.elixir + - match: (\bdo:)|(\bdo\b)|(?=\s+(defp|defmacrop)\b) + captures: + 1: constant.other.keywords.elixir + 2: keyword.control.module.elixir + pop: true + - include: main + - match: \s(\\\\) + captures: + 1: keyword.operator.other.elixir + push: + - match: ',|\)|$' + pop: true + - include: main + - match: \b(is_atom|is_binary|is_bitstring|is_boolean|is_float|is_function|is_integer|is_list|is_map|is_nil|is_number|is_pid|is_port|is_record|is_reference|is_tuple|is_exception|abs|bit_size|byte_size|div|elem|hd|length|map_size|node|rem|round|tl|trunc|tuple_size)\b + scope: keyword.guard.elixir + + numeric: + - match: '\b(0x[0-9A-Fa-f](?>_?[0-9A-Fa-f])*|0b[01]+|0o[0-7]+|\d(?>_?\d)*(\.\d(?>_?\d)*)?([eE][-+]?\d(?>_?\d)*)?)\b' + scope: constant.numeric.elixir + + binary: + - match: (?><<)(?!<) + scope: punctuation.definition.binary.begin.elixir + push: + - meta_scope: binary.elixir + - match: '>>' + scope: punctuation.definition.binary.end.elixir + pop: true + - match: ',' + scope: punctuation.binary.elixir + - include: numeric + - include: simple_string + - match: '::' + scope: punctuation.binary.elixir + push: + - meta_scope: keyword.type.binary.elixir + - match: (?=,|>>) + pop: true + - include: numeric + - match: '[a-z][\w-]*(?:\((?:(\d+)|([a-z_]\w+))\))?' + captures: + 1: constant.numeric.elixir + 2: variable.numeric.elixir + + escaped_char: + - match: '\\(x[\da-fA-F]{1,2}|.)' + scope: constant.character.escaped.elixir + + interpolated_elixir: + - match: '(#)\{' + scope: punctuation.section.embedded.elixir + captures: + 1: punctuation.embedded.elixir + push: + - meta_scope: source.elixir.embedded.source + - match: '\}' + scope: punctuation.section.embedded.elixir + pop: true + - include: nest_curly_and_self + - include: main + + nest_curly_and_self: + - match: '\{' + scope: punctuation.section.scope.elixir + push: + - match: '\}' + scope: punctuation.section.scope.elixir + pop: true + - include: nest_curly_and_self + - include: main + + regex_sub: + - include: interpolated_elixir + - include: escaped_char + - match: '(\{)\d+(,\d+)?(\})' + scope: string.regexp.arbitrary-repitition.elixir + captures: + 1: punctuation.definition.arbitrary-repitition.elixir + 3: punctuation.definition.arbitrary-repitition.elixir + - match: '\[(?:\^?\])?' + scope: punctuation.definition.character-class.elixir + push: + - meta_scope: string.regexp.character-class.elixir + - match: '\]' + scope: punctuation.definition.character-class.elixir + pop: true + - include: escaped_char + - match: \( + scope: punctuation.definition.group.elixir + push: + - meta_scope: string.regexp.group.elixir + - match: \) + scope: punctuation.definition.group.elixir + pop: true + - include: regex_sub + - match: '(?<=^|\s)(#)\s[[a-zA-Z0-9,. \t?!-][^\x{00}-\x{7F}]]*$' + 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. + scope: comment.line.number-sign.elixir + captures: + 1: punctuation.definition.comment.elixir + + simple_string: + - match: "'" + comment: single quoted string (allows for interpolation) + scope: punctuation.definition.string.begin.elixir + push: + - meta_scope: string.quoted.single.elixir + - match: "'" + scope: punctuation.definition.string.end.elixir + pop: true + - include: interpolated_elixir + - include: escaped_char + - match: '"' + comment: double quoted string (allows for interpolation) + scope: punctuation.definition.string.begin.elixir + push: + - meta_scope: string.quoted.double.elixir + - match: '"' + scope: punctuation.definition.string.end.elixir + pop: true + - include: interpolated_elixir + - include: escaped_char + + string: + - match: (?>''') + comment: Single-quoted heredocs + scope: punctuation.definition.string.begin.elixir + push: + - meta_scope: string.quoted.single.heredoc.elixir + - match: ^\s*''' + scope: punctuation.definition.string.end.elixir + pop: true + - include: interpolated_elixir + - include: escaped_char + - match: (?>""") + comment: Double-quoted heredocs + scope: punctuation.definition.string.begin.elixir + push: + - meta_scope: string.quoted.double.heredoc.elixir + - match: ^\s*""" + scope: punctuation.definition.string.end.elixir + pop: true + - include: interpolated_elixir + - include: escaped_char + - include: simple_string + - match: '~[a-z](?>""")' + comment: Double-quoted heredocs sigils + scope: punctuation.definition.string.begin.elixir + push: + - meta_scope: string.quoted.double.heredoc.elixir + - match: ^\s*""" + scope: punctuation.definition.string.end.elixir + pop: true + - include: interpolated_elixir + - include: escaped_char + - match: '~[a-z]\{' + comment: sigil (allow for interpolation) + scope: punctuation.definition.string.begin.elixir + push: + - meta_scope: string.interpolated.elixir + - match: '\}[a-z]*' + scope: punctuation.definition.string.end.elixir + pop: true + - include: interpolated_elixir + - include: escaped_char + - match: '~[a-z]\[' + comment: sigil (allow for interpolation) + scope: punctuation.definition.string.begin.elixir + push: + - meta_scope: string.interpolated.elixir + - match: '\][a-z]*' + scope: punctuation.definition.string.end.elixir + pop: true + - include: interpolated_elixir + - include: escaped_char + - match: '~[a-z]\<' + comment: sigil (allow for interpolation) + scope: punctuation.definition.string.begin.elixir + push: + - meta_scope: string.interpolated.elixir + - match: '\>[a-z]*' + scope: punctuation.definition.string.end.elixir + pop: true + - include: interpolated_elixir + - include: escaped_char + - match: '~[a-z]\(' + comment: sigil (allow for interpolation) + scope: punctuation.definition.string.begin.elixir + push: + - meta_scope: string.interpolated.elixir + - match: '\)[a-z]*' + scope: punctuation.definition.string.end.elixir + pop: true + - include: interpolated_elixir + - include: escaped_char + - match: '~[a-z]([^\w])' + comment: sigil (allow for interpolation) + scope: punctuation.definition.string.begin.elixir + push: + - meta_scope: string.interpolated.elixir + - match: '\1[a-z]*' + scope: punctuation.definition.string.end.elixir + pop: true + - include: interpolated_elixir + - include: escaped_char + - include: escaped_char + - match: '~[A-Z](?>""")' + comment: Double-quoted heredocs sigils + scope: punctuation.definition.string.begin.elixir + push: + - meta_scope: string.quoted.other.literal.upper.elixir + - match: ^\s*""" + scope: punctuation.definition.string.end.elixir + pop: true + - match: '~[A-Z]\{' + comment: sigil (without interpolation) + scope: punctuation.definition.string.begin.elixir + push: + - meta_scope: string.quoted.other.literal.upper.elixir + - match: '\}[a-z]*' + scope: punctuation.definition.string.end.elixir + pop: true + - match: '~[A-Z]\[' + comment: sigil (without interpolation) + scope: punctuation.definition.string.begin.elixir + push: + - meta_scope: string.quoted.other.literal.upper.elixir + - match: '\][a-z]*' + scope: punctuation.definition.string.end.elixir + pop: true + - match: '~[A-Z]\<' + comment: sigil (without interpolation) + scope: punctuation.definition.string.begin.elixir + push: + - meta_scope: string.quoted.other.literal.upper.elixir + - match: '\>[a-z]*' + scope: punctuation.definition.string.end.elixir + pop: true + - match: '~[A-Z]\(' + comment: sigil (without interpolation) + scope: punctuation.definition.string.begin.elixir + push: + - meta_scope: string.quoted.other.literal.upper.elixir + - match: '\)[a-z]*' + scope: punctuation.definition.string.end.elixir + pop: true + - match: '~[A-Z]([^\w])' + comment: sigil (without interpolation) + scope: punctuation.definition.string.begin.elixir + push: + - meta_scope: string.quoted.other.literal.upper.elixir + - match: '\1[a-z]*' + scope: punctuation.definition.string.end.elixir + pop: true + + def_blocks: + - match: ^\s*(defmodule)\b + captures: + 1: keyword.control.module.elixir + push: + - meta_scope: meta.module.elixir + - match: \b(do)\b + captures: + 1: keyword.control.module.elixir + pop: true + - match: '\b[A-Z]\w*\b' + scope: entity.name.class.elixir + - match: ^\s*(defprotocol)\b + captures: + 1: keyword.control.protocol.elixir + push: + - meta_scope: meta.protocol_declaration.elixir + - match: \b(do)\b + captures: + 1: keyword.control.protocol.elixir + pop: true + - match: '\b[A-Z]\w*\b' + scope: entity.name.protocol.elixir + - match: ^\s*(defimpl)\b + captures: + 1: keyword.control.protocol.elixir + push: + - meta_scope: meta.protocol_implementation.elixir + - match: \b(do)\b + captures: + 1: keyword.control.protocol.elixir + pop: true + - match: '\b[A-Z]\w*\b' + scope: entity.name.protocol.elixir + - match: '^\s*(def|defmacro)\s+([a-zA-Z_]\w*)(?:(\()|\s*)' + captures: + 1: keyword.control.module.elixir + 2: entity.name.function.public.elixir + 3: punctuation.definition.parameters.elixir + push: function_body + - match: '^\s*(defp|defmacrop)\s+([a-zA-Z_]\w*)(?:(\()|\s*)' + captures: + 1: keyword.control.module.elixir + 2: entity.name.function.private.elixir + 3: punctuation.definition.parameters.elixir + push: function_body + + docs: + - match: '@(module|type)?doc (~[a-z])?"""' + comment: "@doc with heredocs is treated as documentation" + push: + - meta_scope: comment.documentation.heredoc + - match: \s*""" + pop: true + - include: interpolated_elixir + - include: escaped_char + - match: '@(module|type)?doc ~[A-Z]"""' + comment: "@doc with heredocs is treated as documentation" + push: + - meta_scope: comment.documentation.heredoc + - match: \s*""" + pop: true + - match: "@(module|type)?doc (~[a-z])?'''" + comment: "@doc with heredocs is treated as documentation" + push: + - meta_scope: comment.documentation.heredoc + - match: \s*''' + pop: true + - include: interpolated_elixir + - include: escaped_char + - match: "@(module|type)?doc ~[A-Z]'''" + comment: "@doc with heredocs is treated as documentation" + push: + - meta_scope: comment.documentation.heredoc + - match: \s*''' + pop: true + - match: "@(module|type)?doc false" + comment: "@doc false is treated as documentation" + scope: comment.documentation.false + - match: '@(module|type)?doc "' + comment: "@doc with string is treated as documentation" + push: + - meta_scope: comment.documentation.string + - match: '"' + pop: true + - include: interpolated_elixir + - include: escaped_char + + punctuations: + - match: '<-|->' + scope: keyword.operator.arrow.elixir + - match: '<>' + scope: keyword.operator.binary-concatenation.elixir + - match: '\|>' + scope: keyword.operator.pipe.elixir + - match: \+\+|-- + scope: keyword.operator.list-manipulation.elixir + - match: \.\. + scope: keyword.operator.range.elixir + - match: => + scope: keyword.operator.map-pair.elixir + - match: (\|\|\||&&&|^^^|<<<|>>>|~~~) + scope: keyword.operator.bitwise.elixir + - match: \||\*\*|\\\\|~ + scope: keyword.operator.other.elixir + - match: "===?|!==?|<=?|>=?" + scope: keyword.operator.comparison.elixir + - match: '(?<=[ \t])!+|\bnot\b|&&|\band\b|\|\||\bor\b|\bxor\b' + scope: keyword.operator.logical.elixir + - match: \+|-|\*|/ + scope: keyword.operator.arithmetic.elixir + - match: "=" + scope: keyword.operator.assignment.elixir + - match: \; + scope: punctuation.separator.statement.elixir + - match: "," + scope: punctuation.separator.object.elixir + - match: \. + scope: punctuation.separator.method.elixir + - match: '\{|\}' + scope: punctuation.section.scope.elixir + - match: '\[|\]' + scope: punctuation.section.array.elixir + - match: \(|\) + scope: punctuation.section.function.elixir + + core_syntax: + - include: binary + - include: numeric + - include: string + - include: def_blocks + - include: docs + - include: punctuations + + - match: '(?[a-zA-Z_][\w@]*(?>[?!]|=(?![>=]))?|\<\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\-|\|>|=>|=~|=|/|\\\\|\*\*?|\.\.?\.?|>=?|<=?|&&?&?|\+\+?|\-\-?|\|\|?\|?|\!|@|\%?\{\}|%|\[\]|\^(\^\^)?)' + comment: symbols + scope: constant.other.symbol.elixir + captures: + 1: punctuation.definition.constant.elixir + - match: '(?>[a-zA-Z_][\w@]*(?>[?!])?)(:)(?!:)' + comment: symbols + scope: constant.other.keywords.elixir + captures: + 1: punctuation.definition.constant.elixir + - match: ^\s*(##).*$\n? + scope: comment.line.section.elixir + captures: + 1: punctuation.definition.comment.elixir + - match: '(?:^[ \t]+)?(#).*$\n?' + scope: comment.line.number-sign.elixir + captures: + 1: punctuation.definition.comment.elixir + - match: '(?\])?\s*([_[:alpha:]0-9,\._`\s]+)(:)' + captures: + 1: keyword.fsharp + 2: keyword.fsharp + 3: support.function.attribute.fsharp + 5: keyword.fsharp + push: + - meta_scope: abstract.definition.fsharp + - match: \s*(with)\b|=|$ + captures: + 1: keyword.fsharp + pop: true + - include: comments + - include: common_declaration + - match: '(\?{0,1})([[:alpha:]0-9''`^._ ]+)\s*(:)(\s*([[:alpha:]0-9''`^._ ]+)){0,1}' + captures: + 1: keyword.symbol.fsharp + 2: variable.parameter.fsharp + 3: keyword.symbol.fsharp + 4: entity.name.type.fsharp + - match: '(?!with|get|set\b)\b([\w0-9''`^._]+)' + captures: + 1: entity.name.type.fsharp + - include: keywords + anonymous_functions: + - match: \b(fun)\b + captures: + 1: keyword.fsharp + push: + - meta_scope: function.anonymous + - match: (->) + captures: + 1: keyword.fsharp + pop: true + - include: comments + - match: (\() + captures: + 1: keyword.symbol.fsharp + push: + - match: \s*(?=(->)) + captures: + 1: keyword.symbol.fsharp + pop: true + - include: member_declaration + - include: variables + attributes: + - match: '\[\<' + push: + - meta_scope: support.function.attribute.fsharp + - match: '\>\]|\]' + pop: true + - include: main + cexprs: + - match: '\b(async|seq|promise|task|maybe|asyncMaybe|controller|scope|application|pipeline)\s*\{' + scope: cexpr.fsharp + captures: + 0: keyword.fsharp + chars: + - match: ('\\?.') + scope: char.fsharp + captures: + 1: string.quoted.single.fsharp + comments: + - match: (\(\*(?!\))) + captures: + 1: comment.block.fsharp + push: + - meta_scope: comment.block.fsharp + - match: (\*\)) + captures: + 1: comment.block.fsharp + pop: true + - match: //.*$ + scope: comment.line.double-slash.fsharp + common_binding_definition: + - include: comments + - include: attributes + - match: (:)\s*(\()\s*(static member|member) + captures: + 1: keyword.symbol.fsharp + 2: keyword.symbol.fsharp + 3: keyword.fsharp + push: + - match: (\))\s*((?=,)|(?=\=)) + captures: + 1: keyword.symbol.fsharp + pop: true + - match: '(\^[[:alpha:]0-9''._]+)' + captures: + 1: entity.name.type.fsharp + - include: variables + - include: keywords + - match: (:)\s*(\() + captures: + 1: keyword.symbol.fsharp + 2: keyword.symbol.fsharp + push: + - match: '(\)\s*(([?[:alpha:]0-9''`^._ ]*)))' + captures: + 1: keyword.symbol.fsharp + 2: entity.name.type.fsharp + pop: true + - include: tuple_signature + - match: '(:)\s*(\^[[:alpha:]0-9''._]+)\s*(when)' + captures: + 1: keyword.symbol.fsharp + 2: entity.name.type.fsharp + 3: keyword.fsharp + push: + - match: (?=:) + captures: + 1: keyword.symbol.fsharp + pop: true + - match: \b(and|when|or)\b + scope: keyword.fsharp + - match: "([[:alpha:]0-9'^._]+)" + comment: Because we first capture the keywords, we can capture what looks like a word and assume it's an entity definition + captures: + 1: entity.name.type.fsharp + - match: (\(|\)) + scope: keyword.symbol.fsharp + - match: '(:)\s*([?[:alpha:]0-9''`^._ ]+)' + captures: + 1: keyword.symbol.fsharp + 2: entity.name.type.fsharp + - match: '(->)\s*(\()?\s*([?[:alpha:]0-9''`^._ ]+)*' + captures: + 1: keyword.symbol.fsharp + 2: keyword.symbol.fsharp + 3: entity.name.type.fsharp + - match: (\*)\s*(\() + captures: + 1: keyword.symbol.fsharp + 2: keyword.symbol.fsharp + push: + - match: '(\)\s*(([?[:alpha:]0-9''`^._ ]+))+)' + captures: + 1: keyword.symbol.fsharp + 2: entity.name.type.fsharp + pop: true + - include: tuple_signature + - match: '(\*)(\s*([?[:alpha:]0-9''`^._ ]+))*' + captures: + 1: keyword.symbol.fsharp + 2: entity.name.type.fsharp + - match: '(<(?![[:space:]]*\)))' + captures: + 1: keyword.symbol.fsharp + push: + - match: ((?) + captures: + 1: keyword.symbol.fsharp + pop: true + - include: generic_declaration + - match: "({)" + captures: + 1: keyword.symbol.fsharp + push: + - match: "(})" + captures: + 1: keyword.symbol.fsharp + pop: true + - include: record_signature + - include: definition + - include: variables + - include: keywords + common_declaration: + - match: '\s*(->)\s*([[:alpha:]0-9''`^._ ]+)(<)' + captures: + 1: keyword.symbol.fsharp + 2: entity.name.type.fsharp + 3: keyword.symbol.fsharp + push: + - match: (>) + captures: + 1: keyword.symbol.fsharp + pop: true + - match: "([[:alpha:]0-9'`^._ ]+)" + captures: + 1: entity.name.type.fsharp + - include: keywords + - match: '\s*(->)\s*(?!with|get|set\b)\b([\w0-9''`^._]+)' + captures: + 1: keyword.symbol.fsharp + 2: entity.name.type.fsharp + - match: '(\?{0,1})([[:alpha:]0-9''`^._ ]+)\s*(:)(\s*([?[:alpha:]0-9''`^._ ]+)(<))' + captures: + 1: keyword.symbol.fsharp + 2: variable.parameter.fsharp + 3: keyword.symbol.fsharp + 4: keyword.symbol.fsharp + 5: entity.name.type.fsharp + push: + - match: (>) + captures: + 1: keyword.symbol.fsharp + pop: true + - match: "([[:alpha:]0-9'`^._ ]+)" + captures: + 1: entity.name.type.fsharp + - include: keywords + compiler_directives: + - match: \s?(#if|#elif|#else|#elseif|#endif|#light|#nowarn) + scope: compiler_directive.fsharp + captures: + constants: + - match: \(\) + scope: constant.language.unit.fsharp + - match: '\b-?[0-9][0-9_]*((\.([0-9][0-9_]*([eE][+-]??[0-9][0-9_]*)?)?)|([eE][+-]??[0-9][0-9_]*))' + scope: constant.numeric.floating-point.fsharp + - match: '\b(-?((0(x|X)[0-9a-fA-F][0-9a-fA-F_]*)|(0(o|O)[0-7][0-7_]*)|(0(b|B)[01][01_]*)|([0-9][0-9_]*)))' + scope: constant.numeric.integer.nativeint.fsharp + - match: \b(true|false|null|unit)\b + scope: constant.others.fsharp + definition: + - match: '\b(let mutable|static let mutable|let inline|let|member val|static member inline|static member|default|member|override|let!)(\s+rec|mutable)?(\s+\[\<.*\>\])?\s*(private|internal|public)?\s+(\[[^-=]*\]|[_[:alpha:]]([_[:alpha:]0-9,\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\._`\s]+|(?<=,)\s)*)?' + captures: + 1: keyword.fsharp + 2: keyword.fsharp + 3: support.function.attribute.fsharp + 4: keyword.fsharp + 5: variable.fsharp + push: + - meta_scope: binding.fsharp + - match: \s*(with\b|=|\n+=|(?<=\=)) + captures: + 1: keyword.fsharp + pop: true + - include: common_binding_definition + - match: '\b(static val mutable|val mutable|val)(\s+rec|mutable)?(\s+\[\<.*\>\])?\s*(private|internal|public)?\s+(\[[^-=]*\]|[_[:alpha:]]([_[:alpha:]0-9,\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\._`\s]+|(?<=,)\s)*)?' + captures: + 1: keyword.fsharp + 2: keyword.fsharp + 3: support.function.attribute.fsharp + 4: keyword.fsharp + 5: variable.fsharp + push: + - meta_scope: binding.fsharp + - match: \n$ + pop: true + - include: common_binding_definition + double_tick: + - match: (``)(.*)(``) + scope: variable.other.binding.fsharp + captures: + 1: string.quoted.single.fsharp + 2: variable.other.binding.fsharp + 3: string.quoted.single.fsharp + du_declaration: + - match: \b(of)\b + captures: + 1: keyword.fsharp + push: + - meta_scope: du_declaration.fsharp + - match: $|(\|) + captures: + 1: keyword.symbol.fsharp + pop: true + - include: comments + - match: '([[:alpha:]0-9''`<>^._]+|``[[:alpha:]0-9'' <>^._]+``)\s*(:)\s*([[:alpha:]0-9''`<>^._]+|``[[:alpha:]0-9'' <>^._]+``)' + captures: + 1: variable.parameter.fsharp + 2: keyword.symbol.fsharp + 3: entity.name.type.fsharp + - match: "([[:alpha:]0-9'`^._]+)|``([[:alpha:]0-9'^._ ]+)``" + captures: + 1: entity.name.type.fsharp + - include: keywords + generic_declaration: + - match: (:)\s*(\()\s*(static member|member) + captures: + 1: keyword.symbol.fsharp + 2: keyword.symbol.fsharp + 3: keyword.fsharp + push: + - match: (\)) + captures: + 1: keyword.symbol.fsharp + pop: true + - match: (\() + captures: + 1: keyword.symbol.fsharp + push: + - match: (\)) + captures: + 1: keyword.symbol.fsharp + pop: true + - include: member_declaration + - match: '((''|\^)[[:alpha:]0-9''._]+)' + captures: + 1: entity.name.type.fsharp + - include: variables + - include: keywords + - match: \b(private|to|public|internal|function|yield!|yield|class|exception|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\!|return\!|return|interface|with|abstract|property|union|enum|member|try|finally|and|when|use|use\!|struct|while|mutable)(?!')\b + scope: keyword.fsharp + - match: ":" + scope: keyword.fsharp + - include: constants + - match: '((''|\^)[[:alpha:]0-9''._]+)' + captures: + 1: entity.name.type.fsharp + - match: (<) + captures: + 1: keyword.symbol.fsharp + push: + - match: (>) + captures: + 1: keyword.symbol.fsharp + pop: true + - match: '((''|\^)[[:alpha:]0-9''._]+)' + captures: + 1: entity.name.type.fsharp + - include: tuple_signature + - include: generic_declaration + - match: '(?!when|and|or\b)\b([\w0-9''`^._]+)' + captures: + 1: entity.name.type.fsharp + - match: (\|) + captures: + 1: keyword.symbol.fsharp + - include: keywords + keywords: + - match: \b(private|to|public|internal|function|yield!|yield|class|exception|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\!|return\!|return|interface|with|abstract|property|union|enum|member|try|finally|and|when|or|use|use\!|struct|while|mutable)(?!')\b + scope: keyword.fsharp + - match: '(&&&|\|\|\||\^\^\^|~~~|<<<|>>>|\|>|\->|\<\-|:>|:\?>|:|\[|\]|\;|<>|=|@|\|\||&&|{|}|\||_|\.\.|\,|\+|\-|\*|\/|\^|\!|\>|\>\=|\>\>|\<|\<\=|\(|\)|\<\<)' + scope: keyword.symbol.fsharp + member_declaration: + - include: comments + - include: common_declaration + - match: (:)\s*(\()\s*(static member|member) + captures: + 1: keyword.symbol.fsharp + 2: keyword.symbol.fsharp + 3: keyword.fsharp + push: + - match: (\))\s*((?=,)|(?=\=)) + captures: + 1: keyword.symbol.fsharp + pop: true + - match: (\() + captures: + 1: keyword.symbol.fsharp + push: + - match: (\)) + captures: + 1: keyword.symbol.fsharp + pop: true + - include: member_declaration + - match: '(\^[[:alpha:]0-9''._]+)' + captures: + 1: entity.name.type.fsharp + - include: variables + - include: keywords + - match: '(\^[[:alpha:]0-9''._]+)' + captures: + 1: entity.name.type.fsharp + - match: \b(and|when|or)\b + scope: keyword.fsharp + - match: (\(|\)) + scope: keyword.symbol.fsharp + - match: '(\?{0,1})([[:alpha:]0-9''`^._]+|``[[:alpha:]0-9''`^:,._ ]+``)\s*(:{0,1})(\s*([?[:alpha:]0-9''`<>._ ]+)){0,1}' + captures: + 1: keyword.symbol.fsharp + 2: variable.parameter.fsharp + 3: keyword.symbol.fsharp + 4: entity.name.type.fsharp + - include: keywords + modules: + - match: '\b(namespace|module)\s*(public|internal|private)?\s+([[:alpha:]][[:alpha:]0-9''_. ]*)' + captures: + 1: keyword.fsharp + 2: keyword.fsharp + 3: entity.name.section.fsharp + push: + - meta_scope: entity.name.section.fsharp + - match: (\s?=|\s|$) + captures: + 1: keyword.symbol.fsharp + pop: true + - match: '(\.)([A-Z][[:alpha:]0-9''_]*)' + scope: entity.name.section.fsharp + captures: + 1: punctuation.separator.namespace-reference.fsharp + 2: entity.name.section.fsharp + - match: '\b(open)\s+([[:alpha:]][[:alpha:]0-9''_]*)(?=(\.[A-Z][[:alpha:]0-9_]*)*)' + captures: + 1: keyword.fsharp + 2: entity.name.section.fsharp + push: + - meta_scope: namespace.open.fsharp + - match: (\s|$) + pop: true + - match: '(\.)([[:alpha:]][[:alpha:]0-9''_]*)' + scope: entity.name.section.fsharp + captures: + 1: punctuation.separator.namespace-reference.fsharp + 2: entity.name.section.fsharp + - match: '^\s*(module)\s+([A-Z][[:alpha:]0-9''_]*)\s*(=)\s*([A-Z][[:alpha:]0-9''_]*)' + captures: + 1: keyword.fsharp + 2: entity.name.type.namespace.fsharp + 3: punctuation.separator.namespace-definition.fsharp + 4: entity.name.section.fsharp + push: + - meta_scope: namespace.alias.fsharp + - match: (\s|$) + pop: true + - match: '(\.)([A-Z][[:alpha:]0-9''_]*)' + scope: entity.name.section.fsharp + captures: + 1: punctuation.separator.namespace-reference.fsharp + 2: entity.name.section.fsharp + record_declaration: + - match: '(\{)' + captures: + 1: keyword.symbol.fsharp + push: + - match: '(?<=\})' + pop: true + - include: comments + - match: '(((mutable)\s[[:alpha:]]+)|[[:alpha:]0-9''`<>^._]*)\s*((?) + captures: + 1: keyword.fsharp + pop: true + - match: '((''|\^)``[[:alpha:]0-9`^:,._ ]+``|(''|\^)[[:alpha:]0-9`^:._]+)' + captures: + 1: entity.name.type.fsharp + - match: \b(interface|with|abstract|and|when|or|not|struct|equality|comparison|unmanaged|delegate|enum)\b + scope: keyword.fsharp + - match: (\() + captures: + 1: keyword.symbol.fsharp + push: + - match: (\)) + captures: + 1: keyword.symbol.fsharp + pop: true + - match: (static member|member|new) + captures: + 1: keyword.fsharp + - include: common_binding_definition + - match: '([\w0-9''`^._]+)' + captures: + 1: entity.name.type.fsharp + - include: keywords + - match: \s*(private|internal|public) + captures: + 1: keyword.symbol.fsharp + 2: keyword.fsharp + - match: (\() + captures: + 1: keyword.symbol.fsharp + push: + - match: '\s*(?=(=)|[\n=]|(\(\))|(as))' + captures: + 1: keyword.symbol.fsharp + pop: true + - include: member_declaration + - include: keywords + string_formatter: + - match: (%0?-?(\d+)?((a|t)|(\.\d+)?(f|F|e|E|g|G|M)|(b|c|s|d|i|x|X|o|u)|(s|b|O)|(\+?A))) + scope: entity.name.type.format.specifier.fsharp + captures: + 1: keyword.format.specifier.fsharp + strings: + - match: '(?=[^\\])(@")' + captures: + 1: punctuation.definition.string.begin.fsharp + push: + - meta_scope: string.quoted.literal.fsharp + - match: (")(?!") + captures: + 1: punctuation.definition.string.end.fsharp + pop: true + - match: '"(")' + scope: constant.character.string.escape.fsharp + - match: '(?=[^\\])(""")' + captures: + 1: punctuation.definition.string.begin.fsharp + push: + - meta_scope: string.quoted.triple.fsharp + - match: (""") + captures: + 1: punctuation.definition.string.end.fsharp + pop: true + - include: string_formatter + - match: '(?=[^\\])(")' + captures: + 1: punctuation.definition.string.begin.fsharp + push: + - meta_scope: string.quoted.double.fsharp + - match: (") + captures: + 1: punctuation.definition.string.end.fsharp + pop: true + - match: '\\$[ \t]*' + scope: punctuation.separator.string.ignore-eol.fsharp + - match: '\\([\\''''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})' + scope: constant.character.string.escape.fsharp + - match: '\\(?![\\''''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8}).' + scope: invalid.illeagal.character.string.fsharp + - include: string_formatter + strp_inlined: + - match: (\() + captures: + 1: keyword.symbol.fsharp + push: + - match: (\)) + captures: + 1: keyword.symbol.fsharp + pop: true + - include: strp_inlined_body + strp_inlined_body: + - include: comments + - include: anonymous_functions + - match: '(\^[[:alpha:]0-9''._]+)' + captures: + 1: entity.name.type.fsharp + - match: \b(and|when|or)\b + scope: keyword.fsharp + - match: (\() + captures: + 1: keyword.symbol.fsharp + push: + - match: (\)) + captures: + 1: keyword.symbol.fsharp + pop: true + - include: strp_inlined_body + - match: '(static member|member)\s*([[:alpha:]0-9''`<>^._]+|``[[:alpha:]0-9'' <>^._]+``)\s*(:)' + captures: + 1: keyword.fsharp + 2: variable.fsharp + 3: keyword.symbol.fsharp + - include: compiler_directives + - include: constants + - include: strings + - include: chars + - include: double_tick + - include: keywords + - include: text + - include: definition + - include: attributes + - include: keywords + - include: cexprs + - include: text + text: + - match: \\ + scope: text.fsharp + tuple_signature: + - match: "(([?[:alpha:]0-9'`^._ ]+))+" + captures: + 1: entity.name.type.fsharp + - match: (\() + captures: + 1: keyword.symbol.fsharp + push: + - match: (\)) + captures: + 1: keyword.symbol.fsharp + pop: true + - match: "(([?[:alpha:]0-9'`^._ ]+))+" + captures: + 1: entity.name.type.fsharp + - include: tuple_signature + - include: keywords + variables: + - match: \(\) + scope: constant.language.unit.fsharp + - match: '(\?{0,1})(``[[:alpha:]0-9''`^:,._ ]+``|[[:alpha:]0-9''`<>^._ ]\w*)' + captures: + 1: keyword.symbol.fsharp + 2: variable.parameter.fsharp diff --git a/assets/syntaxes/FSharp.sublime-syntax b/assets/syntaxes/FSharp.sublime-syntax new file mode 100644 index 0000000..d7fb525 --- /dev/null +++ b/assets/syntaxes/FSharp.sublime-syntax @@ -0,0 +1,672 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: "F#" +file_extensions: + - fs + - fsi + - fsx +scope: source.fsharp +contexts: + main: + - include: compiler_directives + - include: comments + - include: constants + - include: strings + - include: chars + - include: double_tick + - include: definition + - include: abstract_definition + - include: attributes + - include: modules + - include: anonymous_functions + - include: du_declaration + - include: record_declaration + - include: records + - include: strp_inlined + - include: keywords + - include: cexprs + - include: text + abstract_definition: + - match: '\b(abstract)\s+(member)?(\s+\[\<.*\>\])?\s*([_[:alpha:]0-9,\._`\s]+)(:)' + captures: + 1: keyword.fsharp + 2: keyword.fsharp + 3: support.function.attribute.fsharp + 5: keyword.fsharp + push: + - meta_scope: abstract.definition.fsharp + - match: \s*(with)\b|=|$ + captures: + 1: keyword.fsharp + pop: true + - include: comments + - include: common_declaration + - match: '(\?{0,1})([[:alpha:]0-9''`^._ ]+)\s*(:)(\s*([[:alpha:]0-9''`^._ ]+)){0,1}' + captures: + 1: keyword.symbol.fsharp + 2: variable.parameter.fsharp + 3: keyword.symbol.fsharp + 4: entity.name.type.fsharp + - match: '(?!with|get|set\b)\b([\w0-9''`^._]+)' + captures: + 1: entity.name.type.fsharp + - include: keywords + anonymous_functions: + - match: \b(fun)\b + captures: + 1: keyword.fsharp + push: + - meta_scope: function.anonymous + - match: (->) + captures: + 1: keyword.fsharp + pop: true + - include: comments + - match: (\() + captures: + 1: keyword.symbol.fsharp + push: + - match: \s*(?=(->)) + captures: + 1: keyword.symbol.fsharp + pop: true + - include: member_declaration + - include: variables + attributes: + - match: '\[\<' + push: + - meta_scope: support.function.attribute.fsharp + - match: '\>\]|\]' + pop: true + - include: main + cexprs: + - match: '\b(async|seq|promise|task|maybe|asyncMaybe|controller|scope|application|pipeline)\s*\{' + scope: cexpr.fsharp + captures: + 0: keyword.fsharp + chars: + - match: ('\\?.') + scope: char.fsharp + captures: + 1: string.quoted.single.fsharp + comments: + - match: (\(\*(?!\))) + captures: + 1: comment.block.fsharp + push: + - meta_scope: comment.block.fsharp + - match: (\*\)) + captures: + 1: comment.block.fsharp + pop: true + - match: //.*$ + scope: comment.line.double-slash.fsharp + common_binding_definition: + - include: comments + - include: attributes + - match: (:)\s*(\()\s*(static member|member) + captures: + 1: keyword.symbol.fsharp + 2: keyword.symbol.fsharp + 3: keyword.fsharp + push: + - match: (\))\s*((?=,)|(?=\=)) + captures: + 1: keyword.symbol.fsharp + pop: true + - match: '(\^[[:alpha:]0-9''._]+)' + captures: + 1: entity.name.type.fsharp + - include: variables + - include: keywords + - match: (:)\s*(\() + captures: + 1: keyword.symbol.fsharp + 2: keyword.symbol.fsharp + push: + - match: '(\)\s*(([?[:alpha:]0-9''`^._ ]*)))' + captures: + 1: keyword.symbol.fsharp + 2: entity.name.type.fsharp + pop: true + - include: tuple_signature + - match: '(:)\s*(\^[[:alpha:]0-9''._]+)\s*(when)' + captures: + 1: keyword.symbol.fsharp + 2: entity.name.type.fsharp + 3: keyword.fsharp + push: + - match: (?=:) + captures: + 1: keyword.symbol.fsharp + pop: true + - match: \b(and|when|or)\b + scope: keyword.fsharp + - match: "([[:alpha:]0-9'^._]+)" + comment: Because we first capture the keywords, we can capture what looks like a word and assume it's an entity definition + captures: + 1: entity.name.type.fsharp + - match: (\(|\)) + scope: keyword.symbol.fsharp + - match: '(:)\s*([?[:alpha:]0-9''`^._ ]+)' + captures: + 1: keyword.symbol.fsharp + 2: entity.name.type.fsharp + - match: '(->)\s*(\()?\s*([?[:alpha:]0-9''`^._ ]+)*' + captures: + 1: keyword.symbol.fsharp + 2: keyword.symbol.fsharp + 3: entity.name.type.fsharp + - match: (\*)\s*(\() + captures: + 1: keyword.symbol.fsharp + 2: keyword.symbol.fsharp + push: + - match: '(\)\s*(([?[:alpha:]0-9''`^._ ]+))+)' + captures: + 1: keyword.symbol.fsharp + 2: entity.name.type.fsharp + pop: true + - include: tuple_signature + - match: '(\*)(\s*([?[:alpha:]0-9''`^._ ]+))*' + captures: + 1: keyword.symbol.fsharp + 2: entity.name.type.fsharp + - match: '(<(?![[:space:]]*\)))' + captures: + 1: keyword.symbol.fsharp + push: + - match: ((?) + captures: + 1: keyword.symbol.fsharp + pop: true + - include: generic_declaration + - match: "({)" + captures: + 1: keyword.symbol.fsharp + push: + - match: "(})" + captures: + 1: keyword.symbol.fsharp + pop: true + - include: record_signature + - include: definition + - include: variables + - include: keywords + common_declaration: + - match: '\s*(->)\s*([[:alpha:]0-9''`^._ ]+)(<)' + captures: + 1: keyword.symbol.fsharp + 2: entity.name.type.fsharp + 3: keyword.symbol.fsharp + push: + - match: (>) + captures: + 1: keyword.symbol.fsharp + pop: true + - match: "([[:alpha:]0-9'`^._ ]+)" + captures: + 1: entity.name.type.fsharp + - include: keywords + - match: '\s*(->)\s*(?!with|get|set\b)\b([\w0-9''`^._]+)' + captures: + 1: keyword.symbol.fsharp + 2: entity.name.type.fsharp + - match: '(\?{0,1})([[:alpha:]0-9''`^._ ]+)\s*(:)(\s*([?[:alpha:]0-9''`^._ ]+)(<))' + captures: + 1: keyword.symbol.fsharp + 2: variable.parameter.fsharp + 3: keyword.symbol.fsharp + 4: keyword.symbol.fsharp + 5: entity.name.type.fsharp + push: + - match: (>) + captures: + 1: keyword.symbol.fsharp + pop: true + - match: "([[:alpha:]0-9'`^._ ]+)" + captures: + 1: entity.name.type.fsharp + - include: keywords + compiler_directives: + - match: \s?(#if|#elif|#else|#elseif|#endif|#light|#nowarn) + scope: compiler_directive.fsharp + captures: + constants: + - match: \(\) + scope: constant.language.unit.fsharp + - match: '\b-?[0-9][0-9_]*((\.([0-9][0-9_]*([eE][+-]??[0-9][0-9_]*)?)?)|([eE][+-]??[0-9][0-9_]*))' + scope: constant.numeric.floating-point.fsharp + - match: '\b(-?((0(x|X)[0-9a-fA-F][0-9a-fA-F_]*)|(0(o|O)[0-7][0-7_]*)|(0(b|B)[01][01_]*)|([0-9][0-9_]*)))' + scope: constant.numeric.integer.nativeint.fsharp + - match: \b(true|false|null|unit)\b + scope: constant.others.fsharp + definition: + - match: '\b(let mutable|static let mutable|let inline|let|member val|static member inline|static member|default|member|override|let!)(\s+rec|mutable)?(\s+\[\<.*\>\])?\s*(private|internal|public)?\s+(\[[^-=]*\]|[_[:alpha:]]([_[:alpha:]0-9,\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\._`\s]+|(?<=,)\s)*)?' + captures: + 1: keyword.fsharp + 2: keyword.fsharp + 3: support.function.attribute.fsharp + 4: keyword.fsharp + 5: variable.fsharp + push: + - meta_scope: binding.fsharp + - match: \s*(with\b|=|\n+=|(?<=\=)) + captures: + 1: keyword.fsharp + pop: true + - include: common_binding_definition + - match: '\b(static val mutable|val mutable|val)(\s+rec|mutable)?(\s+\[\<.*\>\])?\s*(private|internal|public)?\s+(\[[^-=]*\]|[_[:alpha:]]([_[:alpha:]0-9,\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\._`\s]+|(?<=,)\s)*)?' + captures: + 1: keyword.fsharp + 2: keyword.fsharp + 3: support.function.attribute.fsharp + 4: keyword.fsharp + 5: variable.fsharp + push: + - meta_scope: binding.fsharp + - match: \n$ + pop: true + - include: common_binding_definition + double_tick: + - match: (``)(.*)(``) + scope: variable.other.binding.fsharp + captures: + 1: string.quoted.single.fsharp + 2: variable.other.binding.fsharp + 3: string.quoted.single.fsharp + du_declaration: + - match: \b(of)\b + captures: + 1: keyword.fsharp + push: + - meta_scope: du_declaration.fsharp + - match: $|(\|) + captures: + 1: keyword.symbol.fsharp + pop: true + - include: comments + - match: '([[:alpha:]0-9''`<>^._]+|``[[:alpha:]0-9'' <>^._]+``)\s*(:)\s*([[:alpha:]0-9''`<>^._]+|``[[:alpha:]0-9'' <>^._]+``)' + captures: + 1: variable.parameter.fsharp + 2: keyword.symbol.fsharp + 3: entity.name.type.fsharp + - match: "([[:alpha:]0-9'`^._]+)|``([[:alpha:]0-9'^._ ]+)``" + captures: + 1: entity.name.type.fsharp + - include: keywords + generic_declaration: + - match: (:)\s*(\()\s*(static member|member) + captures: + 1: keyword.symbol.fsharp + 2: keyword.symbol.fsharp + 3: keyword.fsharp + push: + - match: (\)) + captures: + 1: keyword.symbol.fsharp + pop: true + - match: (\() + captures: + 1: keyword.symbol.fsharp + push: + - match: (\)) + captures: + 1: keyword.symbol.fsharp + pop: true + - include: member_declaration + - match: '((''|\^)[[:alpha:]0-9''._]+)' + captures: + 1: entity.name.type.fsharp + - include: variables + - include: keywords + - match: \b(private|to|public|internal|function|yield!|yield|class|exception|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\!|return\!|return|interface|with|abstract|property|union|enum|member|try|finally|and|when|use|use\!|struct|while|mutable)(?!')\b + scope: keyword.fsharp + - match: ":" + scope: keyword.fsharp + - include: constants + - match: '((''|\^)[[:alpha:]0-9''._]+)' + captures: + 1: entity.name.type.fsharp + - match: (<) + captures: + 1: keyword.symbol.fsharp + push: + - match: (>) + captures: + 1: keyword.symbol.fsharp + pop: true + - match: '((''|\^)[[:alpha:]0-9''._]+)' + captures: + 1: entity.name.type.fsharp + - include: tuple_signature + - include: generic_declaration + - match: '(?!when|and|or\b)\b([\w0-9''`^._]+)' + captures: + 1: entity.name.type.fsharp + - match: (\|) + captures: + 1: keyword.symbol.fsharp + - include: keywords + keywords: + - match: \b(private|to|public|internal|function|yield!|yield|class|exception|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\!|return\!|return|interface|with|abstract|property|union|enum|member|try|finally|and|when|or|use|use\!|struct|while|mutable)(?!')\b + scope: keyword.fsharp + - match: '(&&&|\|\|\||\^\^\^|~~~|<<<|>>>|\|>|\->|\<\-|:>|:\?>|:|\[|\]|\;|<>|=|@|\|\||&&|{|}|\||_|\.\.|\,|\+|\-|\*|\/|\^|\!|\>|\>\=|\>\>|\<|\<\=|\(|\)|\<\<)' + scope: keyword.symbol.fsharp + member_declaration: + - include: comments + - include: common_declaration + - match: (:)\s*(\()\s*(static member|member) + captures: + 1: keyword.symbol.fsharp + 2: keyword.symbol.fsharp + 3: keyword.fsharp + push: + - match: (\))\s*((?=,)|(?=\=)) + captures: + 1: keyword.symbol.fsharp + pop: true + - match: (\() + captures: + 1: keyword.symbol.fsharp + push: + - match: (\)) + captures: + 1: keyword.symbol.fsharp + pop: true + - include: member_declaration + - match: '(\^[[:alpha:]0-9''._]+)' + captures: + 1: entity.name.type.fsharp + - include: variables + - include: keywords + - match: '(\^[[:alpha:]0-9''._]+)' + captures: + 1: entity.name.type.fsharp + - match: \b(and|when|or)\b + scope: keyword.fsharp + - match: (\(|\)) + scope: keyword.symbol.fsharp + - match: '(\?{0,1})([[:alpha:]0-9''`^._]+|``[[:alpha:]0-9''`^:,._ ]+``)\s*(:{0,1})(\s*([?[:alpha:]0-9''`<>._ ]+)){0,1}' + captures: + 1: keyword.symbol.fsharp + 2: variable.parameter.fsharp + 3: keyword.symbol.fsharp + 4: entity.name.type.fsharp + - include: keywords + modules: + - match: '\b(namespace|module)\s*(public|internal|private)?\s+([[:alpha:]][[:alpha:]0-9''_. ]*)' + captures: + 1: keyword.fsharp + 2: keyword.fsharp + 3: entity.name.section.fsharp + push: + - meta_scope: entity.name.section.fsharp + - match: (\s?=|\s|$) + captures: + 1: keyword.symbol.fsharp + pop: true + - match: '(\.)([A-Z][[:alpha:]0-9''_]*)' + scope: entity.name.section.fsharp + captures: + 1: punctuation.separator.namespace-reference.fsharp + 2: entity.name.section.fsharp + - match: '\b(open)\s+([[:alpha:]][[:alpha:]0-9''_]*)(?=(\.[A-Z][[:alpha:]0-9_]*)*)' + captures: + 1: keyword.fsharp + 2: entity.name.section.fsharp + push: + - meta_scope: namespace.open.fsharp + - match: (\s|$) + pop: true + - match: '(\.)([[:alpha:]][[:alpha:]0-9''_]*)' + scope: entity.name.section.fsharp + captures: + 1: punctuation.separator.namespace-reference.fsharp + 2: entity.name.section.fsharp + - match: '^\s*(module)\s+([A-Z][[:alpha:]0-9''_]*)\s*(=)\s*([A-Z][[:alpha:]0-9''_]*)' + captures: + 1: keyword.fsharp + 2: entity.name.type.namespace.fsharp + 3: punctuation.separator.namespace-definition.fsharp + 4: entity.name.section.fsharp + push: + - meta_scope: namespace.alias.fsharp + - match: (\s|$) + pop: true + - match: '(\.)([A-Z][[:alpha:]0-9''_]*)' + scope: entity.name.section.fsharp + captures: + 1: punctuation.separator.namespace-reference.fsharp + 2: entity.name.section.fsharp + record_declaration: + - match: '(\{)' + captures: + 1: keyword.symbol.fsharp + push: + - match: '(?<=\})' + pop: true + - include: comments + - match: '(((mutable)\s[[:alpha:]]+)|[[:alpha:]0-9''`<>^._]*)\s*((?) + captures: + 1: keyword.fsharp + pop: true + - match: '((''|\^)``[[:alpha:]0-9`^:,._ ]+``|(''|\^)[[:alpha:]0-9`^:._]+)' + captures: + 1: entity.name.type.fsharp + - match: \b(interface|with|abstract|and|when|or|not|struct|equality|comparison|unmanaged|delegate|enum)\b + scope: keyword.fsharp + - match: (\() + captures: + 1: keyword.symbol.fsharp + push: + - match: (\)) + captures: + 1: keyword.symbol.fsharp + pop: true + - match: (static member|member|new) + captures: + 1: keyword.fsharp + - include: common_binding_definition + - match: '([\w0-9''`^._]+)' + captures: + 1: entity.name.type.fsharp + - include: keywords + - match: \s*(private|internal|public) + captures: + 1: keyword.symbol.fsharp + 2: keyword.fsharp + - match: (\() + captures: + 1: keyword.symbol.fsharp + push: + - match: '\s*(?=(=)|[\n=]|(\(\))|(as))' + captures: + 1: keyword.symbol.fsharp + pop: true + - include: member_declaration + - include: keywords + string_formatter: + - match: (%0?-?(\d+)?((a|t)|(\.\d+)?(f|F|e|E|g|G|M)|(b|c|s|d|i|x|X|o|u)|(s|b|O)|(\+?A))) + scope: entity.name.type.format.specifier.fsharp + captures: + 1: keyword.format.specifier.fsharp + strings: + - match: '(?=[^\\])(@")' + captures: + 1: punctuation.definition.string.begin.fsharp + push: + - meta_scope: string.quoted.literal.fsharp + - match: (")(?!") + captures: + 1: punctuation.definition.string.end.fsharp + pop: true + - match: '"(")' + scope: constant.character.string.escape.fsharp + - match: '(?=[^\\])(""")' + captures: + 1: punctuation.definition.string.begin.fsharp + push: + - meta_scope: string.quoted.triple.fsharp + - match: (""") + captures: + 1: punctuation.definition.string.end.fsharp + pop: true + - include: string_formatter + - match: '(?=[^\\])(")' + captures: + 1: punctuation.definition.string.begin.fsharp + push: + - meta_scope: string.quoted.double.fsharp + - match: (") + captures: + 1: punctuation.definition.string.end.fsharp + pop: true + - match: '\\$[ \t]*' + scope: punctuation.separator.string.ignore-eol.fsharp + - match: '\\([\\''''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})' + scope: constant.character.string.escape.fsharp + - match: '\\(?![\\''''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8}).' + scope: invalid.illeagal.character.string.fsharp + - include: string_formatter + strp_inlined: + - match: (\() + captures: + 1: keyword.symbol.fsharp + push: + - match: (\)) + captures: + 1: keyword.symbol.fsharp + pop: true + - include: strp_inlined_body + strp_inlined_body: + - include: comments + - include: anonymous_functions + - match: '(\^[[:alpha:]0-9''._]+)' + captures: + 1: entity.name.type.fsharp + - match: \b(and|when|or)\b + scope: keyword.fsharp + - match: (\() + captures: + 1: keyword.symbol.fsharp + push: + - match: (\)) + captures: + 1: keyword.symbol.fsharp + pop: true + - include: strp_inlined_body + - match: '(static member|member)\s*([[:alpha:]0-9''`<>^._]+|``[[:alpha:]0-9'' <>^._]+``)\s*(:)' + captures: + 1: keyword.fsharp + 2: variable.fsharp + 3: keyword.symbol.fsharp + - include: compiler_directives + - include: constants + - include: strings + - include: chars + - include: double_tick + - include: keywords + - include: text + - include: definition + - include: attributes + - include: keywords + - include: cexprs + - include: text + text: + - match: \\ + scope: text.fsharp + tuple_signature: + - match: "(([?[:alpha:]0-9'`^._ ]+))+" + captures: + 1: entity.name.type.fsharp + - match: (\() + captures: + 1: keyword.symbol.fsharp + push: + - match: (\)) + captures: + 1: keyword.symbol.fsharp + pop: true + - match: "(([?[:alpha:]0-9'`^._ ]+))+" + captures: + 1: entity.name.type.fsharp + - include: tuple_signature + - include: keywords + variables: + - match: \(\) + scope: constant.language.unit.fsharp + - match: '(\?{0,1})(``[[:alpha:]0-9''`^:,._ ]+``|[[:alpha:]0-9''`<>^._ ]\w*)' + captures: + 1: keyword.symbol.fsharp + 2: variable.parameter.fsharp diff --git a/assets/syntaxes/HTML (EEx).sublime-syntax b/assets/syntaxes/HTML (EEx).sublime-syntax new file mode 100644 index 0000000..27eb019 --- /dev/null +++ b/assets/syntaxes/HTML (EEx).sublime-syntax @@ -0,0 +1,497 @@ +%YAML 1.2 +--- +name: HTML (EEx) +file_extensions: + - html.eex +first_line_match: (?i)<(!DOCTYPE\s*)?html +scope: text.html.elixir + +variables: + unquoted_attribute_value: (?:[^\s<>/''"]|/(?!>))+ + not_equals_lookahead: (?=\s*[^\s=]) + +contexts: + interpolation: + - match: <%+[-=]? + scope: punctuation.section.embedded.elixir + embed: scope:source.elixir + embed_scope: source.elixir.embedded.html + escape: \%> + escape_captures: + 0: punctuation.section.embedded.elixir + + immediately-pop: + - match: '' + pop: true + + else-pop: + - match: (?=\S) + pop: true + + main: + - include: interpolation + - match: (<\?)(xml) + captures: + 1: punctuation.definition.tag.begin.html + 2: entity.name.tag.xml.html + push: + - meta_scope: meta.tag.preprocessor.xml.html + - match: '\?>' + scope: punctuation.definition.tag.end.html + pop: true + - include: tag-generic-attribute + - include: string-double-quoted + - include: string-single-quoted + - match: )?\s*() + captures: + 0: meta.tag.script.end.html + 1: comment.block.html punctuation.definition.comment.html + 2: punctuation.definition.tag.begin.html + 3: entity.name.tag.script.html + 4: punctuation.definition.tag.end.html + pop: true + - match: '(>)\s*()?\s*)' + pop: true + - include: tag-attributes + - match: (' + scope: punctuation.definition.tag.end.html + pop: true + - include: tag-attributes + - match: (' + scope: punctuation.definition.tag.end.html + pop: true + - include: tag-attributes + - match: (' + scope: punctuation.definition.tag.end.html + pop: true + - include: tag-attributes + - match: (' + scope: punctuation.definition.tag.end.html + pop: true + - include: tag-attributes + - match: (' + scope: punctuation.definition.tag.end.html + pop: true + - include: tag-attributes + - match: (' + scope: punctuation.definition.tag.end.html + pop: true + - include: tag-attributes + - match: (' + scope: punctuation.definition.tag.end.html + pop: true + - include: tag-attributes + - include: interpolation + - match: (' + scope: punctuation.definition.tag.end.html + pop: true + - include: tag-attributes + - include: interpolation + - match: (' + scope: punctuation.definition.tag.end.html + pop: true + - include: tag-attributes + - include: interpolation + - match: (' + scope: punctuation.definition.tag.end.html + pop: true + - include: tag-attributes + - include: interpolation + - include: entities + - match: <> + scope: invalid.illegal.incomplete.html + entities-common: + - match: (&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;) + scope: constant.character.entity.html + captures: + 1: punctuation.definition.entity.html + 3: punctuation.definition.entity.html + attribute-entities: + - include: entities-common + entities: + - include: entities-common + - match: '&' + scope: invalid.illegal.bad-ampersand.html + string-double-quoted: + - match: '"' + scope: punctuation.definition.string.begin.html + push: + - meta_scope: string.quoted.double.html + - match: '"' + scope: punctuation.definition.string.end.html + pop: true + - include: entities + string-single-quoted: + - match: "'" + scope: punctuation.definition.string.begin.html + push: + - meta_scope: string.quoted.single.html + - match: "'" + scope: punctuation.definition.string.end.html + pop: true + - include: entities + + tag-generic-attribute: + - match: '[a-zA-Z0-9:\-_.]+' + scope: entity.other.attribute-name.html + push: + - tag-generic-attribute-meta + - tag-generic-attribute-equals + + - match: '[a-zA-Z0-9:\-_.]+' + scope: entity.other.attribute-name.html + + tag-generic-attribute-meta: + - meta_scope: meta.attribute-with-value.html + - include: immediately-pop + + tag-generic-attribute-equals: + - match: '=' + scope: punctuation.separator.key-value.html + set: tag-generic-attribute-value + - match: '{{not_equals_lookahead}}' + pop: true + + tag-generic-attribute-value: + - match: '"' + scope: punctuation.definition.string.begin.html + set: + - meta_scope: string.quoted.double.html + - match: '"' + scope: punctuation.definition.string.end.html + pop: true + - include: attribute-entities + - include: interpolation + - match: "'" + scope: punctuation.definition.string.begin.html + set: + - meta_scope: string.quoted.single.html + - match: "'" + scope: punctuation.definition.string.end.html + pop: true + - include: attribute-entities + - include: interpolation + - match: '{{unquoted_attribute_value}}' + scope: string.unquoted.html + - include: else-pop + + tag-class-attribute: + - match: '\bclass\b' + scope: entity.other.attribute-name.class.html + push: + - tag-class-attribute-meta + - tag-class-attribute-equals + + tag-class-attribute-meta: + - meta_scope: meta.attribute-with-value.class.html + - include: immediately-pop + + tag-class-attribute-equals: + - match: '=' + scope: punctuation.separator.key-value.html + set: tag-class-attribute-value + - match: '{{not_equals_lookahead}}' + pop: true + + tag-class-attribute-value: + - match: '"' + scope: punctuation.definition.string.begin.html + set: + - meta_scope: string.quoted.double.html + - meta_content_scope: meta.class-name.html + - match: '"' + scope: punctuation.definition.string.end.html + pop: true + - include: attribute-entities + - include: interpolation + - match: "'" + scope: punctuation.definition.string.begin.html + set: + - meta_scope: string.quoted.single.html + - meta_content_scope: meta.class-name.html + - match: "'" + scope: punctuation.definition.string.end.html + pop: true + - include: attribute-entities + - include: interpolation + - match: '{{unquoted_attribute_value}}' + scope: string.unquoted.html meta.class-name.html + - include: else-pop + + tag-id-attribute: + - match: '\bid\b' + scope: entity.other.attribute-name.id.html + push: + - tag-id-attribute-meta + - tag-id-attribute-equals + + tag-id-attribute-meta: + - meta_scope: meta.attribute-with-value.id.html + - include: immediately-pop + + tag-id-attribute-equals: + - match: '=' + scope: punctuation.separator.key-value.html + set: tag-id-attribute-value + - match: '{{not_equals_lookahead}}' + pop: true + + tag-id-attribute-value: + - match: '"' + scope: punctuation.definition.string.begin.html + set: + - meta_scope: string.quoted.double.html + - meta_content_scope: meta.toc-list.id.html + - match: '"' + scope: punctuation.definition.string.end.html + pop: true + - include: attribute-entities + - match: "'" + scope: punctuation.definition.string.begin.html + set: + - meta_scope: string.quoted.single.html + - meta_content_scope: meta.toc-list.id.html + - match: "'" + scope: punctuation.definition.string.end.html + pop: true + - include: attribute-entities + - match: '{{unquoted_attribute_value}}' + scope: string.unquoted.html meta.toc-list.id.html + - include: else-pop + + tag-style-attribute: + - match: '\bstyle\b' + scope: entity.other.attribute-name.style.html + push: + - tag-style-attribute-meta + - tag-style-attribute-equals + + tag-style-attribute-meta: + - meta_scope: meta.attribute-with-value.style.html + - include: immediately-pop + + tag-style-attribute-equals: + - match: '=' + scope: punctuation.separator.key-value.html + set: tag-style-attribute-value + - match: '{{not_equals_lookahead}}' + pop: true + + tag-style-attribute-value: + - match: '"' + scope: string.quoted.double punctuation.definition.string.begin.html + embed: scope:source.css#rule-list-body + embed_scope: source.css + escape: '"' + escape_captures: + 0: string.quoted.double punctuation.definition.string.end.html + - match: "'" + scope: string.quoted.single punctuation.definition.string.begin.html + embed: scope:source.css#rule-list-body + embed_scope: source.css + escape: "'" + escape_captures: + 0: string.quoted.single punctuation.definition.string.end.html + - include: else-pop + + tag-event-attribute: + - match: |- + (?x)\bon( + abort|autocomplete|autocompleteerror|blur|cancel|canplay + |canplaythrough|change|click|close|contextmenu|cuechange|dblclick|drag + |dragend|dragenter|dragexit|dragleave|dragover|dragstart|drop + |durationchange|emptied|ended|error|focus|input|invalid|keydown + |keypress|keyup|load|loadeddata|loadedmetadata|loadstart|mousedown + |mouseenter|mouseleave|mousemove|mouseout|mouseover|mouseup|mousewheel + |pause|play|playing|progress|ratechange|reset|resize|scroll|seeked + |seeking|select|show|sort|stalled|submit|suspend|timeupdate|toggle + |volumechange|waiting + )\b + scope: entity.other.attribute-name.event.html + push: + - tag-event-attribute-meta + - tag-event-attribute-equals + + tag-event-attribute-meta: + - meta_scope: meta.attribute-with-value.event.html + - include: immediately-pop + + tag-event-attribute-equals: + - match: '=' + scope: punctuation.separator.key-value.html + set: tag-event-attribute-value + - match: '{{not_equals_lookahead}}' + pop: true + + tag-event-attribute-value: + - match: '"' + scope: string.quoted.double punctuation.definition.string.begin.html + embed: scope:source.js + embed_scope: meta.attribute-with-value.event.html + escape: '"' + escape_captures: + 0: string.quoted.double punctuation.definition.string.end.html + - match: "'" + scope: string.quoted.single punctuation.definition.string.begin.html meta.attribute-with-value.event.html + embed: scope:source.js + embed_scope: meta.attribute-with-value.event.html + escape: "'" + escape_captures: + 0: string.quoted.single punctuation.definition.string.end.html + - include: else-pop + + # This is to prevent breaking syntaxes referencing the old context name + tag-stuff: + - include: tag-attributes + + tag-attributes: + - include: tag-id-attribute + - include: tag-class-attribute + - include: tag-style-attribute + - include: tag-event-attribute + - include: tag-generic-attribute + diff --git a/assets/syntaxes/HTML (Twig).sublime-syntax b/assets/syntaxes/HTML (Twig).sublime-syntax new file mode 100644 index 0000000..fcedca3 --- /dev/null +++ b/assets/syntaxes/HTML (Twig).sublime-syntax @@ -0,0 +1,662 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: HTML (Twig) +file_extensions: + - twig + - html.twig +scope: text.html.twig +contexts: + main: + - match: '(<)([a-zA-Z0-9:]++)(?=[^>]*>)' + captures: + 1: punctuation.definition.tag.html + 2: entity.name.tag.html + push: + - meta_scope: meta.tag.any.html + - match: (>(<)/)(\2)(>) + captures: + 1: punctuation.definition.tag.html + 2: meta.scope.between-tag-pair.html + 3: entity.name.tag.html + 4: punctuation.definition.tag.html + pop: true + - include: tag-stuff + - match: (<\?)(xml) + captures: + 1: punctuation.definition.tag.html + 2: entity.name.tag.xml.html + push: + - meta_scope: meta.tag.preprocessor.xml.html + - match: (\?>) + captures: + 1: punctuation.definition.tag.html + 2: entity.name.tag.xml.html + pop: true + - include: tag-generic-attribute + - include: string-double-quoted + - include: string-single-quoted + - match: ) + scope: comment.block.html.js + captures: + 0: punctuation.definition.comment.js + - match: (//).*$\n? + scope: comment.line.double-slash.js + captures: + 1: punctuation.definition.comment.js + - match: ^(#!).*$\n? + scope: comment.line.shebang.js + captures: + 1: punctuation.definition.comment.js + core: + - include: literal-function-labels + - include: literal-arrow-function-labels + - include: literal-labels + - include: literal-for + - include: literal-switch + - include: styled-components + - include: graphql + - include: expression + - include: literal-punctuation + curly-brackets: + - match: "{" + captures: + 0: meta.brace.curly.begin.js + push: + - meta_scope: meta.group.braces.curly.js + - match: "}" + captures: + 0: meta.brace.curly.end.js + pop: true + - include: main + es7-decorators: + - match: |- + (?x) + (@)([_$a-zA-Z][$\w]*)\b + scope: tag.decorator.js + captures: + 1: punctuation.definition.tag.js + 2: entity.name.tag.js + expression: + - include: merge-conflits + - include: literal-regexp + - include: literal-jsx + - include: es7-decorators + - include: support-class + - include: support-other + - include: literal-function + - include: literal-arrow-function + - include: literal-prototype + - include: literal-keywords + - include: literal-method + - include: literal-module + - include: literal-class + - include: flowtype-declaration + - include: literal-number + - include: literal-template-string + - include: literal-string + - include: literal-language-constant + - include: literal-language-variable + - include: literal-constructor + - include: literal-method-call + - include: literal-function-call + - include: comments + - include: brackets + - include: literal-operators + - include: literal-variable + flowtype-annotation: + - match: (?:(\?)\s*)?(:) + captures: + 1: keyword.operator.flowtype.optional.js + 2: keyword.operator.flowtype.annotation.js + push: + - meta_scope: meta.flowtype.annotation.js + - include: flowtype-tokens + - match: (?=\S) + pop: true + flowtype-brackets: + - match: "{" + captures: + 0: punctuation.section.flowtype.begin.js + push: + - match: "}" + captures: + 0: punctuation.section.flowtype.end.js + pop: true + - include: flowtype-tokens + flowtype-declaration: + - match: (?" + captures: + 0: punctuation.section.flowtype.end.js + pop: true + - include: flowtype-tokens + flowtype-tokens: + - match: '(?<=[:?|&=])(?=\s*{)' + push: + - match: "(?<=})" + pop: true + - include: flowtype-brackets + - match: '\s*([|&])\s*' + scope: meta.flowtype.set.js + captures: + 1: keyword.operator.flowtype.other.js + - match: '[*:?&|.]|\.\.\.|\b(typeof)\b' + scope: keyword.operator.flowtype.other.js + - match: < + captures: + 0: punctuation.section.flowtype.begin.js + push: + - match: ">" + captures: + 0: punctuation.section.flowtype.end.js + pop: true + - include: flowtype-tokens + - match: '\[' + captures: + 0: punctuation.section.flowtype.begin.js + push: + - match: '\]' + captures: + 0: punctuation.section.flowtype.end.js + pop: true + - include: flowtype-tokens + - match: \( + captures: + 0: punctuation.section.flowtype.begin.js + push: + - match: \) + captures: + 0: punctuation.section.flowtype.end.js + pop: true + - include: flowtype-tokens + - match: "=>" + captures: + 0: keyword.operator.flowtype.js + push: + - meta_scope: meta.flowtype.function.js + - match: "(?<=}|[_$a-zA-Z])" + pop: true + - include: flowtype-brackets + - include: flowtype-identifier + - include: comments + - include: flowtype-identifier + - include: literal-string + - include: comments + function-declaration-parameters: + - match: \( + captures: + 0: punctuation.definition.parameters.begin.js + push: + - match: \) + captures: + 0: punctuation.definition.parameters.end.js + pop: true + - include: comments + - include: flowtype-annotation + - match: (?" + captures: + 0: meta.tag.jsx punctuation.definition.tag.end.jsx + push: + - match: (?=)|(/>) + captures: + 1: meta.tag.jsx punctuation.definition.tag.begin.jsx + 2: meta.tag.jsx entity.name.tag.jsx + 3: meta.tag.jsx punctuation.definition.tag.end.jsx + 4: meta.tag.jsx punctuation.definition.tag.end.jsx + pop: true + - include: jsx-tag-end + - include: jsx-attributes + - match: < + scope: invalid.illegal.tag.incomplete.jsx + literal-arrow-function: + - match: |- + (?x) + (?:([_$a-zA-Z][$\w]*)\s*(=)\s*)? + (?:\b(async)\s+)? + (?=(\((?>(?>[^()]+)|\g<-1>)*\))\s*(=>)) + captures: + 1: entity.name.function.js + 2: keyword.operator.assignment.js + 3: storage.type.js + push: + - meta_scope: meta.function.arrow.js + - match: (?<=\))\s*(=>) + captures: + 1: storage.type.function.arrow.js + pop: true + - include: function-declaration-parameters + - match: |- + (?x) + (?:([_$a-zA-Z][$\w]*)\s*(=)\s*)? + (?:(async)\s+)? + \b([_$a-zA-Z][$\w]*)\s*(=>) + scope: meta.function.arrow.js + captures: + 1: entity.name.function.js + 2: keyword.operator.assignment.js + 3: storage.type.js + 4: variable.parameter.function.js + 5: storage.type.function.arrow.js + - match: |- + (?x) + (\b_?[A-Z][$\w]*)? + (\.)(prototype) + (\.)([_$a-zA-Z][$\w]*) + \s*(=) + \s*(async)? + \s*(?=(\((?>(?>[^()]+)|\g<-1>)*\))\s*(=>)) + captures: + 1: entity.name.class.js + 2: keyword.operator.accessor.js + 3: variable.language.prototype.js + 4: keyword.operator.accessor.js + 5: entity.name.function.js + 6: keyword.operator.assignment.js + 7: storage.type.js + push: + - meta_scope: meta.prototype.function.arrow.js + - match: (?<=\))\s*(=>) + captures: + 1: storage.type.function.arrow.js + pop: true + - include: function-declaration-parameters + - match: |- + (?x) + (\b_?[A-Z][$\w]*)? + (\.)(prototype) + (\.)([_$a-zA-Z][$\w]*) + \s*(=) + \s*(async)? + \s*\b([_$a-zA-Z][$\w]*)\s*(=>) + scope: meta.prototype.function.arrow.js + captures: + 1: entity.name.class.js + 2: keyword.operator.accessor.js + 3: variable.language.prototype.js + 4: keyword.operator.accessor.js + 5: entity.name.function.js + 6: keyword.operator.assignment.js + 7: storage.type.js + 8: variable.parameter.function.js + 9: storage.type.function.arrow.js + - match: |- + (?x) + (\b_?[A-Z][$\w]*)? + (\.)([_$a-zA-Z][$\w]*) + \s*(=) + \s*(async)? + \s*(?=(\((?>(?>[^()]+)|\g<-1>)*\))\s*(=>)) + captures: + 1: entity.name.class.js + 2: keyword.operator.accessor.js + 3: entity.name.function.js + 4: keyword.operator.assignment.js + 5: storage.type.js + push: + - meta_scope: meta.function.static.arrow.js + - match: (?<=\))\s*(=>) + captures: + 1: storage.type.function.arrow.js + pop: true + - include: function-declaration-parameters + - match: |- + (?x) + (\b_?[A-Z][$\w]*)? + (\.)([_$a-zA-Z][$\w]*) + \s*(=) + \s*(async)? + \s*\b([_$a-zA-Z][$\w]*)\s*(=>) + scope: meta.function.static.arrow.js + captures: + 1: entity.name.class.js + 2: keyword.operator.accessor.js + 3: entity.name.function.js + 4: keyword.operator.assignment.js + 5: storage.type.js + 6: variable.parameter.function.js + 7: storage.type.function.arrow.js + literal-arrow-function-labels: + - match: |- + (?x) + (?> + ((')((?>[^'\\]|\\.)*)('))| + ((")((?>[^"\\]|\\.)*)("))| + (([_$a-zA-Z][$\w]*|\d+)) + ) + \s*(:) + \s*(?:\b(async)\s+)? + \s*(?=(\((?>(?>[^()]+)|\g<-1>)*\))\s*(=>)) + captures: + 1: string.quoted.js + 2: punctuation.definition.string.begin.js + 3: entity.name.function.js + 4: punctuation.definition.string.end.js + 5: string.quoted.js + 6: punctuation.definition.string.begin.js + 7: entity.name.function.js + 8: punctuation.definition.string.end.js + 9: string.unquoted.js + 10: entity.name.function.js + 11: punctuation.separator.key-value.js + 12: storage.type.js + push: + - meta_scope: meta.function.json.arrow.js + - match: (?<=\))\s*(=>) + captures: + 1: storage.type.function.arrow.js + pop: true + - include: function-declaration-parameters + - match: |- + (?x) + (?> + ((')((?>[^'\\]|\\.)*)('))| + ((")((?>[^"\\]|\\.)*)("))| + (([_$a-zA-Z][$\w]*|\d+)) + ) + \s*(:) + \s*(?:\b(async)\s+)? + \s*\b([_$a-zA-Z][$\w]*)\s*(=>) + scope: meta.function.json.arrow.js + captures: + 1: string.quoted.js + 2: punctuation.definition.string.begin.js + 3: entity.name.function.js + 4: punctuation.definition.string.end.js + 5: string.quoted.js + 6: punctuation.definition.string.begin.js + 7: entity.name.function.js + 8: punctuation.definition.string.end.js + 9: string.unquoted.js + 10: entity.name.function.js + 11: punctuation.separator.key-value.js + 12: storage.type.js + 13: variable.parameter.function.js + 14: storage.type.function.arrow.js + literal-class: + - match: (?\s*(\*)|(?=[\s(<])) + \s*([_$a-zA-Z][$\w]*)? + captures: + 1: entity.name.function.js + 2: keyword.operator.assignment.js + 3: storage.type.js + 4: storage.type.function.js + 5: keyword.generator.asterisk.js + 6: entity.name.function.js + push: + - meta_scope: meta.function.js + - match: (?<=\)) + pop: true + - include: flowtype-polymorph + - include: function-declaration-parameters + - match: |- + (?x) + (\b_?[A-Z][$\w]*)? + (\.)(prototype) + (\.)([_$a-zA-Z][$\w]*) + \s*(=) + \s*(?:(async)\s+)? + \s*(function)(?>\s*(\*)|(?=[\s(<])) + \s*([_$a-zA-Z][$\w]*)?\s* + captures: + 1: entity.name.class.js + 2: keyword.operator.accessor.js + 3: variable.language.prototype.js + 4: keyword.operator.accessor.js + 5: entity.name.function.js + 6: keyword.operator.assignment.js + 7: storage.type.js + 8: storage.type.function.js + 9: keyword.generator.asterisk.js + 10: entity.name.function.js + push: + - meta_scope: meta.function.prototype.js + - match: (?<=\)) + pop: true + - include: flowtype-polymorph + - include: function-declaration-parameters + - match: |- + (?x) + (\b_?[A-Z][$\w]*)? + (\.)([_$a-zA-Z][$\w]*) + \s*(=) + \s*(?:(async)\s+)? + \s*(function)(?>\s*(\*)|(?=[\s(<])) + \s*([_$a-zA-Z][$\w]*)?\s* + captures: + 1: entity.name.class.js + 2: keyword.operator.accessor.js + 3: entity.name.function.js + 4: keyword.operator.assignment.js + 5: storage.type.js + 6: storage.type.function.js + 7: keyword.generator.asterisk.js + 8: entity.name.function.js + push: + - meta_scope: meta.function.static.js + - match: (?<=\)) + pop: true + - include: flowtype-polymorph + - include: function-declaration-parameters + literal-function-call: + - match: '([_$a-zA-Z][$\w]*)\s*(\(\s*\))' + scope: meta.function-call.without-arguments.js + captures: + 1: variable.function.js + 2: meta.group.braces.round.function.arguments.js + - match: '([_$a-zA-Z][$\w]*)\s*(?=\()' + scope: meta.function-call.with-arguments.js + captures: + 1: variable.function.js + - match: '([_$a-zA-Z][$\w]*)\s*(?=`)' + scope: meta.function-call.tagged-template.js + captures: + 1: variable.function.js + literal-function-labels: + - match: |- + (?x) + (?> + ((')((?>[^'\\]|\\.)*)('))| + ((")((?>[^"\\]|\\.)*)("))| + (([_$a-zA-Z][$\w]*|\d+)) + ) + \s*(:) + \s*(?:\b(async)\s+)? + \s*(function)(?>\s*(\*)|(?=[\s(<])) + \s*([_$a-zA-Z][$\w]*)? + captures: + 1: string.quoted.js + 2: punctuation.definition.string.begin.js + 3: entity.name.function.js + 4: punctuation.definition.string.end.js + 5: string.quoted.js + 6: punctuation.definition.string.begin.js + 7: entity.name.function.js + 8: punctuation.definition.string.end.js + 9: string.unquoted.js + 10: entity.name.function.js + 11: punctuation.separator.key-value.js + 12: storage.type.js + 13: storage.type.function.js + 14: keyword.generator.asterisk.js + 15: entity.name.function.js + push: + - meta_scope: meta.function.json.js + - match: (?<=\)) + pop: true + - include: flowtype-polymorph + - include: function-declaration-parameters + literal-jsx: + - match: '(?<=\(|\{|\[|,|&&|\|\||\?|:|=|=>|\Wreturn|^return|\Wdefault|^)(?=\s*<[_$a-zA-Z])' + push: + - meta_content_scope: meta.jsx.js + - match: (?<=/>|>) + pop: true + - include: jsx-tag-start + literal-keyword-storage: + - match: (?const|let|var)\b + scope: storage.type.js + literal-keywords: + - include: literal-keyword-storage + - match: (?await|yield))\b(?:\s*(\*))? + captures: + 1: keyword.control.flow.js + 2: keyword.generator.asterisk.js + - match: (?if|else)\b + scope: keyword.control.conditional.js + - match: (?catch|finally|throw|try)\b + scope: keyword.control.trycatch.js + - match: (?break|continue|do|goto|while|case|default)\b + scope: keyword.control.loop.js + - match: (?enum|module|public|package|private|interface|protected)\b + scope: keyword.other.reserved.js + - match: (? + ((')((?>[^'\\]|\\.)*)('))| + ((")((?>[^"\\]|\\.)*)("))| + )\s*:) + push: + - match: ":" + captures: + 0: punctuation.separator.key-value.js + pop: true + - include: literal-string + - match: '(? + ((')((?>[^'\\]|\\.)*)('))| + ((")((?>[^"\\]|\\.)*)("))| + (([_$a-zA-Z][$\w]*|\d+)) + ) + (?=\s*(\((?>(?>[^()]+)|\g<-1>)*\))(?>\s|/\*.*\*/)*\{) + captures: + 1: storage.type.js + 2: storage.type.js + 3: keyword.generator.asterisk.js + 4: string.quoted.js + 5: punctuation.definition.string.begin.js + 6: entity.name.function.js + 7: punctuation.definition.string.end.js + 8: string.quoted.js + 9: punctuation.definition.string.begin.js + 10: entity.name.function.js + 11: punctuation.definition.string.end.js + 12: string.unquoted.js + 13: entity.name.function.js + push: + - meta_scope: meta.method.js + - match: (?<=\)) + pop: true + - include: function-declaration-parameters + - match: |- + (?x) + \b(?:(static)\s+)? + (get|set)\s+ + ([_$a-zA-Z][$\w]*|\d+)\s* + (?=(\((?>(?>[^()]+)|\g<-1>)*\))(?>\s|/\*.*\*/)*\{) + captures: + 1: storage.type.js + 2: storage.type.accessor.js + 3: entity.name.accessor.js + push: + - meta_scope: meta.accessor.js + - match: (?<=\)) + pop: true + - include: function-declaration-parameters + literal-method-call: + - match: |- + (?x) + (?:(?<=\.)|\b) + ([A-Z][$\w]*)\s*(\.) + ([_$a-zA-Z][$\w]*)\s* + (\(\s*\)) + scope: meta.function-call.static.without-arguments.js + captures: + 1: variable.other.class.js + 2: keyword.operator.accessor.js + 3: variable.function.js + 4: meta.group.braces.round.function.arguments.js + - match: |- + (?x) + (?:(?<=\.)|\b) + ([A-Z][$\w]*)\s*(\.) + ([_$a-zA-Z][$\w]*)\s* + (?=\() + scope: meta.function-call.static.with-arguments.js + captures: + 1: variable.other.class.js + 2: keyword.operator.accessor.js + 3: variable.function.js + - match: |- + (?x) + (?<=\.) + ([_$a-zA-Z][$\w]*)\s* + (\(\s*\)) + scope: meta.function-call.method.without-arguments.js + captures: + 1: variable.function.js + 2: meta.group.braces.round.function.arguments.js + - match: |- + (?x) + (?<=\.) + ([_$a-zA-Z][$\w]*)\s* + (?=\() + scope: meta.function-call.method.with-arguments.js + captures: + 1: variable.function.js + literal-module: + - match: (?import|export|default|from|as)\b + scope: keyword.operator.module.js + literal-number: + - match: '(?i)(?:\B[-+]|\b)0x[0-9a-f]*\.(\B|\b[0-9]+)' + scope: invalid.illegal.numeric.hex.js + - match: '(?:\B[-+]|\b)0[0-9]+\.(\B|\b[0-9]+)' + scope: invalid.illegal.numeric.octal.js + - match: |- + (?xi) + (?:\B[-+])? + (?: + \b0b[0-1]*| # binary + \b0o[0-7]*| # octal + \b0x[0-9a-f]*| # hex + ( + \B\.[0-9]+| # e.g. .999 + \b[0-9]+(\.[0-9]*)? # e.g. 999.999, 999. or 999 + )(e[-+]?[0-9]+)? # e.g. e+123, E-123 + ) + scope: constant.numeric.js + - match: '(?:\B[-+]|\b)(Infinity)\b' + scope: constant.language.infinity.js + literal-operators: + - match: (?delete|instanceof|in|new|of|typeof|void|with)\b + scope: keyword.operator.js + - match: |- + (?x) + !(?!=)| # logical-not right-to-left right + && | # logical-and left-to-right both + \|\| # logical-or left-to-right both + scope: keyword.operator.logical.js + - match: |- + (?x) + =(?!=) # assignment right-to-left both + scope: keyword.operator.assignment.js + - match: |- + (?x) + %= | # assignment right-to-left both + &= | # assignment right-to-left both + \*= | # assignment right-to-left both + \+= | # assignment right-to-left both + -= | # assignment right-to-left both + /= | # assignment right-to-left both + \^= | # assignment right-to-left both + \|= | # assignment right-to-left both + <<= | # assignment right-to-left both + >>= | # assignment right-to-left both + >>>= # assignment right-to-left both + scope: keyword.operator.assignment.augmented.js + - match: |- + (?x) + ~ | # bitwise-not right-to-left right + << | # bitwise-shift left-to-right both + >>> | # bitwise-shift left-to-right both + >> | # bitwise-shift left-to-right both + & | # bitwise-and left-to-right both + \^ | # bitwise-xor left-to-right both + \| # bitwise-or left-to-right both + scope: keyword.operator.bitwise.js + - match: |- + (?x) + <= | # relational left-to-right both + >= | # relational left-to-right both + < | # relational left-to-right both + > # relational left-to-right both + scope: keyword.operator.relational.js + - match: |- + (?x) + === | # equality left-to-right both + !== | # equality left-to-right both + == | # equality left-to-right both + != # equality left-to-right both + scope: keyword.operator.comparison.js + - match: |- + (?x) + -- | # decrement n/a right-or-left + \+\+ | # increment n/a right-or-left + / | # division left-to-right both + % | # modulus left-to-right both + \* | # multiplication left-to-right both + \+ | # addition left-to-right both + - # subtraction left-to-right both + scope: keyword.operator.arithmetic.js + - match: "[?:]" + scope: keyword.operator.ternary.js + - match: (?|<=|>=|==|!=|===|!==|\+|-|\*|%|\+\+|--|<<|>>|>>>|&|\||\^|!|~|&&|\|\||\?|:|=|\+=|-=|\*=|%=|<<=|>>=|>>>=|&=|\|=|\^=|/|/=| + \Wnew|\Wdelete|\Wvoid|\Wtypeof|\Winstanceof|\Win|\Wdo|\Wreturn|\Wcase|\Wthrow|\Wyield| + ^new|^delete|^void|^typeof|^instanceof|^in|^do|^return|^case|^throw|^yield|^ + )\s* + (/) + (?!/|\*|$) + captures: + 1: punctuation.definition.string.begin.js + push: + - meta_scope: string.regexp.js + - match: "(/)([gimy]*)" + captures: + 1: punctuation.definition.string.end.js + 2: keyword.other.js + pop: true + - include: scope:source.regexp.js + literal-string: + - match: '(["''])' + captures: + 0: punctuation.definition.string.begin.js + push: + - meta_scope: string.quoted.js + - match: (\1)|(\n) + captures: + 1: punctuation.definition.string.end.js + 2: invalid.illegal.newline.js + pop: true + - include: string-content + literal-switch: + - match: (?]{7})\s(.+)$' + captures: + 1: invalid.illegal.conflict-marker.other-commit.js + 2: invalid.illegal.string.js + round-brackets: + - match: \( + captures: + 0: meta.brace.round.begin.js + push: + - meta_scope: meta.group.braces.round.js + - match: \) + captures: + 0: meta.brace.round.end.js + pop: true + - include: expression + square-brackets: + - match: '\[' + captures: + 0: meta.brace.square.begin.js + push: + - meta_scope: meta.group.braces.square.js + - match: '\]' + captures: + 0: meta.brace.square.end.js + pop: true + - include: expression + string-content: + - match: \\\s*\n + scope: constant.character.escape.newline.js + - match: '\\([1-7][0-7]{0,2}|[0-7]{2,3}|[bfnrtv0''"\\]|x\h{2}|u\{\h+\}|u\h{4})' + scope: constant.character.escape.js + styled-components: + - match: (?(?>[^()]+)|\g<-1>)*\))\s*`)' + captures: + 1: meta.function-call.with-arguments.js variable.function.js + push: + - meta_scope: meta.styled-components.js + - match: (?<=`) + captures: + 1: meta.function-call.with-arguments.js variable.function.js + pop: true + - match: \( + captures: + 0: punctuation.definition.group.begin.js + push: + - meta_scope: meta.function-call.with-arguments.js meta.group.js + - match: \) + captures: + 0: punctuation.definition.group.end.js + pop: true + - include: expression + - match: "`" + captures: + 0: punctuation.definition.string.template.begin.js + push: + - meta_content_scope: source.css.embedded.js + - match: "`" + captures: + 0: punctuation.definition.string.template.end.js + pop: true + - include: scope:source.js.css + support-class: + - match: (?Eval|Range|Reference|Syntax|Type|URI)?Error)\b + scope: support.class.error.js + - match: \b(?>Buffer)\b + scope: support.class.node.js + support-other: + - match: (?document|window)\b + scope: support.type.object.dom.js + - match: (?global|GLOBAL|root|__dirname|__filename)\b + scope: support.type.object.node.js + - match: (?~?&$%|]' + + # The list of unicode symbols allowed as operators is fetched from the Julia parser https://github.com/JuliaLang/julia/blob/master/src/julia-parser.scm + symb_op_unicode: '[≤≥¬←→↔↚↛↠↣↦↮⇎⇏⇒⇔⇴⇶⇷⇸⇹⇺⇻⇼⇽⇾⇿⟵⟶⟷⟷⟹⟺⟻⟼⟽⟾⟿⤀⤁⤂⤃⤄⤅⤆⤇⤌⤍⤎⤏⤐⤑⤔⤕⤖⤗⤘⤝⤞⤟⤠⥄⥅⥆⥇⥈⥊⥋⥎⥐⥒⥓⥖⥗⥚⥛⥞⥟⥢⥤⥦⥧⥨⥩⥪⥫⥬⥭⥰⧴⬱⬰⬲⬳⬴⬵⬶⬷⬸⬹⬺⬻⬼⬽⬾⬿⭀⭁⭂⭃⭄⭇⭈⭉⭊⭋⭌←→≡≠≢∈∉∋∌⊆⊈⊂⊄⊊∝∊∍∥∦∷∺∻∽∾≁≃≄≅≆≇≈≉≊≋≌≍≎≐≑≒≓≔≕≖≗≘≙≚≛≜≝≞≟≣≦≧≨≩≪≫≬≭≮≯≰≱≲≳≴≵≶≷≸≹≺≻≼≽≾≿⊀⊁⊃⊅⊇⊉⊋⊏⊐⊑⊒⊜⊩⊬⊮⊰⊱⊲⊳⊴⊵⊶⊷⋍⋐⋑⋕⋖⋗⋘⋙⋚⋛⋜⋝⋞⋟⋠⋡⋢⋣⋤⋥⋦⋧⋨⋩⋪⋫⋬⋭⋲⋳⋴⋵⋶⋷⋸⋹⋺⋻⋼⋽⋾⋿⟈⟉⟒⦷⧀⧁⧡⧣⧤⧥⩦⩧⩪⩫⩬⩭⩮⩯⩰⩱⩲⩳⩴⩵⩶⩷⩸⩹⩺⩻⩼⩽⩾⩿⪀⪁⪂⪃⪄⪅⪆⪇⪈⪉⪊⪋⪌⪍⪎⪏⪐⪑⪒⪓⪔⪕⪖⪗⪘⪙⪚⪛⪜⪝⪞⪟⪠⪡⪢⪣⪤⪥⪦⪧⪨⪩⪪⪫⪬⪭⪮⪯⪰⪱⪲⪳⪴⪵⪶⪷⪸⪹⪺⪻⪼⪽⪾⪿⫀⫁⫂⫃⫄⫅⫆⫇⫈⫉⫊⫋⫌⫍⫎⫏⫐⫑⫒⫓⫔⫕⫖⫗⫘⫙⫷⫸⫹⫺⊢⊣⊕⊖⊞⊟∪∨⊔±∓∔∸≂≏⊎⊻⊽⋎⋓⧺⧻⨈⨢⨣⨤⨥⨦⨧⨨⨩⨪⨫⨬⨭⨮⨹⨺⩁⩂⩅⩊⩌⩏⩐⩒⩔⩖⩗⩛⩝⩡⩢⩣÷⋅∘×∩∧⊗⊘⊙⊚⊛⊠⊡⊓∗∙∤⅋≀⊼⋄⋆⋇⋉⋊⋋⋌⋏⋒⟑⦸⦼⦾⦿⧶⧷⨇⨰⨱⨲⨳⨴⨵⨶⨷⨸⨻⨼⨽⩀⩃⩄⩋⩍⩎⩑⩓⩕⩘⩚⩜⩞⩟⩠⫛⊍▷⨝⟕⟖⟗↑↓⇵⟰⟱⤈⤉⤊⤋⤒⤓⥉⥌⥍⥏⥑⥔⥕⥘⥙⥜⥝⥠⥡⥣⥥⥮⥯↑↓]' + symb_op: '(?:{{symb_op_ascii}}|{{symb_op_unicode}})' + + # Multi-character operators + long_op: (?:\+=|-=|\*=|/=|//=|\\\\=|^=|÷=|%=|<<=|>>=|>>>=|\|=|&=|:=|=>|$=|\|\||&&|<:|>:|\|>|<\||//|\+\+|<=|>=|->|===|==|!==|!=) + + # julia> using Unicode + # julia> join(sort(unique((filter(x -> isalpha(x[1]), string.(filter!(x -> isa(eval(x), DataType) || isa(eval(x), UnionAll), filter!(x -> !Base.isdeprecated(Base, x), [names(Base); names(Core)]))))))), "|") + # Compare with https://github.com/JuliaLang/julia/blob/master/base/exports.jl + base_types: \b(?:AbstractArray|AbstractChannel|AbstractDict|AbstractDisplay|AbstractFloat|AbstractIrrational|AbstractMatrix|AbstractRNG|AbstractRange|AbstractSerializer|AbstractSet|AbstractSparseArray|AbstractSparseMatrix|AbstractSparseVector|AbstractString|AbstractUnitRange|AbstractVecOrMat|AbstractVector|Adjoint|Any|ArgumentError|Array|AssertionError|Bidiagonal|BigFloat|BigInt|BitArray|BitMatrix|BitSet|BitVector|Bool|BoundsError|BufferStream|CapturedException|CartesianIndex|CartesianIndices|Cchar|Cdouble|Cfloat|Channel|Char|Cint|Cintmax_t|Clong|Clonglong|Cmd|CodeInfo|Colon|Complex|ComplexF16|ComplexF32|ComplexF64|CompositeException|Condition|ConjArray|ConjMatrix|ConjVector|Cptrdiff_t|Cshort|Csize_t|Cssize_t|Cstring|Cuchar|Cuint|Cuintmax_t|Culong|Culonglong|Cushort|Cvoid|Cwchar_t|Cwstring|DataType|DenseArray|DenseMatrix|DenseVecOrMat|DenseVector|Diagonal|Dict|DimensionMismatch|Dims|DivideError|DomainError|EOFError|EachLine|Enum|Enumerate|ErrorException|Exception|ExponentialBackOff|Expr|Factorization|Float16|Float32|Float64|Function|GlobalRef|GotoNode|HTML|Hermitian|IO|IOBuffer|IOContext|IOStream|IPAddr|IPv4|IPv6|IndexCartesian|IndexLinear|IndexStyle|InexactError|InitError|Int|Int128|Int16|Int32|Int64|Int8|Integer|InterruptException|InvalidStateException|Irrational|KeyError|LabelNode|LinSpace|LineNumberNode|LinearIndices|LoadError|LowerTriangular|MIME|Matrix|MersenneTwister|Method|MethodError|MethodTable|Missing|MissingException|Module|NTuple|NamedTuple|NewvarNode|Nothing|Number|ObjectIdDict|OrdinalRange|OutOfMemoryError|OverflowError|Pair|PartialQuickSort|PermutedDimsArray|Pipe|Ptr|QuoteNode|RandomDevice|Rational|RawFD|ReadOnlyMemoryError|Real|ReentrantLock|Ref|Regex|RegexMatch|RoundingMode|RowVector|SSAValue|SegmentationFault|SerializationState|Set|Signed|SimpleVector|Slot|SlotNumber|Some|SparseMatrixCSC|SparseVector|StackFrame|StackOverflowError|StackTrace|StepRange|StepRangeLen|StridedArray|StridedMatrix|StridedVecOrMat|StridedVector|String|StringIndexError|SubArray|SubString|SymTridiagonal|Symbol|Symmetric|SystemError|TCPSocket|Task|Text|TextDisplay|Timer|Transpose|Tridiagonal|Tuple|Type|TypeError|TypeMapEntry|TypeMapLevel|TypeName|TypeVar|TypedSlot|UDPSocket|UInt|UInt128|UInt16|UInt32|UInt64|UInt8|UndefRefError|UndefVarError|UniformScaling|Uninitialized|Union|UnionAll|UnitRange|Unsigned|UpperTriangular|Val|Vararg|VecElement|VecOrMat|Vector|VersionNumber|WeakKeyDict|WeakRef|equalto)\b + + # julia> using Unicode + # julia> join(filter!(x -> isascii(x[1]) && isalpha(x[1]) && islower(x[1]), map(string, filter!(x -> !Base.isdeprecated(Base, x), [names(Base); names(Core)]))), '|') + base_funcs: (?:abs|abs2|abspath|accept|accumulate|accumulate!|acos|acos_fast|acosd|acosh|acosh_fast|acot|acotd|acoth|acsc|acscd|acsch|adjoint|adjoint!|all|all!|allunique|angle|angle_fast|any|any!|append!|apropos|ascii|asec|asecd|asech|asin|asin_fast|asind|asinh|asinh_fast|assert|asyncmap|asyncmap!|atan|atan2|atan2_fast|atan_fast|atand|atanh|atanh_fast|atexit|atreplinit|axes|backtrace|base|basename|beta|big|bin|bind|binomial|bitbroadcast|bitrand|bits|bitstring|bkfact|bkfact!|blkdiag|broadcast|broadcast!|broadcast_getindex|broadcast_setindex!|bswap|bytes2hex|cat|catch_backtrace|catch_stacktrace|cbrt|cbrt_fast|cd|ceil|cfunction|cglobal|charwidth|checkbounds|checkindex|chmod|chol|cholfact|cholfact!|chomp|chop|chown|chr2ind|circcopy!|circshift|circshift!|cis|cis_fast|clamp|clamp!|cld|clipboard|close|cmp|coalesce|code_llvm|code_lowered|code_native|code_typed|code_warntype|codeunit|codeunits|collect|colon|complex|cond|condskeel|conj|conj!|connect|consume|contains|convert|copy|copy!|copysign|copyto!|cor|cos|cos_fast|cosc|cosd|cosh|cosh_fast|cospi|cot|cotd|coth|count|count_ones|count_zeros|countlines|countnz|cov|cp|cross|csc|cscd|csch|ctime|ctranspose|ctranspose!|cummax|cummin|cumprod|cumprod!|cumsum|cumsum!|current_module|current_task|dec|deepcopy|deg2rad|delete!|deleteat!|den|denominator|deserialize|det|detach|diag|diagind|diagm|diff|digits|digits!|dirname|disable_sigint|display|displayable|displaysize|div|divrem|done|dot|download|dropzeros|dropzeros!|dump|eachindex|eachline|eachmatch|edit|eig|eigfact|eigfact!|eigmax|eigmin|eigvals|eigvals!|eigvecs|eltype|empty|empty!|endof|endswith|enumerate|eof|eps|equalto|error|esc|escape_string|evalfile|exit|exp|exp10|exp10_fast|exp2|exp2_fast|exp_fast|expand|expanduser|expm|expm!|expm1|expm1_fast|exponent|extrema|eye|factorial|factorize|falses|fd|fdio|fetch|fieldcount|fieldname|fieldnames|fieldoffset|filemode|filesize|fill|fill!|filter|filter!|finalize|finalizer|find|findfirst|findin|findlast|findmax|findmax!|findmin|findmin!|findn|findnext|findnz|findprev|first|fld|fld1|fldmod|fldmod1|flipbits!|flipdim|flipsign|float|floor|flush|fma|foldl|foldr|foreach|frexp|full|fullname|functionloc|gamma|gc|gc_enable|gcd|gcdx|gensym|get|get!|get_zero_subnormals|getaddrinfo|getalladdrinfo|gethostname|getindex|getipaddr|getkey|getnameinfo|getpeername|getpid|getsockname|givens|gperm|gradient|hash|haskey|hcat|hessfact|hessfact!|hex|hex2bytes|hex2bytes!|hex2num|homedir|htol|hton|hvcat|hypot|hypot_fast|identity|ifelse|ignorestatus|im|imag|in|include_dependency|include_string|ind2chr|ind2sub|indexin|indices|indmax|indmin|info|insert!|instances|intersect|intersect!|inv|invmod|invperm|invpermute!|ipermute!|ipermutedims|is|is_apple|is_bsd|is_linux|is_unix|is_windows|isabspath|isapprox|isascii|isassigned|isbits|isblockdev|ischardev|isconcrete|isconst|isdiag|isdir|isdirpath|isempty|isequal|iseven|isfifo|isfile|isfinite|ishermitian|isimag|isimmutable|isinf|isinteger|isinteractive|isleaftype|isless|islink|islocked|ismarked|ismatch|ismissing|ismount|isnan|isodd|isone|isopen|ispath|isperm|isposdef|isposdef!|ispow2|isqrt|isreadable|isreadonly|isready|isreal|issetgid|issetuid|issocket|issorted|issparse|issticky|issubnormal|issubset|issubtype|issymmetric|istaskdone|istaskstarted|istextmime|istril|istriu|isvalid|iswritable|iszero|join|joinpath|keys|keytype|kill|kron|last|lbeta|lcm|ldexp|ldltfact|ldltfact!|leading_ones|leading_zeros|length|less|lexcmp|lexless|lfact|lgamma|lgamma_fast|linearindices|linreg|linspace|listen|listenany|lock|log|log10|log10_fast|log1p|log1p_fast|log2|log2_fast|log_fast|logabsdet|logdet|logging|logm|logspace|lpad|lq|lqfact|lqfact!|lstat|lstrip|ltoh|lu|lufact|lufact!|lyap|macroexpand|map|map!|mapfoldl|mapfoldr|mapreduce|mapreducedim|mapslices|mark|match|matchall|max|max_fast|maxabs|maximum|maximum!|maxintfloat|mean|mean!|median|median!|merge|merge!|method_exists|methods|methodswith|middle|midpoints|mimewritable|min|min_fast|minabs|minimum|minimum!|minmax|minmax_fast|missing|mkdir|mkpath|mktemp|mktempdir|mod|mod1|mod2pi|modf|module_name|module_parent|mtime|muladd|mv|names|nb_available|ncodeunits|ndigits|ndims|next|nextfloat|nextind|nextpow|nextpow2|nextprod|nnz|nonzeros|norm|normalize|normalize!|normpath|notify|ntoh|ntuple|nullspace|num|num2hex|numerator|nzrange|object_id|oct|oftype|one|ones|oneunit|open|operm|ordschur|ordschur!|pairs|parent|parentindexes|parentindices|parse|partialsort|partialsort!|partialsortperm|partialsortperm!|peakflops|permute|permute!|permutedims|permutedims!|pi|pinv|pipeline|pointer|pointer_from_objref|pop!|popdisplay|popfirst!|position|pow_fast|powermod|precision|precompile|prepend!|prevfloat|prevind|prevpow|prevpow2|print|print_shortest|print_with_color|println|process_exited|process_running|prod|prod!|produce|promote|promote_rule|promote_shape|promote_type|push!|pushdisplay|pushfirst!|put!|pwd|qr|qrfact|qrfact!|quantile|quantile!|quit|rad2deg|rand|rand!|randcycle|randcycle!|randexp|randexp!|randjump|randn|randn!|randperm|randperm!|randstring|randsubseq|randsubseq!|range|rank|rationalize|read|read!|readandwrite|readavailable|readbytes!|readchomp|readdir|readline|readlines|readlink|readstring|readuntil|real|realmax|realmin|realpath|recv|recvfrom|redirect_stderr|redirect_stdin|redirect_stdout|redisplay|reduce|reducedim|reenable_sigint|reim|reinterpret|reload|relpath|rem|rem2pi|repeat|replace|replace!|repmat|repr|reprmime|reset|reshape|resize!|rethrow|retry|reverse|reverse!|reverseind|rm|rol|rol!|ror|ror!|rot180|rotl90|rotr90|round|rounding|rowvals|rpad|rsearch|rsearchindex|rsplit|rstrip|run|scale!|schedule|schur|schurfact|schurfact!|search|searchindex|searchsorted|searchsortedfirst|searchsortedlast|sec|secd|sech|seek|seekend|seekstart|select|select!|selectperm|selectperm!|send|serialize|set_zero_subnormals|setdiff|setdiff!|setenv|setindex!|setprecision|setrounding|shift!|show|showall|showcompact|showerror|shuffle|shuffle!|sign|signbit|signed|signif|significand|similar|sin|sin_fast|sinc|sincos|sind|sinh|sinh_fast|sinpi|size|sizehint!|sizeof|skip|skipchars|skipmissing|sleep|slicedim|sort|sort!|sortcols|sortperm|sortperm!|sortrows|sparse|sparsevec|spawn|spdiagm|speye|splice!|split|splitdir|splitdrive|splitext|spones|sprand|sprandn|sprint|spzeros|sqrt|sqrt_fast|sqrtm|squeeze|srand|stacktrace|start|startswith|stat|std|stdm|step|stride|strides|string|stringmime|strip|strwidth|sub2ind|subtypes|success|sum|sum!|sumabs|sumabs2|summary|supertype|svd|svdfact|svdfact!|svdvals|svdvals!|sylvester|symdiff|symdiff!|symlink|systemerror|take!|takebuf_array|takebuf_string|tan|tan_fast|tand|tanh|tanh_fast|task_local_storage|tempdir|tempname|thisind|tic|time|time_ns|timedwait|to_indices|toc|toq|touch|trace|trailing_ones|trailing_zeros|transcode|transpose|transpose!|tril|tril!|triu|triu!|trues|trunc|truncate|trylock|tryparse|typeintersect|typejoin|typemax|typemin|unescape_string|union|union!|unique|unique!|unlock|unmark|unsafe_copy!|unsafe_copyto!|unsafe_load|unsafe_pointer_to_objref|unsafe_read|unsafe_store!|unsafe_string|unsafe_trunc|unsafe_wrap|unsafe_write|unshift!|unsigned|uperm|valtype|values|var|varinfo|varm|vcat|vec|vecdot|vecnorm|versioninfo|view|wait|walkdir|warn|which|whos|widemul|widen|withenv|workspace|write|xor|yield|yieldto|zero|zeros|zip|applicable|eval|fieldtype|getfield|invoke|isa|isdefined|nfields|nothing|setfield!|throw|tuple|typeassert|typeof|uninitialized)(?!{{symb_id}}) + + # julia> using Unicode + # julia> join(string.(filter!(x -> isa(eval(x), Module) && !Base.isdeprecated(Base, x), [names(Base); names(Core)])), "|") + base_modules: \b(?:BLAS|Base|Broadcast|DFT|Docs|Iterators|LAPACK|LibGit2|Libc|Libdl|LinAlg|Markdown|Meta|Operators|Pkg|Serializer|SparseArrays|StackTraces|Sys|Threads|Core|Main)\b + + # Highlight exported functions from base modules + # julia> using Unicode + # julia> base_modules = filter!(x -> isa(eval(x), Module) && x != :Main && !Base.isdeprecated(Base, x), [names(Base); names(Core)]) + # julia> modulefunctions(m) = join(filter!(x -> isascii(x[1]) && isalpha(x[1]) && islower(x[1]), string.(names(eval(m)))), "|") + # julia> regexify(m) = "$(string(m))\\.(?:$(modulefunctions(m)))" + # julia> rows = join(regexify.(base_modules), "|") + # julia> print("([^{}]+|\g<-1>)*}' + # Don't use the following ones for lookaheads! May lead to unwanted matches. + # These match unfinished nested braces, to highlight during typing. + nested_curly_sloppy: '(?:{(?>[^{}]+|\g<-1>)*}|\{[^\}\)\] ]*)' + nested_curly_and_round_sloppy: (?:(?>{(?>[^{}]+|\g<-1>)*}|\((?>[^()]+|\g<-1>)*\))|[\{\(][^\}\)\] ]*) + + # Recursively match nested brackets (of any type) and strings + # Must be wrapped in a matching group when used. It is best to do this explicitly when used (not here) to avoid confusion. + # NOTE: Use of atomic groups speeds up parsing immensely. + string: '"(?>(?>\\"|[^"])*|\g<-1>)*"' + nested_brackets_and_strings: |- + (?x) + (?> + {(?>{{string}}|[^{}]+|\g<-1>)*}| + \((?>{{string}}|[^()]+|\g<-1>)*\)| + \[(?>{{string}}|[^\[\]]+|\g<-1>)*\]| + {{string}} + ) + + # Helpers for function declaration + type_comparison_regex: (\$?{{symb_id}}+({{nested_curly_and_round_sloppy}})?)\s*(<:|>:)\s*((?:(?!\.\.)(?:[$.]|{{symb_id}}))+({{nested_curly_and_round_sloppy}})?) + func_name_standard: |- + (?x) + (?!!) # Function name doesn't start with ! + ([^\s{{symb_lang}}]+) # Function name + ({{nested_curly}})? # Match type annotation + (?=[\( ]) + func_name_paren: |- + (?x) + \( # Function name is wrapped in parentheses + (?!!) # Function name doesn't start with ! + (::)? # Function name can start with :: + ((?: # Rest of function name + ({{nested_curly}})| # Match nested curly brackets + [^)] # or anything that doesn't close paren + )+) + \) + ({{nested_curly}})? # Match type annotation + (?=\() + func_params: |- + (?x) + \( # Open function parameters + # We are lazy here and don't parse the exact form of a parameter list + # with types, default values, splats etc. It is not needed. + ( + ({{nested_brackets_and_strings}})| # Match nested brackets, can occur in parameter default value etc. + [^(){}\[\]"] # or anything that doesn't close the argument list + )* + \) # Close function parameters + ( # Allow where keyword + \s*where\s+ + ( + {{type_comparison_regex}}| + {{nested_curly}}| + {{symb_id}}+ + ) + )* + \s*=(?!=) # Followed by exactly one equal sign + +contexts: + main: + - include: declarations + - include: expressions + + expressions: + - include: comments + - include: symbols + - include: type-annotation + - include: type-comparison + - include: literals + - include: operators + - include: strings + - include: keywords + - include: macros + - include: support-functions + - include: function-call + - include: anonymous-function + - include: variable + - include: nested_parens + - include: nested_squarebrackets + + declarations: + - include: decl-func + - include: decl-func-assignment-form + - include: decl-type + - include: decl-macro + + comments: + - match: '#=' + push: comment-block + - match: '#.*' + scope: comment.line.number-sign.julia + + comment-block: + - meta_scope: comment.block.number-sign-equals.julia + - match: '#=' + push: comment-block + - match: '=#' + pop: true + + keywords: + - match: \b(begin|end|function|macro|quote|let|local|global|const|abstract|module|baremodule|using|import|export|in)\b + scope: keyword.other.julia + - match: \b(if|else|elseif|for|while|do|try|catch|finally|return|break|continue)\b + scope: keyword.control.julia + + operators: + # Bang is not only an operator symbol, it can also be part of a function name, thus it is treated separately. + # Single quote is not only an operator symbol, it can also start a string. It is an operator if it is preceded by an identifier, dot, single-quote, right round bracket or right square bracket + - match: (\.?)({{long_op}}) + captures: + 1: keyword.operator.broadcast.julia + 2: keyword.operator.julia + - match: (\.?)(=) + captures: + 1: keyword.operator.broadcast.julia + 2: keyword.operator.assignment.julia + - match: (\.)({{symb_op}}|') + captures: + 1: keyword.operator.broadcast.julia + 2: keyword.operator.julia + - match: |- + (?x) + ( + {{symb_op}}| + !| + (?<= + ( + {{symb_id}}| + [.')\]] + ) + ) + ' + ) + scope: keyword.operator.julia + + support-functions: + - match: '(?={{base_module_func}}\.?({{nested_curly}})?\()' + push: + - match: ({{base_modules}})\. + captures: + 1: support.module.julia + - match: (?<=\.)({{symb_id}}+) + scope: variable.function.julia support.function.julia meta.function-call.julia + push: function-call-helper + - match: '' + pop: true + - match: '(?={{base_module_func}})' + push: + - match: ({{symb_id}}+)\. + captures: + 1: support.module.julia + - match: (?<=\.)({{symb_id}}+) + scope: variable.function.julia support.function.julia + - match: '' + pop: true + + function-call: + - match: '(?:)\s*((?:(?!\.\.)(?:[$.]|{{symb_id}}))*({{nested_curly_and_round_sloppy}})?) + captures: + 1: keyword.operator.julia + 2: support.type.julia + + type-comparison: + - match: '{{type_comparison_regex}}' + captures: + 1: support.type.julia + 3: keyword.operator.julia + 4: support.type.julia + + where-type: + - match: (\{){{type_comparison_regex}}(\}) + captures: + 1: support.type.julia + 2: support.type.julia + 4: keyword.operator.julia + 5: support.type.julia + 7: support.type.julia + - match: '{{type_comparison_regex}}' + captures: + 1: support.type.julia + 3: keyword.operator.julia + 4: support.type.julia + - match: '({{nested_curly_sloppy}})' + scope: support.type.julia + - match: '{{symb_id}}+' + scope: support.type.julia + - match: \s*(where)\s+ + captures: + 1: keyword.other.julia + push: where-type + - match: '' + pop: true + + decl-func: + - match: '\b(?)' + set: function-parameters + - match: '({{symb_id}}+)(::)?({{symb_id}}+)?({{nested_curly}})?\s*(->)' + captures: + 1: variable.parameter + 2: keyword.operator + 3: support.type + 4: support.type + 5: keyword.operator + - match: '({{symb_id}}+)\s*(->)' + captures: + 1: variable.parameter + 2: keyword.operator + + # Do lookaheads to distinguish function calls from function definitions on assignment form + decl-func-assignment-form: + - match: |- + (?x) + (?= + {{func_name_paren}} + {{func_params}} + ) + push: func-name-paren + - match: |- + (?x) + (?= + {{func_name_standard}} + {{func_params}} + ) + push: func-name-standard + - match: |- + (?x) + (?= + (?!!) + ([^\s{{symb_lang}}]+\.)+ + {{func_name_standard}} + {{func_params}} + ) + push: + - match: '({{base_modules}})\.(?=[^\s{{symb_lang}}])' + captures: + 1: support.module.julia + push: func-name-standard + pop: true + - match: '(([^\s{{symb_lang}}]+\.)+)(?=[^\s{{symb_lang}}])' + captures: + 1: variable.other.julia + push: func-name-standard + pop: true + + func-name-standard: + - match: '{{func_name_standard}}' + captures: + 1: entity.name.function.julia + 2: support.type.julia + set: function-parameters + + func-name-paren: + - match: '{{func_name_paren}}' + captures: + 1: keyword.operator.julia + 2: entity.name.function.julia + 4: support.type.julia + set: function-parameters + + function-parameters: + - meta_content_scope: meta.function.parameters.julia + - match: end + scope: keyword.other + pop: true + - match: \)\s*(where)\s+ + captures: + 1: keyword.other + set: where-type + - match: \) + pop: true + - include: comments + - match: '=' + scope: keyword.operator.assignment.julia + set: + - meta_scope: meta.function.parameters.default-value.julia + - match: '(?=[,;)])' + set: function-parameters + - include: expressions + - include: type-annotation + - match: \.\.\. # Splat after type + scope: keyword.operator.julia + - match: ({{symb_id}}+)(\.\.\.)? + captures: + 1: variable.parameter.julia + 2: keyword.operator.julia + + decl-macro: + - match: '\b(macro)\s+([^(]+)\(' + captures: + 1: keyword.other.julia + 2: entity.name.macro.julia + set: function-parameters + + decl-type: + # Dollar is ok because type names can be interpolated. + - match: \b(?:(mutable)\s+(struct)|(abstract)\s+(type)|(primitive)\s+(type))\s+((?:\$|{{symb_id}})+)({{nested_curly}})? + scope: meta.type.julia + captures: # Make this less repetitive? + 1: keyword.other.julia + 2: keyword.other.julia + 3: keyword.other.julia + 4: keyword.other.julia + 5: keyword.other.julia + 6: keyword.other.julia + 7: entity.name.type.julia + 8: support.type.julia + - match: \b(struct)\s+((?:\$|{{symb_id}})+)({{nested_curly}})? + scope: meta.type.julia + captures: + 1: keyword.other.julia + 2: entity.name.type.julia + 3: support.type.julia + + symbols: + # This is slightly more involved than what one might first expect + # because, for example, in `:aa` the symbol is `aa` but in `:+a` only `+` is the symbol. + # Also take some extra steps to not mess up ternary a?b:c syntax. + - match: |- + (?x) + (?" + pop: true + - include: generics + - match: \( + push: + - match: \) + pop: true + - include: parameters + - match: (:) + captures: + 1: keyword.operator.declaration.kotlin + push: + - match: "(?={|$)" + pop: true + - match: \w+ + scope: entity.other.inherited-class.kotlin + - match: \( + push: + - match: \) + pop: true + - include: expressions + - match: '\{' + push: + - match: '\}' + pop: true + - include: statements + comments: + - match: /\* + captures: + 0: punctuation.definition.comment.kotlin + push: + - meta_scope: comment.block.kotlin + - match: \*/ + captures: + 0: punctuation.definition.comment.kotlin + pop: true + - match: \s*((//).*$\n?) + captures: + 1: comment.line.double-slash.kotlin + 2: punctuation.definition.comment.kotlin + constants: + - match: \b(true|false|null|this|super)\b + scope: constant.language.kotlin + - match: '\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)([LlFf])?\b' + scope: constant.numeric.kotlin + - match: '\b([A-Z][A-Z0-9_]+)\b' + scope: constant.other.kotlin + expressions: + - match: \( + push: + - match: \) + pop: true + - include: expressions + - include: types + - include: strings + - include: constants + - include: comments + - include: keywords + functions: + - match: (?=\s*\b(?:fun)\b) + push: + - match: '(?=$|\})' + pop: true + - match: \b(fun)\b + captures: + 1: keyword.other.kotlin + push: + - match: (?=\() + pop: true + - match: < + push: + - match: ">" + pop: true + - include: generics + - match: '([\.<\?>\w]+\.)?(\w+)' + captures: + 2: entity.name.function.kotlin + - match: \( + push: + - match: \) + pop: true + - include: parameters + - match: (:) + captures: + 1: keyword.operator.declaration.kotlin + push: + - match: "(?={|=|$)" + pop: true + - include: types + - match: '\{' + push: + - match: '(?=\})' + pop: true + - include: statements + - match: (=) + captures: + 1: keyword.operator.assignment.kotlin + push: + - match: (?=$) + pop: true + - include: expressions + generics: + - match: (:) + captures: + 1: keyword.operator.declaration.kotlin + push: + - match: (?=,|>) + pop: true + - include: types + - include: keywords + - match: \w+ + scope: storage.type.generic.kotlin + getters-and-setters: + - match: \b(get)\b\s*\(\s*\) + captures: + 1: entity.name.function.kotlin + push: + - match: '\}|(?=\bset\b)|$' + pop: true + - match: (=) + captures: + 1: keyword.operator.assignment.kotlin + push: + - match: (?=$|\bset\b) + pop: true + - include: expressions + - match: '\{' + push: + - match: '\}' + pop: true + - include: expressions + - match: \b(set)\b\s*(?=\() + captures: + 1: entity.name.function.kotlin + push: + - match: '\}|(?=\bget\b)|$' + pop: true + - match: \( + push: + - match: \) + pop: true + - include: parameters + - match: (=) + captures: + 1: keyword.operator.assignment.kotlin + push: + - match: (?=$|\bset\b) + pop: true + - include: expressions + - match: '\{' + push: + - match: '\}' + pop: true + - include: expressions + imports: + - match: '^\s*(import)\s+[^ $]+\s+(as)?' + captures: + 1: keyword.other.kotlin + 2: keyword.other.kotlin + keywords: + - match: \b(var|val|public|private|protected|abstract|final|sealed|enum|open|attribute|annotation|override|inline|vararg|in|out|internal|data|tailrec|operator|infix|const|yield|typealias|typeof|reified|suspend)\b + scope: storage.modifier.kotlin + - match: \b(try|catch|finally|throw)\b + scope: keyword.control.catch-exception.kotlin + - match: \b(if|else|while|for|do|return|when|where|break|continue)\b + scope: keyword.control.kotlin + - match: \b(in|is|!in|!is|as|as\?|assert)\b + scope: keyword.operator.kotlin + - match: (==|!=|===|!==|<=|>=|<|>) + scope: keyword.operator.comparison.kotlin + - match: (=) + scope: keyword.operator.assignment.kotlin + - match: (::) + scope: keyword.operator.kotlin + - match: (:) + scope: keyword.operator.declaration.kotlin + - match: \b(by)\b + scope: keyword.other.by.kotlin + - match: (\?\.) + scope: keyword.operator.safenav.kotlin + - match: (\.) + scope: keyword.operator.dot.kotlin + - match: (\?:) + scope: keyword.operator.elvis.kotlin + - match: (\-\-|\+\+) + scope: keyword.operator.increment-decrement.kotlin + - match: (\+=|\-=|\*=|\/=) + scope: keyword.operator.arithmetic.assign.kotlin + - match: (\.\.) + scope: keyword.operator.range.kotlin + - match: (\-|\+|\*|\/|%) + scope: keyword.operator.arithmetic.kotlin + - match: (!|&&|\|\|) + scope: keyword.operator.logical.kotlin + - match: (;) + scope: punctuation.terminator.kotlin + namespaces: + - match: \b(namespace)\b + scope: keyword.other.kotlin + - match: '\{' + push: + - match: '\}' + pop: true + - include: statements + parameters: + - match: (:) + captures: + 1: keyword.operator.declaration.kotlin + push: + - match: (?=,|\)|=) + pop: true + - include: types + - match: (=) + captures: + 1: keyword.operator.declaration.kotlin + push: + - match: (?=,|\)) + pop: true + - include: expressions + - include: keywords + - match: \w+ + scope: variable.parameter.function.kotlin + statements: + - include: namespaces + - include: typedefs + - include: classes + - include: functions + - include: variables + - include: getters-and-setters + - include: expressions + strings: + - match: '"""' + captures: + 0: punctuation.definition.string.begin.kotlin + push: + - meta_scope: string.quoted.third.kotlin + - match: '"""' + captures: + 0: punctuation.definition.string.end.kotlin + pop: true + - match: '(\$\w+|\$\{[^\}]+\})' + scope: variable.parameter.template.kotlin + - match: \\. + scope: constant.character.escape.kotlin + - match: '"' + captures: + 0: punctuation.definition.string.begin.kotlin + push: + - meta_scope: string.quoted.double.kotlin + - match: '"' + captures: + 0: punctuation.definition.string.end.kotlin + pop: true + - match: '(\$\w+|\$\{[^\}]+\})' + scope: variable.parameter.template.kotlin + - match: \\. + scope: constant.character.escape.kotlin + - match: "'" + captures: + 0: punctuation.definition.string.begin.kotlin + push: + - meta_scope: string.quoted.single.kotlin + - match: "'" + captures: + 0: punctuation.definition.string.end.kotlin + pop: true + - match: \\. + scope: constant.character.escape.kotlin + - match: "`" + captures: + 0: punctuation.definition.string.begin.kotlin + push: + - meta_scope: string.quoted.single.kotlin + - match: "`" + captures: + 0: punctuation.definition.string.end.kotlin + pop: true + typedefs: + - match: (?=\s*(?:type)) + push: + - match: (?=$) + pop: true + - match: \b(type)\b + scope: keyword.other.kotlin + - match: < + push: + - match: ">" + pop: true + - include: generics + - include: expressions + types: + - match: \b(Nothing|Any|Unit|String|CharSequence|Int|Boolean|Char|Long|Double|Float|Short|Byte|dynamic)\b + scope: storage.type.buildin.kotlin + - match: \b(IntArray|BooleanArray|CharArray|LongArray|DoubleArray|FloatArray|ShortArray|ByteArray)\b + scope: storage.type.buildin.array.kotlin + - match: \b(Array|Collection|List|Map|Set|MutableList|MutableMap|MutableSet|Sequence)<\b + captures: + 1: storage.type.buildin.collection.kotlin + push: + - match: ">" + pop: true + - include: types + - include: keywords + - match: \w+< + push: + - match: ">" + pop: true + - include: types + - include: keywords + - match: '\{' + push: + - match: '\}' + pop: true + - include: statements + - match: \( + push: + - match: \) + pop: true + - include: types + - match: (->) + scope: keyword.operator.declaration.kotlin + variables: + - match: (?=\s*\b(?:var|val)\b) + push: + - match: (?=:|=|(\b(by)\b)|$) + pop: true + - match: \b(var|val)\b + captures: + 1: keyword.other.kotlin + push: + - match: (?=:|=|(\b(by)\b)|$) + pop: true + - match: < + push: + - match: ">" + pop: true + - include: generics + - match: '([\.<\?>\w]+\.)?(\w+)' + captures: + 2: entity.name.variable.kotlin + - match: (:) + captures: + 1: keyword.operator.declaration.kotlin + push: + - match: (?==|$) + pop: true + - include: types + - include: getters-and-setters + - match: \b(by)\b + captures: + 1: keyword.other.kotlin + push: + - match: (?=$) + pop: true + - include: expressions + - match: (=) + captures: + 1: keyword.operator.assignment.kotlin + push: + - match: (?=$) + pop: true + - include: expressions + - include: getters-and-setters diff --git a/assets/syntaxes/LESS.sublime-syntax b/assets/syntaxes/LESS.sublime-syntax new file mode 100644 index 0000000..fe8b32e --- /dev/null +++ b/assets/syntaxes/LESS.sublime-syntax @@ -0,0 +1,618 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: Less +file_extensions: + - less + - css.less +scope: source.css.less + +variables: + unicode: '\\\h{1,6}[ \t\n\f]?' + escape: '(?:{{unicode}}|\\[^\n\f\h])' + nonascii: '[\p{L}\p{M}\p{S}\p{N}&&[^[:ascii:]]]' + nmstart: '(?:[[_a-zA-Z]{{nonascii}}]|{{escape}})' + nmchar: '(?:[[-\w]{{nonascii}}]|{{escape}})' + ident: '(?:--{{nmchar}}+|-?{{nmstart}}{{nmchar}}*)' + combinators: '(?:>{1,3}|[~+])' + +contexts: + main: + - include: comment-block + - include: comment-line + - include: commas + - include: css-variables + - include: terminator + - include: literal-string + - include: at-rules + - include: selector + - include: rule-list + - include: numeric-values + - include: property-names + - include: property-list + - include: less-functions + - include: less-declarations + - include: less-variables + - include: less-operators + - include: less-parameters + + qualified-name: + - match: '(?:({{ident}})|(\*))?([|])(?!=)' + captures: + 1: entity.other.namespace-prefix.css + 2: entity.name.namespace.wildcard.css + 3: punctuation.separator.namespace.css + + commas: + - match: '\s*(,)\s*' + captures: + 0: meta.selector.css + 1: punctuation.separator.css + + terminator: + - match: '\s*(;)\s*' + captures: + 1: punctuation.terminator.statement.css + + color-values: + - match: \b(yellowgreen|yellow|whitesmoke|white|wheat|violet|turquoise|tomato|thistle|teal|tan|steelblue|springgreen|snow|slategrey|slategray|slateblue|skyblue|silver|sienna|seashell|seagreen|sandybrown|salmon|saddlebrown|royalblue|rosybrown|red|rebeccapurple|purple|powderblue|plum|pink|peru|peachpuff|papayawhip|palevioletred|paleturquoise|palegreen|palegoldenrod|orchid|orangered|orange|olivedrab|olive|oldlace|navy|navajowhite|moccasin|mistyrose|mintcream|midnightblue|mediumvioletred|mediumturquoise|mediumspringgreen|mediumslateblue|mediumseagreen|mediumpurple|mediumorchid|mediumblue|mediumaquamarine|maroon|linen|limegreen|lime|lightyellow|lightsteelblue|lightslategrey|lightslategray|lightskyblue|lightseagreen|lightsalmon|lightpink|lightgrey|lightgreen|lightgray|lightgoldenrodyellow|lightcyan|lightcoral|lightblue|lemonchiffon|lawngreen|lavenderblush|lavender|khaki|ivory|indigo|indianred|hotpink|honeydew|grey|greenyellow|green|gray|goldenrod|gold|ghostwhite|gainsboro|fuchsia|forestgreen|floralwhite|firebrick|dodgerblue|dimgrey|dimgray|deepskyblue|deeppink|darkviolet|darkturquoise|darkslategrey|darkslategray|darkslateblue|darkseagreen|darksalmon|darkred|darkorchid|darkorange|darkolivegreen|darkmagenta|darkkhaki|darkgrey|darkgreen|darkgray|darkgoldenrod|darkcyan|darkblue|crimson|cornsilk|cornflowerblue|coral|chocolate|chartreuse|cadetblue|burlywood|brown|blueviolet|blue|blanchedalmond|black|bisque|beige|azure|aquamarine|aqua|antiquewhite|aliceblue)\b + comment: http://www.w3.org/TR/CSS21/syndata.html#value-def-color + scope: support.constant.color.w3c-standard-color-name.css + - match: (hsla?|rgba?)\s*(\() + captures: + 1: support.function.misc.css + 2: punctuation.definition.group.begin.css + push: + - meta_scope: meta.group.css + - match: '\)' + scope: punctuation.definition.group.end.css + pop: true + - match: '(?x)\b(0*((1?[0-9]{1,2})|(2([0-4][0-9]|5[0-5])))\s*,\s*){2}(0*((1?[0-9]{1,2})|(2([0-4][0-9]|5[0-5])))\b)(\s*,\s*((0?\.[0-9]+)|[0-1]))?' + scope: constant.other.color.rgb-value.css + - match: '\b([0-9]{1,2}|100)\s*%,\s*([0-9]{1,2}|100)\s*%,\s*([0-9]{1,2}|100)\s*%' + scope: constant.other.color.rgb-percentage.css + - include: numeric-values + + comment-block: + - match: /\* + scope: punctuation.definition.comment.css + push: + - meta_scope: comment.block.css + - match: \*/ + scope: punctuation.definition.comment.css + pop: true + + comment-line: + - match: // + scope: punctuation.definition.comment.css + push: + - meta_scope: comment.line.double-slash.less + - match: $\n? + scope: punctuation.definition.comment.css + pop: true + + at-rules: + - match: ((@)(?:-(?:webkit|moz|o)-)?(charset|import|namespace|page|font-face|supports|document)\b) + captures: + 1: keyword.control.at-rule.css + 2: punctuation.definition.keyword.css + push: + - meta_scope: meta.at-rule.css + - match: '\s*(?=[\{;])' + pop: true + - match: (url)(\() + captures: + 1: meta.function-call.css support.function.url.css + 2: punctuation.definition.group.begin.css + push: + - meta_scope: meta.group.css + - match: '\)' + scope: punctuation.definition.group.end.css + pop: true + - include: literal-string + - include: unquoted-string + - include: comment-block + - include: literal-string + - include: less-parameters + - match: \s*((@)keyframes)(?=.*?) + captures: + 1: keyword.control.at-rule.css + 2: punctuation.definition.keyword.css + push: + - meta_scope: meta.at-rule.keyframes.css + - match: '\s*(?=[\{;])' + pop: true + - include: comment-block + - match: '[a-zA-Z0-9_-]+' + scope: variable.other.css + - match: \s*((@)media)(?=\s+.*?) + captures: + 1: keyword.control.at-rule.media.css + 2: punctuation.definition.keyword.css + 3: support.constant.media.css + push: + - meta_scope: meta.at-rule.media.css + - match: '\s*(?=\{)' + pop: true + - include: comment-block + - include: less-operators + - match: (?i)\s*(only|not)?\s*(all|aural|braille|embossed|handheld|print|projection|screen|speech|tty|tv)? + captures: + 1: keyword.operator.logic.media.css + 2: support.constant.media.css + - match: '\(' + scope: punctuation.definition.group.begin.css + push: + - meta_scope: meta.group.css + - match: '\)' + scope: punctuation.definition.group.end.css + pop: true + - include: vendor-prefixes + - match: |- + (?x) + ( + ((min|max)-)? + ( + ((device-)?(height|width|aspect-ratio|pixel-ratio))| + (color(-index)?)|monochrome|resolution + ) + )|grid|scan|orientation + \s*(?=[:)]) + captures: + 0: support.type.property-name.media.css + - match: \b(portrait|landscape|progressive|interlace) + scope: support.constant.property-value.css + - match: ':' + scope: punctuation.separator.key-value.css + - include: comment-block + - include: comment-line + - include: numeric-values + - include: css-variables + - include: property-names + - include: property-values + - include: less-functions + - include: less-variables + - include: less-operators + + less-data-uri: + - match: (url)(\()(?=(data:|"data:|'data:)) + captures: + 1: support.function.misc.css + 2: punctuation.definition.group.begin.css + push: + - meta_scope: meta.group.css + - match: '\)' + scope: punctuation.definition.group.end.css + pop: true + - include: less-interpolation + - include: literal-string + - include: unquoted-string + + less-functions: + - match: \b(unit|tan|sqrt|spin|softlight|sin|screen|saturation|saturate|round|replace|red|pow|pi|percentage|overlay|negation|multiply|mod|mix|min|max|luma|lightness|lighten|length|isnumber|hue|hsvvalue|hsvsaturation|hsvhue|hsva|hsv|hsla|hsl|hardlight|greyscale|green|format|floor|fadeout|fadein|fade|extract|exclusion|escape|e|difference|desaturate|data-uri|darken|cos|convert|convert|contrast|color|ceil|calc|blue|average|atan|asin|argb|alpha|acos|abs)(\() + captures: + 1: support.function.less + 2: meta.group.less punctuation.definition.group.begin.less + push: + - meta_scope: meta.function-call.less + - meta_content_scope: meta.group.less meta.function.parameters.less + - match: '\)' + scope: meta.group.less punctuation.definition.group.end.less + pop: true + - match: ':' + scope: punctuation.separator.key-value.css + - include: comment-block + - include: commas + - include: terminator + - include: color-values + - include: numeric-values + - include: literal-string + - include: css-variables + - include: less-functions + - include: less-variables + - include: less-operators + + less-operators: + - match: /|$|%|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|%=|\+=|\-=|&=|\bnot\b|\bor\b|\band\b|\bwhen\b|\bfrom\b|\bto\b + scope: keyword.operator.less + + property-list: + - match: '\{' + scope: punctuation.section.property-list.begin.css + push: + - match: '\}' + scope: punctuation.section.property-list.end.css + pop: true + - include: main + + less-parameters: + - match: '\(' + scope: punctuation.definition.group.begin.less + push: + - meta_scope: meta.group.less meta.function.parameters.less + - match: '\)' + scope: punctuation.definition.group.end.less + pop: true + - match: ':' + scope: punctuation.separator.key-value.css + - include: comment-line + - include: comment-block + - include: commas + - include: terminator + - include: property-list + - include: color-values + - include: numeric-values + - include: literal-string + - include: css-variables + - include: less-functions + - include: less-variables + - include: less-operators + + less-declarations: + - match: '(@)([a-zA-Z0-9_-][\w-]*)' + scope: variable.declaration.less + captures: + 1: punctuation.definition.variable.less + + less-interpolation: + - match: '(@)({)([a-zA-Z0-9_-][\w-]*)(})' + scope: variable.other.less + captures: + 1: punctuation.definition.variable.less + 2: punctuation.definition.string.begin.less + 3: string.interpolated.less + 4: punctuation.definition.string.end.less + + css-variables: + - match: '\b(var)(?=\()' + scope: support.function.var.css + push: + - meta_scope: meta.function-call.css + - meta_content_scope: meta.group.css + - match: '\)' + scope: meta.group.css punctuation.definition.group.end.css + pop: true + - match: '(\()((--)({{nmchar}}+))' + captures: + 1: punctuation.definition.group.begin.css + 2: support.type.custom-property.css + 3: punctuation.definition.custom-property.css + 4: support.type.custom-property.name.css + + less-variables: + - match: '(@{1,2})([a-zA-Z0-9_-][\w-]*)' + scope: variable.other.less + captures: + 1: punctuation.definition.variable.less + - include: less-interpolation + - match: (~)(") + captures: + 1: keyword.operator.less + 2: punctuation.definition.string.begin.less + push: + - meta_scope: string.quoted.double.css markup.raw.less + - match: '"' + scope: punctuation.definition.string.end.less + pop: true + - include: less-interpolation + - match: (~)(') + captures: + 1: keyword.operator.less + 2: punctuation.definition.string.begin.less + push: + - meta_scope: string.quoted.single.css markup.raw.less + - match: "'" + scope: punctuation.definition.string.end.less + pop: true + - include: less-interpolation + + numeric-values: + - match: '(#)([0-9a-fA-F]{3}|[0-9a-fA-F]{6})\b' + scope: constant.other.color.rgb-value.css + captures: + 1: punctuation.definition.constant.css + - match: '(?x)(?:-|\+)?(?:(?:[0-9]+(?:\.[0-9]+)?)|(?:\.[0-9]+))((?:vw|vmin|vmax|vh|turn|s|rem|rad|px|pt|pc|ms|mm|in|grad|fr|ex|em|dppx|dpi|dpcm|deg|cm|ch)\b|%)?' + scope: constant.numeric.css + captures: + 1: keyword.other.unit.css + + vendor-prefixes: + - match: '(-webkit-|-o-|-ms-|-moz-|-khtml-)(?=[A-Za-z])' + scope: support.type.vendor-prefix.css + + property-names: + - include: vendor-prefixes + - include: comment-block + - match: '(--)({{nmchar}}+)' + scope: support.type.custom-property.css + captures: + 1: punctuation.definition.custom-property.css + 2: support.type.custom-property.name.css + - match: |- + \b(?x)( + display|width|background-color|height|position|font-family|font-weight + | top|opacity|cursor|background-image|right|visibility|box-sizing + | user-select|left|float|margin-left|margin-top|line-height + | padding-left|z-index|margin-bottom|margin-right|margin + | vertical-align|padding-top|white-space|border-radius|padding-bottom + | padding-right|padding|bottom|clear|max-width|box-shadow|content + | border-color|min-height|min-width|font-style|border-width + | border-collapse|background-size|text-overflow|max-height|text-transform + | text-shadow|text-indent|border-style|overflow-y|list-style-type + | word-wrap|border-spacing|appearance|zoom|overflow-x|border-top-left-radius + | border-bottom-left-radius|border-top-color|pointer-events + | border-bottom-color|align-items|justify-content|letter-spacing + | border-top-right-radius|border-bottom-right-radius|border-right-width + | font-smoothing|border-bottom-width|border-right-color|direction + | border-top-width|src|border-left-color|border-left-width + | tap-highlight-color|table-layout|background-clip|word-break + | transform-origin|resize|filter|backface-visibility|text-rendering + | box-orient|transition-property|transition-duration|word-spacing + | quotes|outline-offset|animation-timing-function|animation-duration + | animation-name|transition-timing-function|border-bottom-style + | border-bottom|transition-delay|transition|unicode-bidi|border-top-style + | border-top|unicode-range|list-style-position|orphans|outline-width + | line-clamp|order|flex-direction|box-pack|animation-fill-mode + | outline-color|list-style-image|list-style|touch-action|flex-grow + | border-left-style|border-left|animation-iteration-count + | page-break-inside|box-flex|box-align|page-break-after|animation-delay + | widows|border-right-style|border-right|flex-align|outline-style + | outline|background-origin|animation-direction|fill-opacity + | background-attachment|flex-wrap|transform-style|counter-increment + | overflow-wrap|counter-reset|animation-play-state + | will-change|box-ordinal-group|image-rendering|mask-image|flex-flow + | background-position-y|stroke-width|background-position-x|background-position + | background-blend-mode|flex-shrink|flex-basis|flex-order|flex-item-align + | flex-line-pack|flex-negative|flex-pack|flex-positive|flex-preferred-size + | flex|user-drag|font-stretch|column-count|empty-cells|align-self + | caption-side|mask-size|column-gap|mask-repeat|box-direction + | font-feature-settings|mask-position|align-content|object-fit + | columns|text-fill-color|clip-path|stop-color|font-kerning + | page-break-before|stroke-dasharray|size|fill-rule|border-image-slice + | column-width|break-inside|column-break-before|border-image-width + | stroke-dashoffset|border-image-repeat|border-image-outset|line-break + | stroke-linejoin|stroke-linecap|stroke-miterlimit|stroke-opacity + | stroke|shape-rendering|border-image-source|border-image|border + | tab-size|writing-mode|perspective-origin-y|perspective-origin-x + | perspective-origin|perspective|text-align-last|text-align|clip-rule + | clip|text-anchor|column-rule-color|box-decoration-break|column-fill + | fill|column-rule-style|mix-blend-mode|text-emphasis-color + | baseline-shift|dominant-baseline|page|alignment-baseline + | column-rule-width|column-rule|break-after|font-variant-ligatures + | transform-origin-y|transform-origin-x|transform|object-position + | break-before|column-span|isolation|shape-outside|all + | color-interpolation-filters|marker|marker-end|marker-start + | marker-mid|color-rendering|color-interpolation|background-repeat-x + | background-repeat-y|background-repeat|background|mask-type + | flood-color|flood-opacity|text-orientation|mask-composite + | text-emphasis-style|paint-order|lighting-color|shape-margin + | text-emphasis-position|text-emphasis|shape-image-threshold + | mask-clip|mask-origin|mask|font-variant-caps|font-variant-alternates + | font-variant-east-asian|font-variant-numeric|font-variant-position + | font-variant|font-size-adjust|font-size|font-language-override + | font-display|font-synthesis|font|line-box-contain|text-justify + | text-decoration-color|text-decoration-style|text-decoration-line + | text-decoration|text-underline-position|grid-template-rows + | grid-template-columns|grid-template-areas|grid-template|rotate|scale + | translate|scroll-behavior|grid-column-start|grid-column-end + | grid-column-gap|grid-row-start|grid-row-end|grid-auto-rows + | grid-area|grid-auto-flow|grid-auto-columns|image-orientation + | hyphens|overflow-scrolling|overflow|color-profile|kerning + | nbsp-mode|color|image-resolution|grid-row-gap|grid-row|grid-column + | blend-mode|azimuth|pause-after|pause-before|pause|pitch-range|pitch + | text-height|system|negative|prefix|suffix|range|pad|fallback + | additive-symbols|symbols|speak-as|speak|grid-gap + )\b + scope: meta.property-name.css support.type.property-name.css + - match: '\b(animation-name|animation)\b' + scope: meta.property-name.css support.type.property-name.css + push: + - meta_content_scope: meta.property-value.css + - match: '\s*(?=;|(?=[{}]))' + pop: true + - match: ':' + scope: punctuation.separator.key-value.css + - include: comment-block + - include: comment-line + - include: property-values + - match: '[a-zA-Z0-9_-]+' + scope: variable.other.css + + property-values: + - match: \!\s*important + scope: keyword.other.important.css + captures: + 1: punctuation.definition.keyword.css + - include: comment-block + - include: literal-string + - include: vendor-prefixes + - include: color-values + - include: numeric-values + - include: css-variables + - include: less-variables + - include: less-data-uri + - include: less-functions + - include: less-operators + - include: selector + - match: \b(wrap-reverse|wrap|whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|unicase|underline|ultra-expanded|ultra-condensed|transparent|transform|top|titling-caps|thin|thick|text-top|text-bottom|text|tb-rl|table-row-group|table-row|table-header-group|table-footer-group|table-column-group|table-column|table-cell|table|sw-resize|super|subpixel-antialiased|strict|stretch|step-start|step-end|static|start|sRGB|square|square|space-between|space-around|space|solid|soft-light|small-caps|separate|semi-expanded|semi-condensed|se-resize|scroll|screen|scale-down|saturation|s-resize|running|rtl|row-reverse|row-resize|row|round|round|right|ridge|reverse|repeat-y|repeat-x|repeat|relative|progressive|progress|pre-wrap|pre-line|pre|pointer|petite-caps|paused|pan-y|pan-x|pan-up|pan-right|pan-left|pan-down|padding-box|overline|overlay|outside|outset|optimizeSpeed|optimizeSpeed|optimizeQuality|optimizeLegibility|open-quote|opacity|oblique|nw-resize|nowrap|not-allowed|normal|nonzero|none|no-repeat|no-open-quote|no-drop|no-close-quote|newspaper|ne-resize|n-resize|multiply|move|miter|middle|middle|medium|max-height|manipulation|main-size|luminosity|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|local|list-item|linearRGB|linear(?!-)|line-through|line-edge|line|lighter|lighten|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline-block|inline|inherit|infinite|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|hue|horizontal|hidden|help|hard-light|hand|groove|geometricPrecision |geometricPrecision|forwards|flex-start|flex-end|flex|fixed|extra-expanded|extra-condensed|expanded|exclusion|evenodd |end |ellipsis|ease-out|ease-in-out|ease-in|ease|e-resize|double|dotted|distribute-space|distribute-letter|distribute-all-lines|distribute|disc|disabled|difference|default|decimal|dashed|darken|currentColor|crosshair|crispEdges|cover|content-box|contain|condensed|column-reverse|column|color-dodge|color-burn|color|collapse|col-resize|close-quote|circle|char|center|capitalize|butt|break-word|break-all|bottom|both|border-box|bolder|bold|block|bidi-override|bevel|below|baseline|balance|backwards|auto|antialiased|always|alternate-reverse|alternate|all-small-caps|all-scroll|all-petite-caps|all|absolute)(?![-])\b + scope: support.constant.property-value.css + - match: (\b(?i:webdings|verdana|utopia|trebuchet|times|tahoma|system|symbol|serif|sans-serif|monospace|lucida|impact|helvetica|georgia|garamond|futura|fantasy|cursive|courier|comic|century|arial)\b) + scope: support.constant.font-name.css + - match: (rect)\s*(\() + captures: + 1: support.function.misc.css + 2: punctuation.definition.group.begin.css + push: + - meta_scope: meta.group.css + - match: '\)' + scope: punctuation.definition.group.end.css + pop: true + - include: numeric-values + - match: '(whiteness|url-prefix|url|translate[XYZ]|translate3d|translate|tint|skew[XY]|skew|shade|sepia|scale[XYZ]|scale|saturation|saturate|rotate[XYZ]|rotate3d|rotate|rgba|rgb|repeating-radial-gradient|repeating-linear-gradient|regexp|rect|radial-gradient|opacity|minmax|matrix3d|matrix|local|linear-gradient|lightness|invert|image-set|image|hsla|hsl|grayscale|gray|format|drop-shadow|domain|device-cmyk|cubic-bezier|cross-fade|counters|counter|contrast|color|brightness|blur|blenda|blend|blackness|attr)\s*(\()' + captures: + 1: support.function.css + 2: meta.group.css punctuation.definition.group.begin.css + push: + - meta_scope: meta.function-call.css + - meta_content_scope: meta.group.css meta.function.parameters.css + - match: '\)' + scope: meta.group.css punctuation.definition.group.end.css + pop: true + - include: literal-string + - include: color-values + - include: numeric-values + - include: css-variables + - include: less-variables + - include: less-functions + - include: property-names + + rule-list: + - include: property-names + - match: (:)\s* + captures: + 1: punctuation.separator.key-value.css + push: + - meta_scope: meta.property-value.css + - match: '\s*(?=;|(?=[{}]))' + pop: true + - include: property-values + + selector: + # Combinators + # https://drafts.csswg.org/selectors-4/#combinators + # https://drafts.csswg.org/css-scoping/#deep-combinator + - match: '\s*({{combinators}})(?![>~+]\s*)' + scope: meta.selector.css + captures: + 1: punctuation.separator.combinator.css + - match: '&' + scope: meta.selector.css keyword.operator.ampersand.less + push: + - match: '\s' + scope: meta.selector.css + pop: true + - include: selector + - match: '(-+|_+)[a-zA-Z_][a-zA-Z0-9_-]*' + scope: meta.selector.css entity.other.attribute-name.css + - match: '([\.#])(?![0-9])[a-zA-Z0-9_-]+(?=\()' + scope: meta.selector.css entity.other.attribute-name.class.css entity.other.less.mixin + captures: + 1: punctuation.definition.entity.css + - match: '\b(use|tspan|tref|textPath|text|symbol|switch|stop|rect|radialGradient|polyline|polygon|pattern|path|mask|marker|linearGradient|line|image|glyphRef|glyph|g|foreignObject|filter|ellipse|defs|clipPath|circle|xmp|wbr|video|var|ul|u|tt|track|tr|title|time|thead|th|tfoot|textarea|template|td|tbody|table|svg|sup|summary|sub|style|strong|strike|span|source|small|shadow|select|section|script|samp|s|rtc|rt|rp|q|progress|pre|picture|param|p|output|option|optgroup|ol|object|noscript|noframes|nav|meter|meta|menu|mark|map|main|link|li|legend|label|keygen|kbd|isindex|ins|input|img|iframe|i|html|hr|hgroup|header|head|h[1-6]|frameset|frame|form|footer|figcaption|figure|fieldset|eventsource|embed|em|element|dt|dl|div|dialog|dir|dfn|details|del|dd|datalist|data|content|colgroup|col|code|cite|caption|canvas|button|br|body|blockquote|big|bdo|bdi|basefont|base|b|audio|aside|article|area|applet|address|acronym|abbr|a)\b(\s*)(?=([a-z.,+~{#\s\[\)]|:+[a-z]|$))' + captures: + 1: meta.selector.css entity.name.tag.css + 2: meta.selector.css + - match: '(\.)(?=-?([a-zA-Z_]|@{)[a-zA-Z0-9_-]*)' + captures: + 1: punctuation.definition.entity.css + push: + - meta_scope: meta.selector.css entity.other.attribute-name.class.css + - include: less-interpolation + - match: '(\s*)(?=[^a-zA-Z0-9_-])' + captures: + 1: meta.selector.css + pop: true + - match: "(#)(?=-?([a-zA-Z_]|@{)[a-zA-Z0-9_-]*)" + captures: + 1: punctuation.definition.entity.css + push: + - meta_scope: meta.selector.css entity.other.attribute-name.id.css + - include: less-interpolation + - match: '(?=[^a-zA-Z0-9_-])' + pop: true + - match: '\*' + scope: entity.name.tag.wildcard.css + - match: (:)(visited|valid|target|scope|root|right|required|read-write|read-only|out-of-range|optional|only-of-type|only-child|link|left|last-of-type|last-child|invalid|indeterminate|in-range|hover|fullscreen|focus|first-of-type|first-child|first|enabled|empty|disabled|default|checked|any|active)\b + scope: meta.selector.css entity.other.pseudo-class.css + captures: + 1: punctuation.definition.entity.css + - match: (:)(extend)\b + scope: meta.selector.css entity.other.pseudo-class.less + captures: + 1: punctuation.definition.entity.css + - match: ((:)not|lang|dir)(\() + captures: + 1: entity.other.pseudo-class.css + 2: punctuation.definition.entity.css + 3: punctuation.definition.group.begin.css + push: + - meta_scope: meta.selector.css meta.group.css + - match: '\)' + scope: punctuation.definition.group.end.css + pop: true + - include: selector + - match: ((:)nth-(?:(?:last-)?child|(?:last-)?of-type))(?=\() + captures: + 1: entity.other.pseudo-class.css + 2: punctuation.definition.entity.css + push: + - meta_scope: meta.selector.css + - match: '\)' + scope: meta.group.css punctuation.definition.group.end.css + pop: true + - match: '\(' + scope: meta.group.css punctuation.definition.group.begin.css + - match: '[+-]' + scope: keyword.operator.css + - match: '[0-9]+(n*)' + scope: meta.group.css constant.numeric.css + captures: + 1: keyword.other.unit.css + - match: (:|::)(selection|first-line|first-letter|before|backdrop|after)\b + scope: meta.selector.css entity.other.pseudo-element.css + captures: + 1: punctuation.definition.entity.css + - match: '\[' + scope: punctuation.definition.entity.css + push: + - meta_scope: meta.attribute-selector.css + - include: qualified-name + - match: '({{ident}})' + scope: entity.other.attribute-name.css + - match: '\s*([~*|^$]?=)\s*' + captures: + 1: keyword.operator.attribute-selector.css + push: + - include: literal-string + - include: unquoted-string + - match: '(?=(\s|\]))' + pop: true + - match: '(?:\s+([iI]))?' # case insensitive flag + captures: + 1: keyword.other.css + - match: '\]' + scope: punctuation.definition.entity.css + pop: true + + unquoted-string: + - match: '[^\s\]\[''"]' + scope: string.unquoted.css + + literal-string: + - match: "'" + scope: punctuation.definition.string.begin.css + push: + - meta_scope: string.quoted.single.css + - match: (')|(\n) + captures: + 1: punctuation.definition.string.end.css + 2: invalid.illegal.newline.css + pop: true + - include: string-content + - match: '"' + scope: punctuation.definition.string.begin.css + push: + - meta_scope: string.quoted.double.css + - match: (")|(\n) + captures: + 1: punctuation.definition.string.end.css + 2: invalid.illegal.newline.css + pop: true + - include: string-content + + string-content: + - match: \\\s*\n + scope: constant.character.escape.newline.css + - match: '\\(\h{1,6}|.)' + scope: constant.character.escape.css + - include: less-interpolation diff --git a/assets/syntaxes/Nix.sublime-syntax b/assets/syntaxes/Nix.sublime-syntax new file mode 100644 index 0000000..81ed7c6 --- /dev/null +++ b/assets/syntaxes/Nix.sublime-syntax @@ -0,0 +1,609 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: Nix +file_extensions: + - nix +scope: source.nix +contexts: + main: + - include: expression + comment: + - match: '/\*([^*]|\*[^\/])*' + push: + - meta_scope: comment.block.nix + - match: \*\/ + pop: true + - include: comment-remark + - match: '\#' + push: + - meta_scope: comment.line.number-sign.nix + - match: $ + pop: true + - include: comment-remark + attribute-bind: + - include: attribute-name + - include: attribute-bind-from-equals + attribute-bind-from-equals: + - match: \= + captures: + 0: keyword.operator.bind.nix + push: + - match: \; + captures: + 0: punctuation.terminator.bind.nix + pop: true + - include: expression + attribute-inherit: + - match: \binherit\b + captures: + 0: keyword.other.inherit.nix + push: + - match: \; + captures: + 0: punctuation.terminator.inherit.nix + pop: true + - match: \( + captures: + 0: punctuation.section.function.arguments.nix + push: + - match: (?=\;) + pop: true + - match: \) + captures: + 0: punctuation.section.function.arguments.nix + push: + - match: (?=\;) + pop: true + - include: bad-reserved + - include: attribute-name-single + - include: others + - include: expression + - match: '(?=[a-zA-Z\_])' + push: + - match: (?=\;) + pop: true + - include: bad-reserved + - include: attribute-name-single + - include: others + - include: others + attribute-name: + - match: '\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*' + scope: entity.other.attribute-name.multipart.nix + - match: \. + - include: string-quoted + - include: interpolation + attribute-name-single: + - match: '\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*' + scope: entity.other.attribute-name.single.nix + attrset-contents: + - include: attribute-inherit + - include: bad-reserved + - include: attribute-bind + - include: others + attrset-definition: + - match: '(?=\{)' + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - match: '(\{)' + captures: + 0: punctuation.definition.attrset.nix + push: + - match: '(\})' + captures: + 0: punctuation.definition.attrset.nix + pop: true + - include: attrset-contents + - match: '(?<=\})' + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: expression-cont + attrset-definition-brace-opened: + - match: '(?<=\})' + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: expression-cont + - match: (?=.?) + push: + - match: '\}' + captures: + 0: punctuation.definition.attrset.nix + pop: true + - include: attrset-contents + attrset-for-sure: + - match: (?=\brec\b) + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - match: \brec\b + captures: + 0: keyword.other.nix + push: + - match: '(?=\{)' + pop: true + - include: others + - include: attrset-definition + - include: others + - match: '(?=\{\s*(\}|[^,?]*(=|;)))' + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: attrset-definition + - include: others + attrset-or-function: + - match: '\{' + captures: + 0: punctuation.definition.attrset-or-function.nix + push: + - match: '(?=([\])};]|\b(else|then)\b))' + pop: true + - match: '(?=(\s*\}|\"|\binherit\b|\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*(\s*\.|\s*=[^=])))' + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: attrset-definition-brace-opened + - match: '(?=(\.\.\.|\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*\s*[,?]))' + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: function-definition-brace-opened + - include: bad-reserved + - match: '\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*' + captures: + 0: variable.parameter.function.maybe.nix + push: + - match: '(?=([\])};]|\b(else|then)\b))' + pop: true + - match: (?=\.) + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: attrset-definition-brace-opened + - match: \s*(\,) + captures: + 1: keyword.operator.nix + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: function-definition-brace-opened + - match: (?=\=) + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: attribute-bind-from-equals + - include: attrset-definition-brace-opened + - match: (?=\?) + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: function-parameter-default + - match: \, + captures: + 0: keyword.operator.nix + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: function-definition-brace-opened + - include: others + - include: others + bad-reserved: + - match: '(?\=|\>|&&|\|\||-\>|//|\?|\+\+|-|\*|/(?=([^*]|$))|\+)' + scope: keyword.operator.nix + - include: constants + - include: bad-reserved + - include: parameter-name + - include: others + function-body: + - match: '(@\s*([a-zA-Z\_][a-zA-Z0-9\_\''\-]*)\s*)?(\:)' + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: expression + function-body-from-colon: + - match: (\:) + captures: + 0: punctuation.definition.function.nix + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: expression + function-contents: + - include: bad-reserved + - include: function-parameter + - include: others + function-definition: + - match: (?=.?) + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: function-body-from-colon + - match: (?=.?) + push: + - match: (?=\:) + pop: true + - match: '(\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*)' + captures: + 0: variable.parameter.function.4.nix + push: + - match: (?=\:) + pop: true + - match: \@ + push: + - match: (?=\:) + pop: true + - include: function-header-until-colon-no-arg + - include: others + - include: others + - match: '(?=\{)' + push: + - match: (?=\:) + pop: true + - include: function-header-until-colon-with-arg + - include: others + function-definition-brace-opened: + - match: (?=.?) + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: function-body-from-colon + - match: (?=.?) + push: + - match: (?=\:) + pop: true + - include: function-header-close-brace-with-arg + - match: (?=.?) + push: + - match: '(?=\})' + pop: true + - include: function-contents + - include: others + function-for-sure: + - match: '(?=(\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*\s*[:@]|\{[^}]*\}\s*:|\{[^#}"''/=]*[,\?]))' + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: function-definition + function-header-close-brace-no-arg: + - match: '\}' + captures: + 0: punctuation.definition.entity.function.nix + push: + - match: (?=\:) + pop: true + - include: others + function-header-close-brace-with-arg: + - match: '\}' + captures: + 0: punctuation.definition.entity.function.nix + push: + - match: (?=\:) + pop: true + - include: function-header-terminal-arg + - include: others + function-header-open-brace: + - match: '\{' + captures: + 0: punctuation.definition.entity.function.2.nix + push: + - match: '(?=\})' + pop: true + - include: function-contents + function-header-terminal-arg: + - match: (?=@) + push: + - match: (?=\:) + pop: true + - match: \@ + push: + - match: (?=\:) + pop: true + - match: '(\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*)' + push: + - meta_scope: variable.parameter.function.3.nix + - match: (?=\:) + pop: true + - include: others + - include: others + function-header-until-colon-no-arg: + - match: '(?=\{)' + push: + - match: (?=\:) + pop: true + - include: function-header-open-brace + - include: function-header-close-brace-no-arg + function-header-until-colon-with-arg: + - match: '(?=\{)' + push: + - match: (?=\:) + pop: true + - include: function-header-open-brace + - include: function-header-close-brace-with-arg + function-parameter: + - match: (\.\.\.) + push: + - meta_scope: keyword.operator.nix + - match: '(,|(?=\}))' + pop: true + - include: others + - match: '\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*' + captures: + 0: variable.parameter.function.1.nix + push: + - match: '(,|(?=\}))' + captures: + 0: keyword.operator.nix + pop: true + - include: whitespace + - include: comment + - include: function-parameter-default + - include: expression + - include: others + function-parameter-default: + - match: \? + captures: + 0: keyword.operator.nix + push: + - match: "(?=[,}])" + pop: true + - include: expression + if: + - match: (?=\bif\b) + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - match: \bif\b + captures: + 0: keyword.other.nix + push: + - match: \bth(?=en\b) + captures: + 0: keyword.other.nix + pop: true + - include: expression + - match: (?<=th)en\b + captures: + 0: keyword.other.nix + push: + - match: \bel(?=se\b) + captures: + 0: keyword.other.nix + pop: true + - include: expression + - match: (?<=el)se\b + captures: + 0: keyword.other.nix + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + captures: + 0: keyword.other.nix + pop: true + - include: expression + illegal: + - match: . + scope: invalid.illegal + interpolation: + - match: '\$\{' + captures: + 0: punctuation.section.embedded.begin.nix + push: + - meta_scope: markup.italic + - match: '\}' + captures: + 0: punctuation.section.embedded.end.nix + pop: true + - include: expression + let: + - match: (?=\blet\b) + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - match: \blet\b + captures: + 0: keyword.other.nix + push: + - match: '(?=([\])};,]|\b(in|else|then)\b))' + pop: true + - match: '(?=\{)' + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - match: '\{' + push: + - match: '\}' + pop: true + - include: attrset-contents + - match: '(^|(?<=\}))' + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: expression-cont + - include: others + - include: attrset-contents + - include: others + - match: \bin\b + captures: + 0: keyword.other.nix + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: expression + list: + - match: '\[' + captures: + 0: punctuation.definition.list.nix + push: + - match: '\]' + captures: + 0: punctuation.definition.list.nix + pop: true + - include: expression + list-and-cont: + - match: '(?=\[)' + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: list + - include: expression-cont + operator-unary: + - match: (!|-) + scope: keyword.operator.unary.nix + others: + - include: whitespace + - include: comment + - include: illegal + parameter-name: + - match: '\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*' + captures: + 0: variable.parameter.name.nix + parameter-name-and-cont: + - match: '\b[a-zA-Z\_][a-zA-Z0-9\_\''\-]*' + captures: + 0: variable.parameter.name.nix + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: expression-cont + parens: + - match: \( + captures: + 0: punctuation.definition.expression.nix + push: + - match: \) + captures: + 0: punctuation.definition.expression.nix + pop: true + - include: expression + parens-and-cont: + - match: (?=\() + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: parens + - include: expression-cont + string: + - match: (?=\'\') + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - match: \'\' + captures: + 0: punctuation.definition.string.other.start.nix + push: + - meta_scope: string.quoted.other.nix + - match: \'\'(?!\$|\'|\\.) + captures: + 0: punctuation.definition.string.other.end.nix + pop: true + - match: \'\'(\$|\'|\\.) + scope: constant.character.escape.nix + - include: interpolation + - include: expression-cont + - match: (?=\") + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: string-quoted + - include: expression-cont + - match: '([a-zA-Z0-9\.\_\-\+]*(\/[a-zA-Z0-9\.\_\-\+]+)+)' + captures: + 0: string.unquoted.path.nix + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: expression-cont + - match: '(\<[a-zA-Z0-9\.\_\-\+]+(\/[a-zA-Z0-9\.\_\-\+]+)*\>)' + captures: + 0: string.unquoted.spath.nix + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: expression-cont + - match: '([a-zA-Z][a-zA-Z0-9\+\-\.]*\:[a-zA-Z0-9\%\/\?\:\@\&\=\+\$\,\-\_\.\!\~\*\'']+)' + captures: + 0: string.unquoted.url.nix + push: + - match: '(?=([\])};,]|\b(else|then)\b))' + pop: true + - include: expression-cont + string-quoted: + - match: \" + captures: + 0: punctuation.definition.string.double.start.nix + push: + - meta_scope: string.quoted.double.nix + - match: \" + captures: + 0: punctuation.definition.string.double.end.nix + pop: true + - match: \\. + scope: constant.character.escape.nix + - include: interpolation + whitespace: + - match: \s+ + with-assert: + - match: '(?{1,5})}' - scope: constant.character.escape.powershell - - match: '`u(?:\{[0-9a-fA-F]{,6}.)?' - scope: invalid.character.escape.powershell variable: - match: (\$)(?i:(False|Null|True))\b comment: These are special constants. @@ -359,10 +374,10 @@ contexts: 0: support.constant.variable.powershell 1: punctuation.definition.variable.powershell 3: variable.other.member.powershell - - match: '(\$)((?:[$^?])|(?i:_|Args|ConsoleFileName|Event|EventArgs|EventSubscriber|ForEach|Input|LastExitCode|Matches|MyInvocation|NestedPromptLevel|Profile|PSBoundParameters|PsCmdlet|PsCulture|PSDebugContext|PSItem|PSCommandPath|PSScriptRoot|PsUICulture|Pwd|Sender|SourceArgs|SourceEventArgs|StackTrace|Switch|This)\b)((?:\.(?:\p{L}|\d|_)+)*\b)?' + - match: '(\$)(?i:(\$|\^|\?|_|Args|ConsoleFileName|Event|EventArgs|EventSubscriber|ForEach|Input|LastExitCode|Matches|MyInvocation|NestedPromptLevel|Profile|PSBoundParameters|PsCmdlet|PsCulture|PSDebugContext|PSItem|PSCommandPath|PSScriptRoot|PsUICulture|Pwd|Sender|SourceArgs|SourceEventArgs|StackTrace|Switch|This))((?:\.(?:\p{L}|\d|_)+)*\b)?\b' comment: Automatic variables are not constants, but they are read-only. In monokai (default) color schema support.variable doesn't have color, so we use constant. captures: - 0: support.variable.automatic.powershell + 0: support.constant.automatic.powershell 1: punctuation.definition.variable.powershell 3: variable.other.member.powershell - match: '(\$)(?i:(ConfirmPreference|DebugPreference|ErrorActionPreference|ErrorView|FormatEnumerationLimit|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount|MaximumHistoryCount|MaximumVariableCount|OFS|OutputEncoding|ProgressPreference|PsCulture|PSDebugContext|PSDefaultParameterValues|PSEmailServer|PSItem|PSModuleAutoloadingPreference|PSSenderInfo|PSSessionApplicationName|PSSessionConfigurationName|PSSessionOption|VerbosePreference|WarningPreference|WhatIfPreference))((?:\.(?:\p{L}|\d|_)+)*\b)?\b' @@ -411,7 +426,7 @@ contexts: 0: support.constant.variable.powershell 1: punctuation.definition.variable.powershell 3: variable.other.member.powershell - - match: '(\$)((?:[$^?])|(?i:_|Args|ConsoleFileName|Event|EventArgs|EventSubscriber|ForEach|Input|LastExitCode|Matches|MyInvocation|NestedPromptLevel|Profile|PSBoundParameters|PsCmdlet|PsCulture|PSDebugContext|PSItem|PSCommandPath|PSScriptRoot|PsUICulture|Pwd|Sender|SourceArgs|SourceEventArgs|StackTrace|Switch|This)\b)' + - match: (\$)(?i:(\$|\^|\?|_|Args|ConsoleFileName|Event|EventArgs|EventSubscriber|ForEach|Input|LastExitCode|Matches|MyInvocation|NestedPromptLevel|Profile|PSBoundParameters|PsCmdlet|PsCulture|PSDebugContext|PSItem|PSCommandPath|PSScriptRoot|PsUICulture|Pwd|Sender|SourceArgs|SourceEventArgs|StackTrace|Switch|This))\b comment: Automatic variables are not constants, but they are read-only... captures: 0: support.variable.automatic.powershell @@ -423,7 +438,7 @@ contexts: 0: variable.language.powershell 1: punctuation.definition.variable.powershell 3: variable.other.member.powershell - - match: '(?i:(\$)(global|local|private|script|using|workflow):((?:\p{L}|\d|_)+))' + - match: '(?i:(\$|@)(global|local|private|script|using|workflow):((?:\p{L}|\d|_)+))' captures: 0: variable.other.readwrite.powershell 1: punctuation.definition.variable.powershell diff --git a/assets/syntaxes/Protobuf.sublime-syntax b/assets/syntaxes/Protobuf.sublime-syntax new file mode 100644 index 0000000..33bd693 --- /dev/null +++ b/assets/syntaxes/Protobuf.sublime-syntax @@ -0,0 +1,460 @@ +%YAML 1.2 +--- +# Syntax for Protocol Buffer definition files. +# Works with proto2 and proto3. +# See official Protobuff documentation at https://developers.google.com/protocol-buffers/docs/proto3 +# +# Authors: Jiarong Wei, Raul Rangel & Guillaume Wenzek +# +# .sublime-syntax reference: http://www.sublimetext.com/docs/3/syntax.html +name: Protocol Buffer +file_extensions: + - proto + - protodevel +scope: source.proto + +first_line_match: '^(syntax)\s*(=)\s*("proto\d")\s*(;)\s*$' + +variables: + ident: '\b([A-Za-z][A-Za-z0-9_]*)\b' + +contexts: + prototype: + - include: comments + + main: + - include: syntax + - include: package + - include: import + - include: option + - include: enum + - include: message + - include: extend + - include: service + + # This is proto1 syntax which is deprecated, only providing minimal support. + - match: '\b(parsed)?\s*(class)\s+{{ident}}\s+{' + scope: meta.parsed.message.proto + captures: + 1: storage.modifier.proto + 2: storage.type.message.proto + 3: entity.name.class.proto + push: + - match: '}' + pop: true + - include: message_body + # Groups are deprecated, only providing minimal support. + - match: '\b(group)\s+{{ident}}\s+=\s+(\d+)\s+{' + scope: meta.group.proto + captures: + 1: storage.type.proto invalid.deprecated.group.proto + 2: variable.other.field.proto + 3: constant.numeric.proto + push: + - match: '}' + pop: true + - include: message_body + + +# Comments + comments: + - match: // + scope: punctuation.definition.comment.begin.proto + push: + - meta_scope: comment.line.proto + - match: '$' + pop: true + - match: /\* + scope: punctuation.definition.comment.proto + push: + - meta_scope: comment.block.proto + - match: \*/ + scope: punctuation.definition.comment.proto + pop: true + + +# Others + or_pop: + # Pop when seeing unexpected characters. + - match: '(?=\S)' + pop: true + + field_name_or_pop: + - match: '{{ident}}' + scope: variable.other.field.proto + pop: true + - include: or_pop + + one_liner: + - match: ; + scope: punctuation.terminator.proto + pop: true + - match: $ + pop: true + + semicolon_or_pop: + - match: ';' + captures: + 0: punctuation.terminator.proto + pop: true + - include: or_pop + + assignment_or_pop: + - match: '=' + scope: keyword.operator.assignment.proto + pop: true + - include: or_pop + + +# Syntax + syntax: + - match: '^\s*(syntax)\s*(=)' + captures: + 1: keyword.other.syntax.proto + 2: keyword.operator.assignment.proto + push: + - include: string + - include: one_liner + + +# Import + import: + - match: '\b(import)\b\s*(weak|public)?\b' + captures: + 1: keyword.other.import.proto + 2: storage.modifier.proto + push: + - include: string + - include: one_liner + + +# Package + package: + - match: \b(package)\b + scope: keyword.other.namespace.proto + push: + - match: '{{ident}}(\.)' + captures: + 1: variable.namespace.proto + 2: punctuation.separator.namespace.proto + - match: '{{ident}}' + scope: entity.name.namespace.proto + - include: one_liner + + +# Option + option: + - match: '\b(option)\b' + scope: storage.type.annotation.proto + push: + - match: ';' + scope: punctuation.terminator.option.proto + pop: true + - include: option_inline + - include: or_pop + + option_inline: + - match: '{{ident}}' + scope: variable.annotation.proto + - include: full_option_name + - match: = + scope: keyword.operator.assignment.proto + push: option_value + + full_option_name: + - match: \( + scope: punctuation.definition.name.option.begin.proto + push: + - match: (\))(?:(\.){{ident}})? + captures: + 1: punctuation.definition.name.option.end.proto + 2: punctuation.accessor.proto + 3: variable.annotation.proto + pop: true + - match: '{{ident}}(\.)' + captures: + 1: variable.namespace.proto + 2: punctuation.accessor.proto + - match: '{{ident}}' + scope: variable.annotation.proto + + +# Message + message: + - match: '\b(message)\b\s*{{ident}}' + captures: + 1: storage.type.message.proto + 2: entity.name.class.proto + push: + - meta_scope: meta.class.proto + - match: '{' + scope: punctuation.definition.block.message.begin.proto + set: message_body + - include: or_pop + + message_body: + - meta_scope: meta.class.proto + - match: '}' + scope: punctuation.definition.block.message.end.proto + pop: true + - include: option + - include: message + - include: extend + - include: oneof + - include: enum + - include: reserved + - include: field + + field: + - match: '\b(optional|required|repeated)\b' + captures: + 1: storage.modifier.proto + push: [ field_end_or_pop, field_name_or_pop, message_type_or_pop ] + - match: '\b(map)\b\s*\b(<)' + captures: + 1: support.type.map.proto + 2: punctuation.definition.map.begin.proto + push: [ field_end_or_pop, field_name_or_pop, map_type ] + # field are assumed 'optional' by default in proto3. + - match: '(?={{ident}})' + push: [ field_end_or_pop, field_name_or_pop, message_type_or_pop ] + +# Enum + enum: + - match: '\b(enum)\b\s*{{ident}}' + captures: + 1: storage.type.enum.proto + 2: entity.name.enum.proto + push: + - meta_scope: meta.enum.proto + - match: '{' + scope: punctuation.definition.block.enum.begin.proto + set: enum_body + - include: or_pop + + enum_body: + - meta_scope: meta.enum.proto + - match: '}' + scope: punctuation.definition.block.enum.end.proto + pop: true + - include: option + - match: '{{ident}}' + scope: constant.other.enum.proto + push: + - semicolon_or_pop + - field_attributes_or_pop + - number_or_pop + - assignment_or_pop + + +# Extend + extend: + - match: '\b(extend)\b' + scope: storage.modifier.extend.proto + push: [ extend_body_or_pop, message_type_or_pop] + + extend_body_or_pop: + - match: '{' + scope: punctuation.definition.block.extend.begin.proto + set: + - meta_scope: meta.extend.body.proto + - match: '}' + scope: punctuation.definition.block.extend.end.proto + pop: true + - include: message_body + - include: or_pop + + +# Oneof + oneof: + - match: '\b(oneof)\b\s*{{ident}}' + captures: + 1: storage.modifier.oneof.proto + 2: entity.name.member.proto + push: + - meta_scope: meta.oneof.proto + - match: '{' + scope: punctuation.definition.block.oneof.begin.proto + set: oneof_body + - include: or_pop + + oneof_body: + - match: '}' + scope: punctuation.definition.block.oneof.end.proto + pop: true + - match: '(?=\S)' + push: [ field_end_or_pop, field_name_or_pop, message_type_or_pop ] + + +# Service + service: + - match: '\b(service)\b\s*{{ident}}' + captures: + 1: storage.type.service.proto + 2: entity.name.class.proto + push: + - meta_scope: meta.service.proto + - match: '{' + scope: punctuation.definition.block.service.begin.proto + set: + - meta_scope: meta.service.proto + - match: '}' + scope: punctuation.definition.block.service.end.proto + pop: true + - include: option + - include: rpc + - include: or_pop + + +# Rpc + rpc: + - match: '\b(rpc)\b\s*{{ident}}' + captures: + 1: storage.type.rpc.proto + 2: entity.name.function.rpc.proto + push: [rpc_body, rpc_param, rpc_returns, rpc_param] + + rpc_returns: + - match: returns + scope: keyword.other.returns.proto + pop: true + + rpc_param: + - match: \( + scope: punctuation.definition.parameter.rpc.begin.proto + set: + - match: \) + scope: punctuation.definition.parameter.rpc.end.proto + pop: true + - match: '\bstream\b' + scope: storage.modifier.proto + - match: (?=\S) + push: message_type_or_pop + + rpc_body: + - match: '{' + scope: punctuation.definition.block.rpc.begin.proto + set: + - meta_scope: meta.rpc.body.proto + - match: '}' + scope: punctuation.definition.block.rpc.end.proto + pop: true + - include: option + - match: ; + scope: punctuation.terminator.proto + pop: true + - include: or_pop + + +# Reserved + reserved: + - match: '\b(reserved)\b' + scope: storage.modifier.proto + push: + - include: numeric_range + - include: string + - match: '\b(extensions)\b' + scope: storage.modifier.proto + push: numeric_range + + numeric_range: + - match: \d+ + scope: constant.numeric.proto + - match: max + scope: constant.language.proto + - match: ',' + scope: punctuation.separator.proto + - match: to + scope: keyword.other.to.proto + - match: ';' + scope: punctuation.terminator.proto + pop: true + + field_end_or_pop: + - match: '' + set: + - semicolon_or_pop + - field_attributes_or_pop + - number_or_pop + - assignment_or_pop + + field_attributes_or_pop: + - match: '\[' + scope: punctuation.definition.attributes.begin.proto + set: + - meta_scope: meta.field.attributes.proto + - match: \b(default|deprecated|packed)\b + scope: support.function.proto + - match: \, + scope: punctuation.separator.option.proto + - match: '\]' + scope: punctuation.definition.attributes.end.proto + pop: true + - include: option_inline + - include: or_pop + + +# Values + option_value: + # Reuse prototxt syntax to parse embedded literal or protos. + - match: '{' + scope: punctuation.definition.block.option.begin.proto + push: + - meta_scope: meta.embedded.prototxt + - match: '}' + scope: punctuation.definition.block.option.end.proto + pop: true + - include: scope:text.prototxt + - include: scope:text.prototxt#field_value_or_pop + + number_or_pop: + - match: \d+ + scope: constant.numeric.proto + pop: true + - include: or_pop + + string: + - match: '"' + scope: punctuation.definition.string.begin.proto + push: + - meta_scope: string.quoted.double.proto + - meta_include_prototype: false + - match: '\\"' + scope: constant.character.escape.proto + - match: '"' + scope: punctuation.definition.string.end.proto + pop: true + - match: (?=$) # pop if string is malformed. + pop: true + + +# All types + message_type_or_pop: + # see documentation for the list of base types: + # https://developers.google.com/protocol-buffers/docs/proto#scalar + - match: '(double|float|bool|string|bytes)' + scope: support.type.proto + pop: true + - match: '(u|s)?int(32|64)' + scope: support.type.proto + pop: true + - match: 's?fixed(32|64)' + scope: support.type.proto + pop: true + - match: '{{ident}}(\.)' + captures: + 1: variable.namespace.proto + 2: punctuation.accessor.proto + - match: '{{ident}}' + # TODO: Use the convention decided in https://github.com/sublimehq/Packages/issues/582 + scope: storage.type.proto variable.type.proto + pop: true + + map_type: + - match: ',' + scope: punctuation.separator.map.proto + - match: '>' + scope: punctuation.definition.map.end.proto + pop: true + - match: '(?={{ident}})' + push: message_type_or_pop diff --git a/assets/syntaxes/ProtobufText.sublime-syntax b/assets/syntaxes/ProtobufText.sublime-syntax new file mode 100644 index 0000000..4462d04 --- /dev/null +++ b/assets/syntaxes/ProtobufText.sublime-syntax @@ -0,0 +1,186 @@ +%YAML 1.2 +--- +# Syntax for Protocol Buffer serialized as human readable text. +# Works with proto2 and proto3. +# See official Protobuff documentation at https://developers.google.com/protocol-buffers/docs/proto3 +# +# Author: Raul Rangel & Guillaume Wenzek +# +# .sublime-syntax reference: http://www.sublimetext.com/docs/3/syntax.html +name: Protocol Buffer (TEXT) +file_extensions: + - pb.txt + - proto.text + - textpb + - pbtxt + - prototxt +scope: text.prototxt +variables: + stringEscape: '(?:\\(?:[''"\\/abfnrtv?]|[0-9]{3}|(?i:u|x)[0-9A-Fa-f]+))' + field_name: '\b([A-Za-z][A-Za-z0-9_]*)\b' + integer: '(?:\+|-)?(?:0|[1-9]\d*)' + exp: '(?i:e(?:\+|-)?{{integer}})' + +contexts: + prototype: + - include: comments + + or_pop: + # Pop if nothing matched (whitespace are ignored). + - match: '(?=\S)' + pop: true + + main: + - include: field + + comments: + - match: '#' + scope: punctuation.definition.comment.begin.prototxt + push: + - meta_scope: comment.line.prototxt + - match: '$' + pop: true + + field: + - match: '{{field_name}}' + scope: variable.other.member.prototxt + push: field_sep_or_pop + - match: \[ + scope: punctuation.definition.field_name.begin.prototxt + push: + - match: \] + set: field_sep_or_pop + scope: punctuation.definition.field_name.end.prototxt + - match: '{{field_name}}(\.)' + captures: + 1: variable.other.namespace.prototxt + 2: punctuation.accessor.prototxt + - match: '{{field_name}}' + scope: variable.other.member.prototxt + + field_sep_or_pop: + - match: '(:)|(?=\{|<)' + scope: punctuation.separator.key-value.prototxt + set: [comma_or_pop, field_value_or_pop] + - include: or_pop + + field_value_or_pop: + - match: '{' + scope: punctuation.definition.dictionary.begin.prototxt + set: + - meta_scope: meta.message.prototxt + - match: '}' + scope: punctuation.definition.dictionary.end.prototxt + pop: true + - include: field + - match: '<' + scope: punctuation.definition.dictionary.begin.prototxt + set: + - meta_scope: meta.message.prototxt + - match: '>' + scope: punctuation.definition.dictionary.end.prototxt + pop: true + - include: field + - include: constant + - include: string_double_multiline + - include: string_single_multiline + - include: enum_value + - include: number + - include: array + - include: or_pop + + array: + - match: '\[' + scope: punctuation.definition.array.begin.prototxt + set: + - match: '\]' + scope: punctuation.definition.array.end.prototxt + pop: true + - match: \, + scope: punctuation.separator.array.prototxt + - match: (?=\S) + push: field_value_or_pop + + comma_or_pop: + - match: ',' + scope: punctuation.separator.prototxt + pop: true + - include: or_pop + + constant: + - match: \b(true|True|t|false|False|f)\b + scope: constant.language.prototxt + pop: true + - match: (\+|-)?\b(?i:inf|infinity)\b + scope: constant.language.prototxt + pop: true + - match: \b(?i:nan)\b + scope: constant.language.prototxt + pop: true + + number: + - match: |- + (?xi: + {{integer}}?\.\d+{{exp}}?(f?) # literal with a dot: .3 .3e+4 1.3 1.3f + |{{integer}}(f) # literal with a 'f': 1f + |{{integer}}{{exp}}(f?) # literal with an exp: .3e+4 1e-3 1e3f + )\b + scope: constant.numeric.float.prototxt + captures: + 1: punctuation.definition.numeric.float.prototxt + 2: punctuation.definition.numeric.float.prototxt + 3: punctuation.definition.numeric.float.prototxt + pop: true + - match: '{{integer}}\b' + scope: constant.numeric.integer.prototxt + pop: true + - match: '(0)[0-8]+\b' + scope: constant.numeric.octal.prototxt + captures: + 1: punctuation.definition.numeric.octal.prototxt + pop: true + - match: '(0[xX])[0-9A-Fa-f]+\b' + scope: constant.numeric.hex.prototxt + captures: + 1: punctuation.definition.numeric.hex.prototxt + pop: true + + enum_value: + - match: '{{field_name}}' + scope: constant.numeric.enum.prototxt + pop: true + + string_double_multiline: + - match: '"' + scope: punctuation.definition.string.begin.prototxt + set: + - meta_scope: string.quoted.double.prototxt + - meta_include_prototype: false + - match: '{{stringEscape}}' + scope: constant.character.escape.prototxt + - match: \\. + scope: invalid.illegal.unrecognized-string-escape.prototxt + - match: '"' + scope: punctuation.definition.string.end.prototxt + set: + - include: string_double_multiline + - include: or_pop + + string_single_multiline: + - match: "'" + scope: punctuation.definition.string.quoted.single.begin.prototxt + set: + - meta_scope: string.quoted.single.prototxt + - meta_include_prototype: false + # Note that technically "bytes" field main don't respect escapes, + # but there is no way to know if the given string will be interpreted as + # "bytes". + - match: '{{stringEscape}}' + scope: constant.character.escape.prototxt + - match: \\. + scope: invalid.illegal.unrecognized-string-escape.prototxt + - match: "'" + scope: punctuation.definition.string.quoted.single.end.prototxt + set: + - include: string_single_multiline + - include: or_pop diff --git a/assets/syntaxes/Robot.sublime-syntax b/assets/syntaxes/Robot.sublime-syntax new file mode 100644 index 0000000..85e4f6d --- /dev/null +++ b/assets/syntaxes/Robot.sublime-syntax @@ -0,0 +1,54 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: Robot Framework syntax highlighting. +file_extensions: + - robot +scope: source.robot +contexts: + main: + - match: '\$\{(\d+|\d+\.\d*|0[bB][01]+|0[oO][0-7]+|0[xX][0-9a-fA-F]+)\}' + comment: "Robot Framework numbers, like ${1} or ${12.3}" + scope: constant.numeric.robot + - match: '(?i)(%\{[\w|\s]+\})' + comment: "Robot Framework environment variable, like %{USER}" + scope: variable.parameter.robot + - match: '((?&|\^~.])(\+|\-|\*|\/)(?![/=\-+!*%<>&|\^~.])' + scope: keyword.operator.arithmetic.swift + array-type: + - match: \b(Array)(<) + captures: + 1: support.type.array.swift + 2: punctuation.array.begin.swift + push: + - meta_scope: meta.array.swift + - match: (>) + captures: + 1: punctuation.array.end.swift + pop: true + - include: main + assignment-operator: + - match: '(?&|\^~.])(\+|\-|\*|\/|%|<<|>>|&|\^|\||&&|\|\|)?=(?![/=\-+!*%<>&|\^~.])' + scope: keyword.operator.assignment.swift + attribute: + - match: '((@)(\B\$[0-9]+|\b[\w^\d][\w\d]*\b|\B`[\w^\d][\w\d]*`\B))(\()' + captures: + 1: storage.modifier.attribute.swift + 2: punctuation.definition.attribute.swift + 3: punctuation.definition.attribute-arguments.begin.swift + push: + - meta_content_scope: meta.attribute.arguments.swift + - match: \) + captures: + 0: punctuation.definition.attribute-arguments.end.swift + pop: true + - include: main + - match: '((@)(\B\$[0-9]+|\b[\w^\d][\w\d]*\b|\B`[\w^\d][\w\d]*`\B))' + captures: + 1: storage.modifier.attribute.swift + 2: punctuation.definition.attribute.swift + bitwise-operator: + - match: '(?&|\^~.])(&|\||\^|<<|>>)(?![/=\-+!*%<>&|\^~.])' + scope: keyword.operator.bitwise.swift + block-comment: + - match: /\* + comment: Block comment + captures: + 0: punctuation.definition.comment.block.begin.swift + push: + - meta_scope: comment.block.swift + - match: \*/ + captures: + 0: punctuation.definition.comment.block.end.swift + pop: true + boolean: + - match: \b(true|false)\b + scope: keyword.constant.boolean.swift + branch-statement-keyword: + - include: if-statement-keyword + - include: switch-statement-keyword + catch-statement-keyword: + - match: \b(catch|do)\b + comment: catch-statement + scope: kewyord.control.catch.swift + code-block: + - match: '(\{)' + comment: code-block + captures: + 1: punctuation.definition.code-block.begin.swift + push: + - match: '(\})' + captures: + 1: punctuation.definition.code-block.end.swift + pop: true + - include: main + collection-type: + - include: array-type + - include: dictionary-type + - match: \b(Array|Dictionary)\b + scope: support.type.swift + comparative-operator: + - match: '(?&|\^~.])((=|!)==?|(<|>)=?|~=)(?![/=\-+!*%<>&|\^~.])' + scope: keyword.operator.comparative.swift + control-transfer-statement-keyword: + - match: \b(continue|break|fallthrough|return)\b + comment: control-transfer-statement + scope: keyword.control.transfer.swift + custom-operator: + - match: '(?<=[\s(\[{,;:])([/=\-+!*%<>&|\^~.]++)(?![\s)\]},;:])' + scope: keyword.operator.custom.prefix.unary.swift + - match: '(?&|\^~.]++)(?![\s)\]},;:\.])' + scope: keyword.operator.custom.postfix.unary.swift + - match: '(?<=[\s(\[{,;:])([/=\-+!*%<>&|\^~.]++)(?=[\s)\]},;:])' + scope: keyword.operator.custom.binary.swift + declaration: + - include: import-declaration + - include: function-declaration + declaration-modifier: + - match: \b(class|convenience|dynamic|final|lazy|(non)?mutating|optional|override|required|static|unowned((un)?safe)?|weak)\b + comment: declaration-modifier + scope: keyword.other.declaration-modifier.swift + dictionary-type: + - match: \b(Dictionary)(<) + captures: + 1: support.type.dictionary.swift + 2: punctuation.dictionary.begin.swift + push: + - meta_scope: meta.dictionary.swift + - match: (>) + captures: + 1: punctuation.dictionary.end.swift + pop: true + - include: main + documentation-comment: + - match: /\*\* + comment: Documentation comment + captures: + 0: punctuation.definition.comment.block.documentation.begin.swift + push: + - meta_scope: comment.block.documentation.swift + - match: \*/ + captures: + 0: punctuation.definition.comment.block.documentation.end.swift + pop: true + floating-point-literal: + - match: '\b([0-9][0-9_]*)(\.([0-9][0-9_]*))?([eE][+\-]?([0-9][0-9_]*))?\b' + comment: floating-point-literal -> (decimal-literal)(decimal-fraction)?(decimal-exponent)? + - match: '\b(0x\h[\h_]*)(\.(0x\h[\h_]*))?([pP][+\-]?(0x\h[\h_]*))\b' + comment: floating-point-literal -> (hexadecimal-literal)(hexadecimal-fraction)?(hexadecimal-exponent) + function-body: + - include: code-block + function-declaration: + - match: '\b(func)\s+(\B\$[0-9]+|\b[\w^\d][\w\d]*\b|\B`[\w^\d][\w\d]*`\B|[/=\-+!*%<>&|\^~.]+)\s*(?=\(|<)' + comment: function-declaration + captures: + 1: storage.type.function.swift + 2: entity.type.function.swift + push: + - meta_scope: meta.function-declaration.swift + - match: '(?<=\})' + pop: true + - include: generic-parameter-clause + - include: parameter-clause + - include: function-result + - include: function-body + function-result: + - match: '(?&|\^~.])(\->)(?![/=\-+!*%<>&|\^~.])\s*' + comment: function-result + captures: + 1: keyword.operator.function-result.swift + push: + - meta_scope: meta.function-result.swift + - match: '\s*(?=\{)' + pop: true + - include: type + generic-parameter-clause: + - match: (<) + comment: generic-parameter-clause + captures: + 1: punctuation.definition.generic-parameter-clause.begin.swift + push: + - meta_scope: meta.generic-parameter-clause.swift + - match: (>) + captures: + 1: punctuation.definition.generic-parameter-clause.end.swift + pop: true + - include: main + identifier: + - match: '(\B\$[0-9]+|\b[\w^\d][\w\d]*\b|\B`[\w^\d][\w\d]*`\B)' + comment: identifier + scope: meta.identifier.swift + if-statement-keyword: + - match: \b(if|else)\b + comment: if-statement + scope: keyword.control.if.swift + import-declaration: + - match: '\b(import)\s+(?:(typealias|struct|class|enum|protocol|var|func)\s+)?((?:\B\$[0-9]+|\b[\w^\d][\w\d]*\b|\B`[\w^\d][\w\d]*`\B|[/=\-+!*%<>&|\^~.]+)(?:\.(?:\B\$[0-9]+|\b[\w^\d][\w\d]*\b|\B`[\w^\d][\w\d]*`\B|[/=\-+!*%<>&|\^~.]+))*)' + comment: import-declaration + scope: meta.import.swift + captures: + 1: keyword.other.import.swift + 2: storage.modifier.swift + 3: support.type.module.import.swift + in-line-comment: + - match: (//).* + comment: In-line comment + scope: comment.line.double-slash.swift + captures: + 1: punctuation.definition.comment.line.double-slash.swift + increment-decrement-operator: + - match: '(?&|\^~.])(\+\+|\-\-)(?![/=\-+!*%<>&|\^~.])' + scope: keyword.operator.increment-or-decrement.swift + integer-literal: + - match: '(\B\-|\b)(0b[01][01_]*)\b' + comment: binary-literal + scope: constant.numeric.integer.binary.swift + - match: '(\B\-|\b)(0o[0-7][0-7_]*)\b' + comment: octal-literal + scope: constant.numeric.integer.octal.swift + - match: '(\B\-|\b)([0-9][0-9_]*)\b' + comment: decimal-literal + scope: constant.numeric.integer.decimal.swift + - match: '(\B\-|\b)(0x\h[\h_]*)\b' + comment: hexadecimal-literal + scope: constant.numeric.integer.hexadecimal.swift + integer-type: + - match: \bU?Int(8|16|32|64)?\b + comment: Int types + scope: support.type.swift + keyword: + - include: branch-statement-keyword + - include: control-transfer-statement-keyword + - include: loop-statement-keyword + - include: catch-statement-keyword + - include: operator-declaration-modifier + - include: declaration-modifier + - include: access-level-modifier + - match: \b(class|deinit|enum|extension|func|import|init|let|protocol|static|struct|subscript|typealias|var|throws|rethrows)\b + comment: declaration keyword + scope: keyword.declaration.swift + - match: \b(break|case|continue|default|do|else|fallthrough|if|in|for|return|switch|where|while|repeat|catch|guard|defer|try|throw)\b + comment: statement keyword + scope: keyword.statement.swift + - match: \b(as|dynamicType|is|new|super|self|Self|Type)\b + comment: expression and type keyword + scope: keyword.other.statement.swift + - match: \b(associativity|didSet|get|infix|inout|left|mutating|none|nonmutating|operator|override|postfix|precedence|prefix|right|set|unowned((un)?safe)?|weak|willSet)\b + comment: other keyword + scope: keyword.other.swift + literal: + - include: integer-literal + - include: floating-point-literal + - include: nil-literal + - include: string-literal + - include: special-literal + logical-operator: + - match: '(?&|\^~.])(!|&&|\|\|)(?![/=\-+!*%<>&|\^~.])' + scope: keyword.operator.logical.swift + loop-statement-keyword: + - match: \b(while|repeat|for|in)\b + comment: loop-statement + scope: keyword.control.loop.swift + nil-literal: + - match: \bnil\b + comment: nil-literal + scope: constant.nil.swift + operator: + - include: comparative-operator + - include: assignment-operator + - include: logical-operator + - include: remainder-operator + - include: increment-decrement-operator + - include: overflow-operator + - include: range-operator + - include: bitwise-operator + - include: arithmetic-operator + - include: ternary-operator + - include: type-casting-operator + - include: custom-operator + operator-declaration-modifier: + - match: \b(operator|prefix|infix|postfix)\b + comment: operator-declaration + scope: keyword.other.operator.swift + optional-type: + - match: \b(Optional)(<) + scope: meta.optional.swift + overflow-operator: + - match: '(?&|\^~.])\&(\+|\-|\*|\/|%)(?![/=\-+!*%<>&|\^~.])' + scope: keyword.operator.overflow.swift + parameter-clause: + - match: (\() + comment: parameter-clause + captures: + 1: punctuation.definition.function-arguments.begin.swift + push: + - meta_scope: meta.parameter-clause.swift + - match: (\)) + captures: + 1: punctuation.definition.function-arguments.end.swift + pop: true + - include: main + primitive-type: + - match: \b(Int|Float|Double|String|Bool|Character|Void)\b + comment: Primitive types + scope: support.type.swift + protocol-composition-type: + - match: \b(protocol)(<) + scope: meta.protocol.swift + range-operator: + - match: '(?&|\^~.])\.\.(?:\.)?(?![/=\-+!*%<>&|\^~.])' + scope: keyword.operator.range.swift + remainder-operator: + - match: '(?&|\^~.])\%(?![/=\-+!*%<>&|\^~.])' + scope: keyword.operator.remainder.swift + shebang-line: + - match: ^(#!).*$ + comment: Shebang line + scope: comment.line.shebang.swift + captures: + 1: punctuation.definition.comment.line.shebang.swift + special-literal: + - match: \b__(FILE|LINE|COLUMN|FUNCTION)__\b + scope: keyword.other.literal.swift + storage-type: + - match: \b(var|func|let|class|enum|struct|protocol|extension|typealias)\b + scope: storage.type.swift + string-literal: + - match: \" + captures: + 0: string.quoted.double.swift + push: + - meta_scope: meta.literal.string.swift + - match: \" + captures: + 0: string.quoted.double.swift + pop: true + - match: '\\([0tnr\"\''\\]|x\h{2}|u\h{4}|U\h{8})' + scope: constant.character.escape.swift + - match: (\\\() + captures: + 1: support.punctuation.expression.begin.swift + push: + - meta_content_scope: meta.expression.swift + - match: (\)) + captures: + 1: support.punctuation.expression.end.swift + pop: true + - include: scope:source.swift + - match: (\"|\\) + scope: invalid.illegal.swift + - match: (.) + scope: string.quoted.double.swift + switch-statement-keyword: + - match: \b(switch|case|default|where)\b + comment: switch-statement + scope: keyword.control.switch.swift + ternary-operator: + - match: '(?<=[\s(\[{,;:])(\?|:)(?=[\s)\]},;:])' + scope: keyword.operator.ternary.swift + type: + - include: primitive-type + - include: integer-type + - include: collection-type + - include: optional-type + - include: protocol-composition-type + type-casting-operator: + - match: \b(is\b|as(\?\B|\b)) + scope: keyword.operator.type-casting.swift diff --git a/assets/syntaxes/TOML.sublime-syntax b/assets/syntaxes/TOML.sublime-syntax new file mode 100644 index 0000000..101cdaa --- /dev/null +++ b/assets/syntaxes/TOML.sublime-syntax @@ -0,0 +1,401 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: TOML + +file_extensions: + - toml + - tml + - Cargo.lock + - Gopkg.lock + - Pipfile + +scope: source.toml + +variables: + ws: '[ \t]*' + wsnl: '([ \t\n])*' + + # Used to detect the possible start of a key. + peek_key_start: '(?=[A-Za-z0-9_''"-])' + dot_peek_key: '{{ws}}(\.){{ws}}{{peek_key_start}}' + + # integer = [ "-" / "+" ] int + # int = DIGIT / digit1-9 1*( DIGIT / "_" DIGIT ) + integer: '([\+\-]?) (?: [0-9] | [1-9] (?: [0-9] | _ [0-9] )+ )' + + HEXDIG: '[0-9A-Fa-f]' + hex_int: '0x{{HEXDIG}}(?:{{HEXDIG}}|_{{HEXDIG}})*' + oct_int: '0o[0-7](?:[0-7]|_[0-7])*' + bin_int: '0b[0-1](?:[0-1]|_[0-1])*' + + # frac = "." DIGIT *( DIGIT / "_" DIGIT ) + frac: '\. [0-9] (?: [0-9] | _ [0-9] )*' + # exp = ("e" / "E") integer + exp: '[eE] {{integer}}' + + # date-time = offset-date-time / local-date-time / local-date / local-time + date_time: '{{offset_date_time}} | {{local_date_time}} | {{local_date}} | {{local_time}}' + # date-fullyear = 4DIGIT + date_fullyear: '[0-9]{4}' + # date-month = 2DIGIT ; 01-12 + date_month: '[0-1][0-9]' + # date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on month/year + date_mday: '[0-3][0-9]' + # time-hour = 2DIGIT ; 00-23 + time_hour: '[0-2][0-9]' + # time-minute = 2DIGIT ; 00-59 + time_minute: '[0-5][0-9]' + # time-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second rules + time_second: '[0-6][0-9]' + # time-secfrac = "." 1*DIGIT + time_secfrac: '\.[0-9]+' + # time-numoffset = ( "+" / "-" ) time-hour ":" time-minute + time_numoffset: '[+-] {{time_hour}} : {{time_minute}}' + # time-offset = "Z" / time-numoffset + time_offset: '(?: Z | {{time_numoffset}} )' + # partial-time = time-hour ":" time-minute ":" time-second [time-secfrac] + partial_time: '{{time_hour}} : {{time_minute}} : {{time_second}} (?: {{time_secfrac}} )?' + # full-date = date-fullyear "-" date-month "-" date-mday + full_date: '{{date_fullyear}} - {{date_month}} - {{date_mday}}' + # full-time = partial-time time-offset + full_time: '{{partial_time}} {{time_offset}}' + # offset-date-time = full-date T|%20 full-time + offset_date_time: '{{full_date}} [T ] {{full_time}}' + # local-date-time = full-date T|%20 partial-time + local_date_time: '{{full_date}} [T ] {{partial_time}}' + # local-date = full-date + local_date: '{{full_date}}' + # local-time = partial-time + local_time: '{{partial_time}}' + +contexts: + main: + - match: '^{{ws}}' + # Ignore leading whitespace for all expressions. + - include: comments + - include: tables + - include: keyval + - include: illegal + + illegal: + - match: (.*) + # Invalid things -> everything unmatched + captures: + 1: invalid.illegal.toml + + comments: + - match: '{{ws}}((#).*)' + captures: + 1: comment.line.number-sign.toml + 2: punctuation.definition.comment.toml + + data-types: + - include: inline-table + - include: array + - include: string + - include: date-time + - include: float + - include: integer + - include: boolean + - match: '{{ws}}$' + # Don't show an incomplete line as invalid to avoid frequent red + # highlighting while typing. + pop: true + - match: '\w+|.' + scope: invalid.illegal.value.toml + pop: true + + boolean: + - match: (true|false) + captures: + 1: constant.language.toml + pop: true + + integer: + - match: |- + (?x) + (?\s*<<(\w+)) + captures: + 0: punctuation.definition.string.begin.terraform + 1: keyword.operator.heredoc.terraform + push: + - meta_scope: string.unquoted.heredoc.terraform + - match: ^\s*\1$ + captures: + 0: punctuation.definition.string.end.terraform keyword.operator.heredoc.terraform + pop: true + string_interpolation: + - match: '\$\{' + captures: + 0: entity.tag.embedded.start.terraform + push: + - meta_scope: source.terraform.embedded.source + - match: '\}' + captures: + 0: entity.tag.embedded.end.terraform + pop: true + - include: main + - include: string_interpolation_functions + - include: string_interpolation_keywords + - match: (\.) + captures: + 0: keyword.control.period.terraform + - include: strings + string_interpolation_functions: + - match: (base64decode|base64encode|base64gzip|base64sha256|base64sha512|basename|bcrypt|ceil|chomp|cidrhost|cidrnetmask|cidrsubnet|coalesce|coalescelist|compact|concat|contains|dirname|distinct|element|file|flatten|floor|format|formatlist|index|join|jsonencode|keys|length|list|log|lookup|lower|map|matchkeys|max|md5|merge|min|pathexpand|pow|replace|sha1|sha256|sha512|signum|slice|sort|split|substr|timestamp|title|trimspace|upper|urlencode|uuid|values|zipmap)(\() + comment: Builtin functions + captures: + 1: keyword.other.function.inline.terraform + 2: keyword.other.section.begin.terraform + push: + - match: (\)) + captures: + 1: keyword.other.section.end.terraform + pop: true + - include: string_interpolation_functions + - include: string_interpolation_keywords + string_interpolation_keywords: + - match: '(terraform|var|self|count|module|path|data|local)(\.[\w\*]+)+' + captures: + 0: entity.other.attribute-name.terraform + strings: + - match: \" + comment: Strings + captures: + 0: string.terraform punctuation.definition.string.begin.terraform + push: + - match: \" + captures: + 0: string.terraform punctuation.definition.string.end.terraform + pop: true + - include: string_interpolation + - match: '([\w\-\/\._\\%]+)' + scope: string.quoted.double.terraform diff --git a/assets/syntaxes/TypeScript.sublime-syntax b/assets/syntaxes/TypeScript.sublime-syntax new file mode 100644 index 0000000..75a6c2a --- /dev/null +++ b/assets/syntaxes/TypeScript.sublime-syntax @@ -0,0 +1,3027 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: TypeScript +file_extensions: + - ts +scope: source.ts +contexts: + main: + - include: directives + - include: statements + - match: \A(#!).*(?=$) + scope: comment.line.shebang.ts + captures: + 1: punctuation.definition.comment.ts + comment: + - match: /\*\*(?!/) + captures: + 0: punctuation.definition.comment.ts + push: + - meta_scope: comment.block.documentation.ts + - match: \*/ + captures: + 0: punctuation.definition.comment.ts + pop: true + - include: docblock + - match: (/\*)(?:\s*((@)internal)(?=\s|(\*/)))? + captures: + 1: punctuation.definition.comment.ts + 2: storage.type.internaldeclaration.ts + 3: punctuation.decorator.internaldeclaration.ts + push: + - meta_scope: comment.block.ts + - match: \*/ + captures: + 0: punctuation.definition.comment.ts + pop: true + - match: '(^[ \t]+)?((//)(?:\s*((@)internal)(?=\s|$))?)' + captures: + 1: punctuation.whitespace.comment.leading.ts + 2: comment.line.double-slash.ts + 3: punctuation.definition.comment.ts + 4: storage.type.internaldeclaration.ts + 5: punctuation.decorator.internaldeclaration.ts + push: + - meta_content_scope: comment.line.double-slash.ts + - match: (?=^) + pop: true + access-modifier: + - match: '(?]|^await|[^\._$[:alnum:]]await|^return|[^\._$[:alnum:]]return|^yield|[^\._$[:alnum:]]yield|^throw|[^\._$[:alnum:]]throw|^in|[^\._$[:alnum:]]in|^of|[^\._$[:alnum:]]of|^typeof|[^\._$[:alnum:]]typeof|&&|\|\||\*)\s*(\{)' + captures: + 1: punctuation.definition.block.ts + push: + - meta_scope: meta.objectliteral.ts + - match: '\}' + captures: + 0: punctuation.definition.block.ts + pop: true + - include: object-member + array-binding-pattern: + - match: '(?:(\.\.\.)\s*)?(\[)' + captures: + 1: keyword.operator.rest.ts + 2: punctuation.definition.binding-pattern.array.ts + push: + - match: '\]' + captures: + 0: punctuation.definition.binding-pattern.array.ts + pop: true + - include: binding-element + - include: punctuation-comma + array-binding-pattern-const: + - match: '(?:(\.\.\.)\s*)?(\[)' + captures: + 1: keyword.operator.rest.ts + 2: punctuation.definition.binding-pattern.array.ts + push: + - match: '\]' + captures: + 0: punctuation.definition.binding-pattern.array.ts + pop: true + - include: binding-element-const + - include: punctuation-comma + array-literal: + - match: '\s*(\[)' + captures: + 1: meta.brace.square.ts + push: + - meta_scope: meta.array.literal.ts + - match: '\]' + captures: + 0: meta.brace.square.ts + pop: true + - include: expression + - include: punctuation-comma + arrow-function: + - match: '(?:(?)' + scope: meta.arrow.ts + captures: + 1: storage.modifier.async.ts + 2: variable.parameter.ts + - match: |- + (?x) (?: + (? is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + ) + ) + captures: + 1: storage.modifier.async.ts + push: + - meta_scope: meta.arrow.ts + - match: '(?==>|\{|(^\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\s+))' + pop: true + - include: comment + - include: type-parameters + - include: function-parameters + - include: arrow-return-type + - match: "=>" + captures: + 0: storage.type.function.arrow.ts + push: + - meta_scope: meta.arrow.ts + - match: '(?<=\}|\S)(?)|((?!\{)(?=\S))' + pop: true + - include: decl-block + - include: expression + arrow-return-type: + - match: (?<=\))\s*(:) + captures: + 1: keyword.operator.type.annotation.ts + push: + - meta_scope: meta.return.type.arrow.ts + - match: '(?==>|\{|(^\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\s+))' + pop: true + - include: arrow-return-type-body + arrow-return-type-body: + - match: '(?<=[:])(?=\s*\{)' + push: + - match: '(?<=\})' + pop: true + - include: type-object + - include: type-predicate-operator + - include: type + async-modifier: + - match: '(?*?\&\|\^]|[^_$[:alnum:]](?:\+\+|\-\-)|[^\+]\+|[^\-]\-))\s*(<)(?!)\s* + captures: + 1: meta.brace.angle.ts + pop: true + - include: type + - match: '(?:(?<=^))\s*(<)(?=[_$[:alpha:]][_$[:alnum:]]*\s*>)' + captures: + 1: meta.brace.angle.ts + push: + - meta_scope: cast.expr.ts + - match: (\>)\s* + captures: + 1: meta.brace.angle.ts + pop: true + - include: type + class-declaration: + - match: '(?\s*$)' + captures: + 1: punctuation.definition.comment.ts + push: + - meta_scope: comment.line.triple-slash.directive.ts + - match: (?=^) + pop: true + - match: (<)(reference|amd-dependency|amd-module) + captures: + 1: punctuation.definition.tag.directive.ts + 2: entity.name.tag.directive.ts + push: + - meta_scope: meta.tag.ts + - match: /> + captures: + 0: punctuation.definition.tag.directive.ts + pop: true + - match: path|types|no-default-lib|lib|name + scope: entity.other.attribute-name.directive.ts + - match: "=" + scope: keyword.operator.assignment.ts + - include: string + docblock: + - match: |- + (?x) + ((@)(?:access|api)) + \s+ + (private|protected|public) + \b + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + 3: constant.language.access-type.jsdoc + - match: |- + (?x) + ((@)author) + \s+ + ( + [^@\s<>*/] + (?:[^@<>*/]|\*[^/])* + ) + (?: + \s* + (<) + ([^>\s]+) + (>) + )? + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + 3: entity.name.type.instance.jsdoc + 4: punctuation.definition.bracket.angle.begin.jsdoc + 5: constant.other.email.link.underline.jsdoc + 6: punctuation.definition.bracket.angle.end.jsdoc + - match: |- + (?x) + ((@)borrows) \s+ + ((?:[^@\s*/]|\*[^/])+) # + \s+ (as) \s+ # as + ((?:[^@\s*/]|\*[^/])+) # + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + 3: entity.name.type.instance.jsdoc + 4: keyword.operator.control.jsdoc + 5: entity.name.type.instance.jsdoc + - match: ((@)example)\s+ + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + push: + - meta_scope: meta.example.jsdoc + - match: (?=@|\*/) + pop: true + - match: ^\s\*\s+ + - match: \G(<)caption(>) + captures: + 0: entity.name.tag.inline.jsdoc + 1: punctuation.definition.bracket.angle.begin.jsdoc + 2: punctuation.definition.bracket.angle.end.jsdoc + push: + - meta_content_scope: constant.other.description.jsdoc + - match: ()|(?=\*/) + captures: + 0: entity.name.tag.inline.jsdoc + 1: punctuation.definition.bracket.angle.begin.jsdoc + 2: punctuation.definition.bracket.angle.end.jsdoc + pop: true + - match: '[^\s@*](?:[^*]|\*[^/])*' + captures: + 0: source.embedded.ts + - match: (?x) ((@)kind) \s+ (class|constant|event|external|file|function|member|mixin|module|namespace|typedef) \b + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + 3: constant.language.symbol-type.jsdoc + - match: |- + (?x) + ((@)see) + \s+ + (?: + # URL + ( + (?=https?://) + (?:[^\s*]|\*[^/])+ + ) + | + # JSDoc namepath + ( + (?! + # Avoid matching bare URIs (also acceptable as links) + https?:// + | + # Avoid matching {@inline tags}; we match those below + (?:\[[^\[\]]*\])? # Possible description [preceding]{@tag} + {@(?:link|linkcode|linkplain|tutorial)\b + ) + # Matched namepath + (?:[^@\s*/]|\*[^/])+ + ) + ) + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + 3: variable.other.link.underline.jsdoc + 4: entity.name.type.instance.jsdoc + - match: |- + (?x) + ((@)template) + \s+ + # One or more valid identifiers + ( + [A-Za-z_$] # First character: non-numeric word character + [\w$.\[\]]* # Rest of identifier + (?: # Possible list of additional identifiers + \s* , \s* + [A-Za-z_$] + [\w$.\[\]]* + )* + ) + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + 3: variable.other.jsdoc + - match: |- + (?x) + ( + (@) + (?:arg|argument|const|constant|member|namespace|param|var) + ) + \s+ + ( + [A-Za-z_$] + [\w$.\[\]]* + ) + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + 3: variable.other.jsdoc + - match: '((@)typedef)\s+(?={)' + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + push: + - match: '(?=\s|\*/|[^{}\[\]A-Za-z_$])' + pop: true + - include: jsdoctype + - match: '(?:[^@\s*/]|\*[^/])+' + scope: entity.name.type.instance.jsdoc + - match: '((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\s+(?={)' + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + push: + - match: '(?=\s|\*/|[^{}\[\]A-Za-z_$])' + pop: true + - include: jsdoctype + - match: '([A-Za-z_$][\w$.\[\]]*)' + scope: variable.other.jsdoc + - match: |- + (?x) + (\[)\s* + [\w$]+ + (?: + (?:\[\])? # Foo[ ].bar properties within an array + \. # Foo.Bar namespaced parameter + [\w$]+ + )* + (?: + \s* + (=) # [foo=bar] Default parameter value + \s* + ( + # The inner regexes are to stop the match early at */ and to not stop at escaped quotes + (?> + "(?:(?:\*(?!/))|(?:\\(?!"))|[^*\\])*?" | # [foo="bar"] Double-quoted + '(?:(?:\*(?!/))|(?:\\(?!'))|[^*\\])*?' | # [foo='bar'] Single-quoted + \[ (?:(?:\*(?!/))|[^*])*? \] | # [foo=[1,2]] Array literal + (?:(?:\*(?!/))|\s(?!\s*\])|\[.*?(?:\]|(?=\*/))|[^*\s\[\]])* # Everything else + )* + ) + )? + \s*(?:(\])((?:[^*\s]|\*[^\s/])+)?|(?=\*/)) + scope: variable.other.jsdoc + captures: + 1: punctuation.definition.optional-value.begin.bracket.square.jsdoc + 2: keyword.operator.assignment.jsdoc + 3: source.embedded.ts + 4: punctuation.definition.optional-value.end.bracket.square.jsdoc + 5: invalid.illegal.syntax.jsdoc + - match: |- + (?x) + ( + (@) + (?:define|enum|exception|export|extends|lends|implements|modifies + |namespace|private|protected|returns?|suppress|this|throws|type + |yields?) + ) + \s+(?={) + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + push: + - match: '(?=\s|\*/|[^{}\[\]A-Za-z_$])' + pop: true + - include: jsdoctype + - match: |- + (?x) + ( + (@) + (?:alias|augments|callback|constructs|emits|event|fires|exports? + |extends|external|function|func|host|lends|listens|interface|memberof!? + |method|module|mixes|mixin|name|requires|see|this|typedef|uses) + ) + \s+ + ( + (?: + [^{}@\s*] | \*[^/] + )+ + ) + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + 3: entity.name.type.instance.jsdoc + - match: '((@)(?:default(?:value)?|license|version))\s+(([''''"]))' + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + 3: variable.other.jsdoc + 4: punctuation.definition.string.begin.jsdoc + push: + - meta_content_scope: variable.other.jsdoc + - match: (\3)|(?=$|\*/) + captures: + 0: variable.other.jsdoc + 1: punctuation.definition.string.end.jsdoc + pop: true + - match: '((@)(?:default(?:value)?|license|tutorial|variation|version))\s+([^\s*]+)' + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + 3: variable.other.jsdoc + - match: '(?x) (@) (?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles |callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright |default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception |exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func |function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc |inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method |mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects |override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected |public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary |suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation |version|virtual|writeOnce|yields?) \b' + scope: storage.type.class.jsdoc + captures: + 1: punctuation.definition.block.tag.jsdoc + - include: inline-tags + enum-declaration: + - match: '(?>=|>>>=|\|= + scope: keyword.operator.assignment.compound.bitwise.ts + - match: "<<|>>>|>>" + scope: keyword.operator.bitwise.shift.ts + - match: "===|!==|==|!=" + scope: keyword.operator.comparison.ts + - match: <=|>=|<>|<|> + scope: keyword.operator.relational.ts + - match: \!|&&|\|\| + scope: keyword.operator.logical.ts + - match: \&|~|\^|\| + scope: keyword.operator.bitwise.ts + - match: \= + scope: keyword.operator.assignment.ts + - match: "--" + scope: keyword.operator.decrement.ts + - match: \+\+ + scope: keyword.operator.increment.ts + - match: '%|\*|/|-|\+' + scope: keyword.operator.arithmetic.ts + - match: '(?<=[_$[:alnum:])\]])\s*(/)(?![/*])' + captures: + 1: keyword.operator.arithmetic.ts + expressionPunctuations: + - include: punctuation-comma + - include: punctuation-accessor + expressionWithoutIdentifiers: + - include: string + - include: regex + - include: template + - include: comment + - include: function-expression + - include: class-expression + - include: arrow-function + - include: paren-expression-possibly-arrow + - include: cast + - include: ternary-expression + - include: new-expr + - include: instanceof-expr + - include: object-literal + - include: expression-operators + - include: function-call + - include: literal + - include: support-objects + - include: paren-expression + field-declaration: + - match: |- + (?x)(?) + )) | + ((async\s*)?( + ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + )) + )) | + # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) => + (:\s*( + (<) | + ([(]\s*( + ([)]) | + (\.\.\.) | + ([_$[:alnum:]]+\s*( + ([:,?=])| + ([)]\s*=>) + )) + )) + )) | + (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$))) | + (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*( + ((async\s+)?( + (function\s*[(<*]) | + (function\s+) | + ([_$[:alpha:]][_$[:alnum:]]*\s*=>) + )) | + ((async\s*)?( + ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + )) + ))) + captures: + 1: meta.definition.property.ts entity.name.function.ts + 2: keyword.operator.optional.ts + - match: "[_$[:alpha:]][_$[:alnum:]]*" + scope: meta.definition.property.ts variable.object.property.ts + - match: \? + scope: keyword.operator.optional.ts + for-loop: + - match: '(?\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)?\()' + push: + - match: '(?<=\))(?!(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\s*(\?\.\s*)?(<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)?\()' + pop: true + - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*))' + push: + - meta_scope: meta.function-call.ts + - match: '(?=\s*(\?\.\s*)?(<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)?\()' + pop: true + - include: literal + - include: support-objects + - include: object-identifiers + - include: punctuation-accessor + - match: '(?:(?) + )) | + ((async\s*)?( + ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + )) + )) + captures: + 1: punctuation.accessor.ts + 2: punctuation.accessor.optional.ts + 3: entity.name.function.ts + - match: '(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])' + captures: + 1: punctuation.accessor.ts + 2: punctuation.accessor.optional.ts + 3: variable.other.constant.property.ts + - match: '(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*([_$[:alpha:]][_$[:alnum:]]*)' + captures: + 1: punctuation.accessor.ts + 2: punctuation.accessor.optional.ts + 3: variable.other.property.ts + - match: "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])" + scope: variable.other.constant.ts + - match: "[_$[:alpha:]][_$[:alnum:]]*" + scope: variable.other.readwrite.ts + import-declaration: + - match: '(?) + )) | + ((async\s*)?( + ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + )) + ))) + scope: meta.object.member.ts + captures: + 0: meta.object-literal.key.ts + 1: entity.name.function.ts + - match: '(?:[_$[:alpha:]][_$[:alnum:]]*)\s*(?=:)' + scope: meta.object.member.ts + captures: + 0: meta.object-literal.key.ts + - match: \.\.\. + captures: + 0: keyword.operator.spread.ts + push: + - meta_scope: meta.object.member.ts + - match: '(?=,|\})' + pop: true + - include: expression + - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?=,|\}|$)' + scope: meta.object.member.ts + captures: + 1: variable.other.readwrite.ts + - match: '(?=[_$[:alpha:]][_$[:alnum:]]*\s*=)' + push: + - meta_scope: meta.object.member.ts + - match: '(?=,|\}|$)' + pop: true + - include: expression + - match: ":" + captures: + 0: meta.object-literal.key.ts punctuation.separator.key-value.ts + push: + - meta_scope: meta.object.member.ts + - match: '(?=,|\})' + pop: true + - match: '(?<=:)\s*(async)?(?=\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)\(\s*([\{\[]\s*)?$)' + captures: + 1: storage.modifier.async.ts + push: + - match: (?<=\)) + pop: true + - include: type-parameters + - match: \( + captures: + 0: meta.brace.round.ts + push: + - match: \) + captures: + 0: meta.brace.round.ts + pop: true + - include: expression-inside-possibly-arrow-parens + - match: '(?<=:)\s*(async)?\s*(\()(?=\s*([\{\[]\s*)?$)' + captures: + 1: storage.modifier.async.ts + 2: meta.brace.round.ts + push: + - match: \) + captures: + 0: meta.brace.round.ts + pop: true + - include: expression-inside-possibly-arrow-parens + - include: expression + - include: punctuation-comma + parameter-array-binding-pattern: + - match: '(?:(\.\.\.)\s*)?(\[)' + captures: + 1: keyword.operator.rest.ts + 2: punctuation.definition.binding-pattern.array.ts + push: + - match: '\]' + captures: + 0: punctuation.definition.binding-pattern.array.ts + pop: true + - include: parameter-binding-element + - include: punctuation-comma + parameter-binding-element: + - include: comment + - include: string + - include: parameter-object-binding-pattern + - include: parameter-array-binding-pattern + - include: destructuring-parameter-rest + - include: variable-initializer + parameter-name: + - match: '(?) + )) | + ((async\s*)?( + ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + )) + )) | + # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) => + (:\s*( + (<) | + ([(]\s*( + ([)]) | + (\.\.\.) | + ([_$[:alnum:]]+\s*( + ([:,?=])| + ([)]\s*=>) + )) + )) + )) | + (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$))) | + (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*( + ((async\s+)?( + (function\s*[(<*]) | + (function\s+) | + ([_$[:alpha:]][_$[:alnum:]]*\s*=>) + )) | + ((async\s*)?( + ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + )) + ))) + captures: + 1: storage.modifier.ts + 2: keyword.operator.rest.ts + 3: entity.name.function.ts variable.language.this.ts + 4: entity.name.function.ts + 5: keyword.operator.optional.ts + - match: '(?x)(?:(?]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*))?\(\s*[\{\[]\s*$)' + captures: + 1: storage.modifier.async.ts + push: + - match: (?<=\)) + pop: true + - include: paren-expression-possibly-arrow-with-typeparameters + - match: '(?<=[(=,]|=>)\s*(async)?(?=\s*((((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*))?\()|(<))\s*$)' + captures: + 1: storage.modifier.async.ts + push: + - match: (?<=\)) + pop: true + - include: paren-expression-possibly-arrow-with-typeparameters + - include: possibly-arrow-return-type + paren-expression-possibly-arrow-with-typeparameters: + - include: type-parameters + - match: \( + captures: + 0: meta.brace.round.ts + push: + - match: \) + captures: + 0: meta.brace.round.ts + pop: true + - include: expression-inside-possibly-arrow-parens + possibly-arrow-return-type: + - match: '(?<=\))\s*(:)(?=\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+\s*=>)' + captures: + 1: meta.arrow.ts meta.return.type.arrow.ts keyword.operator.type.annotation.ts + push: + - meta_content_scope: meta.arrow.ts meta.return.type.arrow.ts + - match: '(?==>|\{|(^\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\s+))' + pop: true + - include: arrow-return-type-body + property-accessor: + - match: '(?|&&|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$]))' + captures: + 1: punctuation.definition.string.begin.ts + push: + - meta_scope: string.regexp.ts + - match: "(/)([gimsuy]*)" + captures: + 1: punctuation.definition.string.end.ts + 2: keyword.other.ts + pop: true + - include: regexp + - match: '(?' + captures: + 0: keyword.other.back-reference.regexp + 1: variable.other.regexp + - match: '[?+*]|\{(\d+,\d+|\d+,|,\d+|\d+)\}\??' + scope: keyword.operator.quantifier.regexp + - match: \| + scope: keyword.operator.or.regexp + - match: (\()((\?=)|(\?!)|(\?<=)|(\?))?' + captures: + 0: punctuation.definition.group.regexp + 1: punctuation.definition.group.no-capture.regexp + 2: variable.other.regexp + push: + - meta_scope: meta.group.regexp + - match: \) + captures: + 0: punctuation.definition.group.regexp + pop: true + - include: regexp + - match: '(\[)(\^)?' + captures: + 1: punctuation.definition.character-class.regexp + 2: keyword.operator.negation.regexp + push: + - meta_scope: constant.other.character-class.set.regexp + - match: '(\])' + captures: + 1: punctuation.definition.character-class.regexp + pop: true + - match: '(?:.|(\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\c[A-Z])|(\\.))\-(?:[^\]\\]|(\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\c[A-Z])|(\\.))' + scope: constant.other.character-class.range.regexp + captures: + 1: constant.character.numeric.regexp + 2: constant.character.control.regexp + 3: constant.character.escape.backslash.regexp + 4: constant.character.numeric.regexp + 5: constant.character.control.regexp + 6: constant.character.escape.backslash.regexp + - include: regex-character-class + - include: regex-character-class + return-type: + - match: (?<=\))\s*(:)(?=\s*\S) + captures: + 1: keyword.operator.type.annotation.ts + push: + - meta_scope: meta.return.type.ts + - match: "(?]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?\() + captures: + 1: punctuation.accessor.ts + 2: punctuation.accessor.optional.ts + 3: support.constant.dom.ts + 4: support.variable.property.dom.ts + - match: |- + (?x)(?\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)`)' + captures: + 1: entity.name.function.tagged-template.ts + push: + - meta_scope: string.template.ts + - match: (?=`) + pop: true + - include: type-arguments + - match: "([_$[:alpha:]][_$[:alnum:]]*)?(`)" + captures: + 1: entity.name.function.tagged-template.ts + 2: punctuation.definition.string.template.begin.ts + push: + - meta_scope: string.template.ts + - match: "`" + captures: + 0: punctuation.definition.string.template.end.ts + pop: true + - include: template-substitution-element + - include: string-character-escape + template-substitution-element: + - match: '\$\{' + captures: + 0: punctuation.definition.template-expression.begin.ts + push: + - meta_scope: meta.template.expression.ts + - meta_content_scope: meta.embedded.line.ts + - match: '\}' + captures: + 0: punctuation.definition.template-expression.end.ts + pop: true + - include: expression + ternary-expression: + - match: '(?!\?\.\s*[^[:digit:]])(\?)' + captures: + 1: keyword.operator.ternary.ts + push: + - match: \s*(:) + captures: + 1: keyword.operator.ternary.ts + pop: true + - include: expression + this-literal: + - match: '(?])|((?<=[\}>\]\)]|[_$[:alpha:]])\s*(?=\{)))' + pop: true + - include: type + - match: (:) + captures: + 1: keyword.operator.type.annotation.ts + push: + - meta_scope: meta.type.annotation.ts + - match: '(?])|(?=^\s*$)|((?<=\S)(?=\s*$))|((?<=[\}>\]\)]|[_$[:alpha:]])\s*(?=\{)))' + pop: true + - include: type + type-arguments: + - match: \< + captures: + 0: punctuation.definition.typeparameters.begin.ts + push: + - meta_scope: meta.type.parameters.ts + - match: \> + captures: + 0: punctuation.definition.typeparameters.end.ts + pop: true + - include: type + - include: punctuation-comma + type-builtin-literals: + - match: '(?) + )) + ) + ) + ) + push: + - meta_scope: meta.type.function.ts + - match: (?<=\)) + pop: true + - include: function-parameters + type-function-return-type: + - match: (=>)(?=\s*\S) + captures: + 1: storage.type.function.arrow.ts + push: + - meta_scope: meta.type.function.return.ts + - match: '(?)(?:\?]|//|$)' + pop: true + - include: type-function-return-type-core + - match: "=>" + captures: + 0: storage.type.function.arrow.ts + push: + - meta_scope: meta.type.function.return.ts + - match: '(?)(?]|//|^\s*$)|((?<=\S)(?=\s*$)))' + pop: true + - include: type-function-return-type-core + type-function-return-type-core: + - include: comment + - match: '(?<==>)(?=\s*\{)' + push: + - match: '(?<=\})' + pop: true + - include: type-object + - include: type-predicate-operator + - include: type + type-name: + - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))' + captures: + 1: entity.name.type.module.ts + 2: punctuation.accessor.ts + 3: punctuation.accessor.optional.ts + - match: "[_$[:alpha:]][_$[:alnum:]]*" + scope: entity.name.type.ts + type-object: + - match: '\{' + captures: + 0: punctuation.definition.block.ts + push: + - meta_scope: meta.object.type.ts + - match: '\}' + captures: + 0: punctuation.definition.block.ts + pop: true + - include: comment + - include: method-declaration + - include: indexer-declaration + - include: indexer-mapped-type-declaration + - include: field-declaration + - include: type-annotation + - match: \.\.\. + captures: + 0: keyword.operator.spread.ts + push: + - match: '(?=\}|;|,|$)|(?<=\})' + pop: true + - include: type + - include: punctuation-comma + - include: punctuation-semicolon + - include: type + type-operators: + - include: typeof-operator + - match: '(?:([&|])|(=(?!>)))(?=\s*\{)' + captures: + 1: keyword.operator.type.ts + 2: keyword.operator.assignment.ts + push: + - match: '(?<=\})' + pop: true + - include: type-object + - match: "([&|])|(=(?!>))" + captures: + 1: keyword.operator.type.ts + 2: keyword.operator.assignment.ts + push: + - match: (?=\S) + pop: true + - match: '(?) + captures: + 1: punctuation.definition.typeparameters.end.ts + pop: true + - include: comment + - match: '(?) + )) + )) + )) | + (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)))) + captures: + 1: storage.modifier.ts + 2: keyword.operator.rest.ts + 3: entity.name.function.ts variable.language.this.ts + 4: entity.name.function.ts + 5: keyword.operator.optional.ts + - match: '(?x)(?:(?) + )) | + ((async\s*)?( + ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + )) + )) | + # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) => + (:\s*( + (<) | + ([(]\s*( + ([)]) | + (\.\.\.) | + ([_$[:alnum:]]+\s*( + ([:,?=])| + ([)]\s*=>) + )) + )) + )) | + (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$))) | + (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*( + ((async\s+)?( + (function\s*[(<*]) | + (function\s+) | + ([_$[:alpha:]][_$[:alnum:]]*\s*=>) + )) | + ((async\s*)?( + ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + )) + ))) + captures: + 1: meta.definition.variable.ts variable.other.constant.ts entity.name.function.ts + push: + - meta_scope: meta.var-single-variable.expr.ts + - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))' + pop: true + - include: var-single-variable-type-annotation + - match: "([_$[:alpha:]][_$[:alnum:]]*)" + captures: + 1: meta.definition.variable.ts variable.other.constant.ts + push: + - meta_scope: meta.var-single-variable.expr.ts + - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))' + pop: true + - include: var-single-variable-type-annotation + var-single-variable: + - match: |- + (?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\s* + # function assignment | + (=\s*( + ((async\s+)?( + (function\s*[(<*]) | + (function\s+) | + ([_$[:alpha:]][_$[:alnum:]]*\s*=>) + )) | + ((async\s*)?( + ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + )) + )) | + # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) => + (:\s*( + (<) | + ([(]\s*( + ([)]) | + (\.\.\.) | + ([_$[:alnum:]]+\s*( + ([:,?=])| + ([)]\s*=>) + )) + )) + )) | + (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$))) | + (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*( + ((async\s+)?( + (function\s*[(<*]) | + (function\s+) | + ([_$[:alpha:]][_$[:alnum:]]*\s*=>) + )) | + ((async\s*)?( + ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + )) + ))) + captures: + 1: meta.definition.variable.ts entity.name.function.ts + push: + - meta_scope: meta.var-single-variable.expr.ts + - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))' + pop: true + - include: var-single-variable-type-annotation + - match: "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])" + captures: + 1: meta.definition.variable.ts variable.other.constant.ts + push: + - meta_scope: meta.var-single-variable.expr.ts + - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))' + pop: true + - include: var-single-variable-type-annotation + - match: "([_$[:alpha:]][_$[:alnum:]]*)" + captures: + 1: meta.definition.variable.ts variable.other.readwrite.ts + push: + - meta_scope: meta.var-single-variable.expr.ts + - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))' + pop: true + - include: var-single-variable-type-annotation + var-single-variable-type-annotation: + - include: type-annotation + - include: string + - include: comment + variable-initializer: + - match: (?]|^await|[^\._$[:alnum:]]await|^return|[^\._$[:alnum:]]return|^yield|[^\._$[:alnum:]]yield|^throw|[^\._$[:alnum:]]throw|^in|[^\._$[:alnum:]]in|^of|[^\._$[:alnum:]]of|^typeof|[^\._$[:alnum:]]typeof|&&|\|\||\*)\s*(\{)' + captures: + 1: punctuation.definition.block.tsx + push: + - meta_scope: meta.objectliteral.tsx + - match: '\}' + captures: + 0: punctuation.definition.block.tsx + pop: true + - include: object-member + array-binding-pattern: + - match: '(?:(\.\.\.)\s*)?(\[)' + captures: + 1: keyword.operator.rest.tsx + 2: punctuation.definition.binding-pattern.array.tsx + push: + - match: '\]' + captures: + 0: punctuation.definition.binding-pattern.array.tsx + pop: true + - include: binding-element + - include: punctuation-comma + array-binding-pattern-const: + - match: '(?:(\.\.\.)\s*)?(\[)' + captures: + 1: keyword.operator.rest.tsx + 2: punctuation.definition.binding-pattern.array.tsx + push: + - match: '\]' + captures: + 0: punctuation.definition.binding-pattern.array.tsx + pop: true + - include: binding-element-const + - include: punctuation-comma + array-literal: + - match: '\s*(\[)' + captures: + 1: meta.brace.square.tsx + push: + - meta_scope: meta.array.literal.tsx + - match: '\]' + captures: + 0: meta.brace.square.tsx + pop: true + - include: expression + - include: punctuation-comma + arrow-function: + - match: '(?:(?)' + scope: meta.arrow.tsx + captures: + 1: storage.modifier.async.tsx + 2: variable.parameter.tsx + - match: |- + (?x) (?: + (? is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + ) + ) + captures: + 1: storage.modifier.async.tsx + push: + - meta_scope: meta.arrow.tsx + - match: '(?==>|\{|(^\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\s+))' + pop: true + - include: comment + - include: type-parameters + - include: function-parameters + - include: arrow-return-type + - match: "=>" + captures: + 0: storage.type.function.arrow.tsx + push: + - meta_scope: meta.arrow.tsx + - match: '(?<=\}|\S)(?)|((?!\{)(?=\S))' + pop: true + - include: decl-block + - include: expression + arrow-return-type: + - match: (?<=\))\s*(:) + captures: + 1: keyword.operator.type.annotation.tsx + push: + - meta_scope: meta.return.type.arrow.tsx + - match: '(?==>|\{|(^\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\s+))' + pop: true + - include: arrow-return-type-body + arrow-return-type-body: + - match: '(?<=[:])(?=\s*\{)' + push: + - match: '(?<=\})' + pop: true + - include: type-object + - include: type-predicate-operator + - include: type + async-modifier: + - match: '(?\s*$)' + captures: + 1: punctuation.definition.comment.tsx + push: + - meta_scope: comment.line.triple-slash.directive.tsx + - match: (?=^) + pop: true + - match: (<)(reference|amd-dependency|amd-module) + captures: + 1: punctuation.definition.tag.directive.tsx + 2: entity.name.tag.directive.tsx + push: + - meta_scope: meta.tag.tsx + - match: /> + captures: + 0: punctuation.definition.tag.directive.tsx + pop: true + - match: path|types|no-default-lib|lib|name + scope: entity.other.attribute-name.directive.tsx + - match: "=" + scope: keyword.operator.assignment.tsx + - include: string + docblock: + - match: |- + (?x) + ((@)(?:access|api)) + \s+ + (private|protected|public) + \b + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + 3: constant.language.access-type.jsdoc + - match: |- + (?x) + ((@)author) + \s+ + ( + [^@\s<>*/] + (?:[^@<>*/]|\*[^/])* + ) + (?: + \s* + (<) + ([^>\s]+) + (>) + )? + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + 3: entity.name.type.instance.jsdoc + 4: punctuation.definition.bracket.angle.begin.jsdoc + 5: constant.other.email.link.underline.jsdoc + 6: punctuation.definition.bracket.angle.end.jsdoc + - match: |- + (?x) + ((@)borrows) \s+ + ((?:[^@\s*/]|\*[^/])+) # + \s+ (as) \s+ # as + ((?:[^@\s*/]|\*[^/])+) # + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + 3: entity.name.type.instance.jsdoc + 4: keyword.operator.control.jsdoc + 5: entity.name.type.instance.jsdoc + - match: ((@)example)\s+ + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + push: + - meta_scope: meta.example.jsdoc + - match: (?=@|\*/) + pop: true + - match: ^\s\*\s+ + - match: \G(<)caption(>) + captures: + 0: entity.name.tag.inline.jsdoc + 1: punctuation.definition.bracket.angle.begin.jsdoc + 2: punctuation.definition.bracket.angle.end.jsdoc + push: + - meta_content_scope: constant.other.description.jsdoc + - match: ()|(?=\*/) + captures: + 0: entity.name.tag.inline.jsdoc + 1: punctuation.definition.bracket.angle.begin.jsdoc + 2: punctuation.definition.bracket.angle.end.jsdoc + pop: true + - match: '[^\s@*](?:[^*]|\*[^/])*' + captures: + 0: source.embedded.tsx + - match: (?x) ((@)kind) \s+ (class|constant|event|external|file|function|member|mixin|module|namespace|typedef) \b + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + 3: constant.language.symbol-type.jsdoc + - match: |- + (?x) + ((@)see) + \s+ + (?: + # URL + ( + (?=https?://) + (?:[^\s*]|\*[^/])+ + ) + | + # JSDoc namepath + ( + (?! + # Avoid matching bare URIs (also acceptable as links) + https?:// + | + # Avoid matching {@inline tags}; we match those below + (?:\[[^\[\]]*\])? # Possible description [preceding]{@tag} + {@(?:link|linkcode|linkplain|tutorial)\b + ) + # Matched namepath + (?:[^@\s*/]|\*[^/])+ + ) + ) + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + 3: variable.other.link.underline.jsdoc + 4: entity.name.type.instance.jsdoc + - match: |- + (?x) + ((@)template) + \s+ + # One or more valid identifiers + ( + [A-Za-z_$] # First character: non-numeric word character + [\w$.\[\]]* # Rest of identifier + (?: # Possible list of additional identifiers + \s* , \s* + [A-Za-z_$] + [\w$.\[\]]* + )* + ) + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + 3: variable.other.jsdoc + - match: |- + (?x) + ( + (@) + (?:arg|argument|const|constant|member|namespace|param|var) + ) + \s+ + ( + [A-Za-z_$] + [\w$.\[\]]* + ) + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + 3: variable.other.jsdoc + - match: '((@)typedef)\s+(?={)' + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + push: + - match: '(?=\s|\*/|[^{}\[\]A-Za-z_$])' + pop: true + - include: jsdoctype + - match: '(?:[^@\s*/]|\*[^/])+' + scope: entity.name.type.instance.jsdoc + - match: '((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\s+(?={)' + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + push: + - match: '(?=\s|\*/|[^{}\[\]A-Za-z_$])' + pop: true + - include: jsdoctype + - match: '([A-Za-z_$][\w$.\[\]]*)' + scope: variable.other.jsdoc + - match: |- + (?x) + (\[)\s* + [\w$]+ + (?: + (?:\[\])? # Foo[ ].bar properties within an array + \. # Foo.Bar namespaced parameter + [\w$]+ + )* + (?: + \s* + (=) # [foo=bar] Default parameter value + \s* + ( + # The inner regexes are to stop the match early at */ and to not stop at escaped quotes + (?> + "(?:(?:\*(?!/))|(?:\\(?!"))|[^*\\])*?" | # [foo="bar"] Double-quoted + '(?:(?:\*(?!/))|(?:\\(?!'))|[^*\\])*?' | # [foo='bar'] Single-quoted + \[ (?:(?:\*(?!/))|[^*])*? \] | # [foo=[1,2]] Array literal + (?:(?:\*(?!/))|\s(?!\s*\])|\[.*?(?:\]|(?=\*/))|[^*\s\[\]])* # Everything else + )* + ) + )? + \s*(?:(\])((?:[^*\s]|\*[^\s/])+)?|(?=\*/)) + scope: variable.other.jsdoc + captures: + 1: punctuation.definition.optional-value.begin.bracket.square.jsdoc + 2: keyword.operator.assignment.jsdoc + 3: source.embedded.tsx + 4: punctuation.definition.optional-value.end.bracket.square.jsdoc + 5: invalid.illegal.syntax.jsdoc + - match: |- + (?x) + ( + (@) + (?:define|enum|exception|export|extends|lends|implements|modifies + |namespace|private|protected|returns?|suppress|this|throws|type + |yields?) + ) + \s+(?={) + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + push: + - match: '(?=\s|\*/|[^{}\[\]A-Za-z_$])' + pop: true + - include: jsdoctype + - match: |- + (?x) + ( + (@) + (?:alias|augments|callback|constructs|emits|event|fires|exports? + |extends|external|function|func|host|lends|listens|interface|memberof!? + |method|module|mixes|mixin|name|requires|see|this|typedef|uses) + ) + \s+ + ( + (?: + [^{}@\s*] | \*[^/] + )+ + ) + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + 3: entity.name.type.instance.jsdoc + - match: '((@)(?:default(?:value)?|license|version))\s+(([''''"]))' + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + 3: variable.other.jsdoc + 4: punctuation.definition.string.begin.jsdoc + push: + - meta_content_scope: variable.other.jsdoc + - match: (\3)|(?=$|\*/) + captures: + 0: variable.other.jsdoc + 1: punctuation.definition.string.end.jsdoc + pop: true + - match: '((@)(?:default(?:value)?|license|tutorial|variation|version))\s+([^\s*]+)' + captures: + 1: storage.type.class.jsdoc + 2: punctuation.definition.block.tag.jsdoc + 3: variable.other.jsdoc + - match: '(?x) (@) (?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles |callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright |default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception |exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func |function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc |inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method |mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects |override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected |public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary |suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation |version|virtual|writeOnce|yields?) \b' + scope: storage.type.class.jsdoc + captures: + 1: punctuation.definition.block.tag.jsdoc + - include: inline-tags + enum-declaration: + - match: '(?>=|>>>=|\|= + scope: keyword.operator.assignment.compound.bitwise.tsx + - match: "<<|>>>|>>" + scope: keyword.operator.bitwise.shift.tsx + - match: "===|!==|==|!=" + scope: keyword.operator.comparison.tsx + - match: <=|>=|<>|<|> + scope: keyword.operator.relational.tsx + - match: \!|&&|\|\| + scope: keyword.operator.logical.tsx + - match: \&|~|\^|\| + scope: keyword.operator.bitwise.tsx + - match: \= + scope: keyword.operator.assignment.tsx + - match: "--" + scope: keyword.operator.decrement.tsx + - match: \+\+ + scope: keyword.operator.increment.tsx + - match: '%|\*|/|-|\+' + scope: keyword.operator.arithmetic.tsx + - match: '(?<=[_$[:alnum:])\]])\s*(/)(?![/*])' + captures: + 1: keyword.operator.arithmetic.tsx + expressionPunctuations: + - include: punctuation-comma + - include: punctuation-accessor + expressionWithoutIdentifiers: + - include: jsx + - include: string + - include: regex + - include: template + - include: comment + - include: function-expression + - include: class-expression + - include: arrow-function + - include: paren-expression-possibly-arrow + - include: cast + - include: ternary-expression + - include: new-expr + - include: instanceof-expr + - include: object-literal + - include: expression-operators + - include: function-call + - include: literal + - include: support-objects + - include: paren-expression + field-declaration: + - match: |- + (?x)(?) + )) | + ((async\s*)?( + ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + )) + )) | + # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) => + (:\s*( + (<) | + ([(]\s*( + ([)]) | + (\.\.\.) | + ([_$[:alnum:]]+\s*( + ([:,?=])| + ([)]\s*=>) + )) + )) + )) | + (:\s*((<\s*$)|([\(]\s*([\{\[]\s*)?$))) | + (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*( + ((async\s+)?( + (function\s*[(<*]) | + (function\s+) | + ([_$[:alpha:]][_$[:alnum:]]*\s*=>) + )) | + ((async\s*)?( + ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + )) + ))) + captures: + 1: meta.definition.property.tsx entity.name.function.tsx + 2: keyword.operator.optional.tsx + - match: "[_$[:alpha:]][_$[:alnum:]]*" + scope: meta.definition.property.tsx variable.object.property.tsx + - match: \? + scope: keyword.operator.optional.tsx + for-loop: + - match: '(?\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)?\()' + push: + - match: '(?<=\))(?!(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\s*(\?\.\s*)?(<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)?\()' + pop: true + - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*))' + push: + - meta_scope: meta.function-call.tsx + - match: '(?=\s*(\?\.\s*)?(<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)?\()' + pop: true + - include: literal + - include: support-objects + - include: object-identifiers + - include: punctuation-accessor + - match: '(?:(?) + )) | + ((async\s*)?( + ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + )) + )) + captures: + 1: punctuation.accessor.tsx + 2: punctuation.accessor.optional.tsx + 3: entity.name.function.tsx + - match: '(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])' + captures: + 1: punctuation.accessor.tsx + 2: punctuation.accessor.optional.tsx + 3: variable.other.constant.property.tsx + - match: '(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*([_$[:alpha:]][_$[:alnum:]]*)' + captures: + 1: punctuation.accessor.tsx + 2: punctuation.accessor.optional.tsx + 3: variable.other.property.tsx + - match: "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])" + scope: variable.other.constant.tsx + - match: "[_$[:alpha:]][_$[:alnum:]]*" + scope: variable.other.readwrite.tsx + import-declaration: + - match: '(?))' + push: + - meta_scope: meta.tag.tsx + - match: '(/>)|(?:())' + captures: + 1: punctuation.definition.tag.end.tsx + 2: punctuation.definition.tag.begin.tsx + 3: entity.name.tag.namespace.tsx + 4: punctuation.separator.namespace.tsx + 5: entity.name.tag.tsx + 6: support.class.component.tsx + 7: punctuation.definition.tag.end.tsx + pop: true + - match: '(<)\s*(?:([_$[:alpha:]][-$[:alnum:].]*)(?)' + captures: + 1: punctuation.definition.tag.begin.tsx + 2: entity.name.tag.namespace.tsx + 3: punctuation.separator.namespace.tsx + 4: entity.name.tag.tsx + 5: support.class.component.tsx + push: + - match: "(?=[/]?>)" + pop: true + - include: comment + - include: type-arguments + - include: jsx-tag-attributes + - match: (>) + captures: + 1: punctuation.definition.tag.end.tsx + push: + - meta_content_scope: meta.jsx.children.tsx + - match: (?=|/\*|//) + captures: + 1: entity.other.attribute-name.namespace.tsx + 2: punctuation.separator.namespace.tsx + 3: entity.other.attribute-name.tsx + jsx-tag-attributes: + - match: \s+ + push: + - meta_scope: meta.tag.attributes.tsx + - match: "(?=[/]?>)" + pop: true + - include: comment + - include: jsx-tag-attribute-name + - include: jsx-tag-attribute-assignment + - include: jsx-string-double-quoted + - include: jsx-string-single-quoted + - include: jsx-evaluated-code + - include: jsx-tag-attributes-illegal + jsx-tag-attributes-illegal: + - match: \S+ + scope: invalid.illegal.attribute.tsx + jsx-tag-in-expression: + - match: |- + (?x) + (?:*]|&&|\|\||\?|^await|[^\._$[:alnum:]]await|^return|[^\._$[:alnum:]]return|^default|[^\._$[:alnum:]]default|^yield|[^\._$[:alnum:]]yield|^)\s* + (?!<\s*[_$[:alpha:]][_$[:alnum:]]*((\s+extends\s+[^=>])|,)) # look ahead is not type parameter of arrow + (?=(<)\s*(?:([_$[:alpha:]][-$[:alnum:].]*)(?)) + push: + - match: '(?!(<)\s*(?:([_$[:alpha:]][-$[:alnum:].]*)(?))' + pop: true + - include: jsx-tag + jsx-tag-without-attributes: + - match: '(<)\s*(?:([_$[:alpha:]][-$[:alnum:].]*)(?)' + captures: + 1: punctuation.definition.tag.begin.tsx + 2: entity.name.tag.namespace.tsx + 3: punctuation.separator.namespace.tsx + 4: entity.name.tag.tsx + 5: support.class.component.tsx + 6: punctuation.definition.tag.end.tsx + push: + - meta_scope: meta.tag.without-attributes.tsx + - meta_content_scope: meta.jsx.children.tsx + - match: '()' + captures: + 1: punctuation.definition.tag.begin.tsx + 2: entity.name.tag.namespace.tsx + 3: punctuation.separator.namespace.tsx + 4: entity.name.tag.tsx + 5: support.class.component.tsx + 6: punctuation.definition.tag.end.tsx + pop: true + - include: jsx-children + jsx-tag-without-attributes-in-expression: + - match: '(?:*]|&&|\|\||\?|^await|[^\._$[:alnum:]]await|^return|[^\._$[:alnum:]]return|^default|[^\._$[:alnum:]]default|^yield|[^\._$[:alnum:]]yield|^)\s*(?=(<)\s*(?:([_$[:alpha:]][-$[:alnum:].]*)(?))' + push: + - match: '(?!(<)\s*(?:([_$[:alpha:]][-$[:alnum:].]*)(?))' + pop: true + - include: jsx-tag-without-attributes + label: + - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(:)(?=\s*\{)' + captures: + 1: entity.name.label.tsx + 2: punctuation.separator.label.tsx + push: + - match: '(?<=\})' + pop: true + - include: decl-block + - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(:)' + captures: + 1: entity.name.label.tsx + 2: punctuation.separator.label.tsx + literal: + - include: numeric-literal + - include: boolean-literal + - include: null-literal + - include: undefined-literal + - include: numericConstant-literal + - include: array-literal + - include: this-literal + - include: super-literal + method-declaration: + - match: '(?x)(?) + )) | + ((async\s*)?( + ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + )) + ))) + scope: meta.object.member.tsx + captures: + 0: meta.object-literal.key.tsx + 1: entity.name.function.tsx + - match: '(?:[_$[:alpha:]][_$[:alnum:]]*)\s*(?=:)' + scope: meta.object.member.tsx + captures: + 0: meta.object-literal.key.tsx + - match: \.\.\. + captures: + 0: keyword.operator.spread.tsx + push: + - meta_scope: meta.object.member.tsx + - match: '(?=,|\})' + pop: true + - include: expression + - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?=,|\}|$)' + scope: meta.object.member.tsx + captures: + 1: variable.other.readwrite.tsx + - match: '(?=[_$[:alpha:]][_$[:alnum:]]*\s*=)' + push: + - meta_scope: meta.object.member.tsx + - match: '(?=,|\}|$)' + pop: true + - include: expression + - match: ":" + captures: + 0: meta.object-literal.key.tsx punctuation.separator.key-value.tsx + push: + - meta_scope: meta.object.member.tsx + - match: '(?=,|\})' + pop: true + - match: '(?<=:)\s*(async)?(?=\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)\(\s*([\{\[]\s*)?$)' + captures: + 1: storage.modifier.async.tsx + push: + - match: (?<=\)) + pop: true + - include: type-parameters + - match: \( + captures: + 0: meta.brace.round.tsx + push: + - match: \) + captures: + 0: meta.brace.round.tsx + pop: true + - include: expression-inside-possibly-arrow-parens + - match: '(?<=:)\s*(async)?\s*(\()(?=\s*([\{\[]\s*)?$)' + captures: + 1: storage.modifier.async.tsx + 2: meta.brace.round.tsx + push: + - match: \) + captures: + 0: meta.brace.round.tsx + pop: true + - include: expression-inside-possibly-arrow-parens + - include: expression + - include: punctuation-comma + parameter-array-binding-pattern: + - match: '(?:(\.\.\.)\s*)?(\[)' + captures: + 1: keyword.operator.rest.tsx + 2: punctuation.definition.binding-pattern.array.tsx + push: + - match: '\]' + captures: + 0: punctuation.definition.binding-pattern.array.tsx + pop: true + - include: parameter-binding-element + - include: punctuation-comma + parameter-binding-element: + - include: comment + - include: string + - include: parameter-object-binding-pattern + - include: parameter-array-binding-pattern + - include: destructuring-parameter-rest + - include: variable-initializer + parameter-name: + - match: '(?) + )) | + ((async\s*)?( + ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + )) + )) | + # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) => + (:\s*( + (<) | + ([(]\s*( + ([)]) | + (\.\.\.) | + ([_$[:alnum:]]+\s*( + ([:,?=])| + ([)]\s*=>) + )) + )) + )) | + (:\s*((<\s*$)|([\(]\s*([\{\[]\s*)?$))) | + (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*( + ((async\s+)?( + (function\s*[(<*]) | + (function\s+) | + ([_$[:alpha:]][_$[:alnum:]]*\s*=>) + )) | + ((async\s*)?( + ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + )) + ))) + captures: + 1: storage.modifier.tsx + 2: keyword.operator.rest.tsx + 3: entity.name.function.tsx variable.language.this.tsx + 4: entity.name.function.tsx + 5: keyword.operator.optional.tsx + - match: '(?x)(?:(?]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*))?\(\s*[\{\[]\s*$)' + captures: + 1: storage.modifier.async.tsx + push: + - match: (?<=\)) + pop: true + - include: paren-expression-possibly-arrow-with-typeparameters + - match: '(?<=[(=,]|=>)\s*(async)?(?=\s*((((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*))?\()|(<))\s*$)' + captures: + 1: storage.modifier.async.tsx + push: + - match: (?<=\)) + pop: true + - include: paren-expression-possibly-arrow-with-typeparameters + - include: possibly-arrow-return-type + paren-expression-possibly-arrow-with-typeparameters: + - include: type-parameters + - match: \( + captures: + 0: meta.brace.round.tsx + push: + - match: \) + captures: + 0: meta.brace.round.tsx + pop: true + - include: expression-inside-possibly-arrow-parens + possibly-arrow-return-type: + - match: '(?<=\))\s*(:)(?=\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+\s*=>)' + captures: + 1: meta.arrow.tsx meta.return.type.arrow.tsx keyword.operator.type.annotation.tsx + push: + - meta_content_scope: meta.arrow.tsx meta.return.type.arrow.tsx + - match: '(?==>|\{|(^\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\s+))' + pop: true + - include: arrow-return-type-body + property-accessor: + - match: '(?|&&|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$]))' + captures: + 1: punctuation.definition.string.begin.tsx + push: + - meta_scope: string.regexp.tsx + - match: "(/)([gimsuy]*)" + captures: + 1: punctuation.definition.string.end.tsx + 2: keyword.other.tsx + pop: true + - include: regexp + - match: '(?' + captures: + 0: keyword.other.back-reference.regexp + 1: variable.other.regexp + - match: '[?+*]|\{(\d+,\d+|\d+,|,\d+|\d+)\}\??' + scope: keyword.operator.quantifier.regexp + - match: \| + scope: keyword.operator.or.regexp + - match: (\()((\?=)|(\?!)|(\?<=)|(\?))?' + captures: + 0: punctuation.definition.group.regexp + 1: punctuation.definition.group.no-capture.regexp + 2: variable.other.regexp + push: + - meta_scope: meta.group.regexp + - match: \) + captures: + 0: punctuation.definition.group.regexp + pop: true + - include: regexp + - match: '(\[)(\^)?' + captures: + 1: punctuation.definition.character-class.regexp + 2: keyword.operator.negation.regexp + push: + - meta_scope: constant.other.character-class.set.regexp + - match: '(\])' + captures: + 1: punctuation.definition.character-class.regexp + pop: true + - match: '(?:.|(\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\c[A-Z])|(\\.))\-(?:[^\]\\]|(\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\c[A-Z])|(\\.))' + scope: constant.other.character-class.range.regexp + captures: + 1: constant.character.numeric.regexp + 2: constant.character.control.regexp + 3: constant.character.escape.backslash.regexp + 4: constant.character.numeric.regexp + 5: constant.character.control.regexp + 6: constant.character.escape.backslash.regexp + - include: regex-character-class + - include: regex-character-class + return-type: + - match: (?<=\))\s*(:)(?=\s*\S) + captures: + 1: keyword.operator.type.annotation.tsx + push: + - meta_scope: meta.return.type.tsx + - match: "(?]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?\() + captures: + 1: punctuation.accessor.tsx + 2: punctuation.accessor.optional.tsx + 3: support.constant.dom.tsx + 4: support.variable.property.dom.tsx + - match: |- + (?x)(?\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)`)' + captures: + 1: entity.name.function.tagged-template.tsx + push: + - meta_scope: string.template.tsx + - match: (?=`) + pop: true + - include: type-arguments + - match: "([_$[:alpha:]][_$[:alnum:]]*)?(`)" + captures: + 1: entity.name.function.tagged-template.tsx + 2: punctuation.definition.string.template.begin.tsx + push: + - meta_scope: string.template.tsx + - match: "`" + captures: + 0: punctuation.definition.string.template.end.tsx + pop: true + - include: template-substitution-element + - include: string-character-escape + template-substitution-element: + - match: '\$\{' + captures: + 0: punctuation.definition.template-expression.begin.tsx + push: + - meta_scope: meta.template.expression.tsx + - meta_content_scope: meta.embedded.line.tsx + - match: '\}' + captures: + 0: punctuation.definition.template-expression.end.tsx + pop: true + - include: expression + ternary-expression: + - match: '(?!\?\.\s*[^[:digit:]])(\?)' + captures: + 1: keyword.operator.ternary.tsx + push: + - match: \s*(:) + captures: + 1: keyword.operator.ternary.tsx + pop: true + - include: expression + this-literal: + - match: '(?])|((?<=[\}>\]\)]|[_$[:alpha:]])\s*(?=\{)))' + pop: true + - include: type + - match: (:) + captures: + 1: keyword.operator.type.annotation.tsx + push: + - meta_scope: meta.type.annotation.tsx + - match: '(?])|(?=^\s*$)|((?<=\S)(?=\s*$))|((?<=[\}>\]\)]|[_$[:alpha:]])\s*(?=\{)))' + pop: true + - include: type + type-arguments: + - match: \< + captures: + 0: punctuation.definition.typeparameters.begin.tsx + push: + - meta_scope: meta.type.parameters.tsx + - match: \> + captures: + 0: punctuation.definition.typeparameters.end.tsx + pop: true + - include: type + - include: punctuation-comma + type-builtin-literals: + - match: '(?) + )) + ) + ) + ) + push: + - meta_scope: meta.type.function.tsx + - match: (?<=\)) + pop: true + - include: function-parameters + type-function-return-type: + - match: (=>)(?=\s*\S) + captures: + 1: storage.type.function.arrow.tsx + push: + - meta_scope: meta.type.function.return.tsx + - match: '(?)(?:\?]|//|$)' + pop: true + - include: type-function-return-type-core + - match: "=>" + captures: + 0: storage.type.function.arrow.tsx + push: + - meta_scope: meta.type.function.return.tsx + - match: '(?)(?]|//|^\s*$)|((?<=\S)(?=\s*$)))' + pop: true + - include: type-function-return-type-core + type-function-return-type-core: + - include: comment + - match: '(?<==>)(?=\s*\{)' + push: + - match: '(?<=\})' + pop: true + - include: type-object + - include: type-predicate-operator + - include: type + type-name: + - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))' + captures: + 1: entity.name.type.module.tsx + 2: punctuation.accessor.tsx + 3: punctuation.accessor.optional.tsx + - match: "[_$[:alpha:]][_$[:alnum:]]*" + scope: entity.name.type.tsx + type-object: + - match: '\{' + captures: + 0: punctuation.definition.block.tsx + push: + - meta_scope: meta.object.type.tsx + - match: '\}' + captures: + 0: punctuation.definition.block.tsx + pop: true + - include: comment + - include: method-declaration + - include: indexer-declaration + - include: indexer-mapped-type-declaration + - include: field-declaration + - include: type-annotation + - match: \.\.\. + captures: + 0: keyword.operator.spread.tsx + push: + - match: '(?=\}|;|,|$)|(?<=\})' + pop: true + - include: type + - include: punctuation-comma + - include: punctuation-semicolon + - include: type + type-operators: + - include: typeof-operator + - match: '(?:([&|])|(=(?!>)))(?=\s*\{)' + captures: + 1: keyword.operator.type.tsx + 2: keyword.operator.assignment.tsx + push: + - match: '(?<=\})' + pop: true + - include: type-object + - match: "([&|])|(=(?!>))" + captures: + 1: keyword.operator.type.tsx + 2: keyword.operator.assignment.tsx + push: + - match: (?=\S) + pop: true + - match: '(?) + captures: + 1: punctuation.definition.typeparameters.end.tsx + pop: true + - include: comment + - match: '(?) + )) + )) + )) | + (:\s*((<\s*$)|([\(]\s*([\{\[]\s*)?$)))) + captures: + 1: storage.modifier.tsx + 2: keyword.operator.rest.tsx + 3: entity.name.function.tsx variable.language.this.tsx + 4: entity.name.function.tsx + 5: keyword.operator.optional.tsx + - match: '(?x)(?:(?) + )) | + ((async\s*)?( + ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + )) + )) | + # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) => + (:\s*( + (<) | + ([(]\s*( + ([)]) | + (\.\.\.) | + ([_$[:alnum:]]+\s*( + ([:,?=])| + ([)]\s*=>) + )) + )) + )) | + (:\s*((<\s*$)|([\(]\s*([\{\[]\s*)?$))) | + (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*( + ((async\s+)?( + (function\s*[(<*]) | + (function\s+) | + ([_$[:alpha:]][_$[:alnum:]]*\s*=>) + )) | + ((async\s*)?( + ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + )) + ))) + captures: + 1: meta.definition.variable.tsx variable.other.constant.tsx entity.name.function.tsx + push: + - meta_scope: meta.var-single-variable.expr.tsx + - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))' + pop: true + - include: var-single-variable-type-annotation + - match: "([_$[:alpha:]][_$[:alnum:]]*)" + captures: + 1: meta.definition.variable.tsx variable.other.constant.tsx + push: + - meta_scope: meta.var-single-variable.expr.tsx + - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))' + pop: true + - include: var-single-variable-type-annotation + var-single-variable: + - match: |- + (?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\s* + # function assignment | + (=\s*( + ((async\s+)?( + (function\s*[(<*]) | + (function\s+) | + ([_$[:alpha:]][_$[:alnum:]]*\s*=>) + )) | + ((async\s*)?( + ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + )) + )) | + # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) => + (:\s*( + (<) | + ([(]\s*( + ([)]) | + (\.\.\.) | + ([_$[:alnum:]]+\s*( + ([:,?=])| + ([)]\s*=>) + )) + )) + )) | + (:\s*((<\s*$)|([\(]\s*([\{\[]\s*)?$))) | + (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*( + ((async\s+)?( + (function\s*[(<*]) | + (function\s+) | + ([_$[:alpha:]][_$[:alnum:]]*\s*=>) + )) | + ((async\s*)?( + ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) | + # sure shot arrow functions even if => is on new line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? + [(]\s* + ( + ([)]\s*:) | # (): + ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param: + ) + ) | + ( + [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends + ) | + # arrow function possible to detect only with => on same line + ( + (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters + \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters + (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type + \s*=> # arrow operator + ) + )) + ))) + captures: + 1: meta.definition.variable.tsx entity.name.function.tsx + push: + - meta_scope: meta.var-single-variable.expr.tsx + - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))' + pop: true + - include: var-single-variable-type-annotation + - match: "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])" + captures: + 1: meta.definition.variable.tsx variable.other.constant.tsx + push: + - meta_scope: meta.var-single-variable.expr.tsx + - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))' + pop: true + - include: var-single-variable-type-annotation + - match: "([_$[:alpha:]][_$[:alnum:]]*)" + captures: + 1: meta.definition.variable.tsx variable.other.readwrite.tsx + push: + - meta_scope: meta.var-single-variable.expr.tsx + - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))' + pop: true + - include: var-single-variable-type-annotation + var-single-variable-type-annotation: + - include: type-annotation + - include: string + - include: comment + variable-initializer: + - match: (?|<)=(#|\?)?|(=|!)~(#|\?)?|(>|<)(#|\?)is|isnot|\.|\*|\\|%) + scope: storage.function.viml + function: + - match: \b(fu(n|nction)?|end(f|fu|fun|function)?)\b + scope: storage.function.viml + function_call: + - match: '(([sgbwtl]|)?:?[0-9a-zA-Z_#]+)(?=\()' + scope: support.function.any-method + function_definition: + - match: '^\s*(function)\s*!?\s+(?=(s:)?[0-9a-zA-Z_#]+\s*\()' + captures: + 1: storage.function.viml + push: + - meta_scope: meta.function.viml + - match: (\() + captures: + 1: punctuation.definition.parameters.begin.viml + pop: true + - match: "(s:)?[0-9a-zA-Z_#]+" + scope: entity.name.function.viml + function_params: + - match: '-\w+=' + scope: support.type.viml + inline_comment: + - match: '(?!\$)(")(?!\{).*$\n?' + scope: comment.line.quotes.viml + captures: + 1: punctuation.definition.comment.vim + keyword: + - match: \b(if|while|for|try|return|throw|end(if|for|while|try)?|au(g|group)|else(if|)?|do|in|catch|finally|:)\b + scope: keyword.control.viml + number_hex: + - match: "0x[0-9a-f]+" + scope: constant.numeric.hex + number_int: + - match: '-?\d+' + scope: constant.numeric.integer + string_quoted_double: + - match: '"(\\\\|\\"|\n[^\S\n]*\\|[^\n"])*"' + scope: string.quoted.double.viml + string_quoted_single: + - match: '''(''''|\n[^\S\n]*\\|[^\n''])*''' + scope: string.quoted.single.viml + string_regex: + - match: '/(\\\\|\\/|\n[^\S\n]*\\|[^\n/])*/' + scope: string.regexp.viml + support_function: + - match: \b(set(local|global)?|let|command|filetype|colorscheme|\w*map|\w*a(b|brev)?|syn|exe(c|cute)?|ec(ho|)?|au(tocmd|)?)\b + scope: support.function.viml + support_type: + - match: <.*?> + scope: support.type.viml + support_variable: + - match: '\b(am(enu|)?|(hl|inc)?search|[Bb]uf([Nn]ew[Ff]ile|[Rr]ead)?|[Ff]ile[Tt]ype)\b' + scope: support.variable.viml + variable: + - match: '([sSgGbBwWlLaAvV]:|@|$|&(?!&))\w*' + scope: variable.other.viml diff --git a/assets/syntaxes/fish.sublime-syntax b/assets/syntaxes/fish.sublime-syntax new file mode 100644 index 0000000..94aefce --- /dev/null +++ b/assets/syntaxes/fish.sublime-syntax @@ -0,0 +1,1009 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: friendly interactive shell (fish) +file_extensions: + - fish +first_line_match: '^#!.*\b(fish)|^#\s*-\*-[^*]*mode:\s*shell-script[^*]*-\*-' +scope: source.shell.fish +contexts: + main: + - include: comment-external + - include: line-continuation + - match: \)|end + comment: In an ideal world, command-call-standard would be performing this match because fish highlights the strings which follow as arguments. But we can't do that in a tmLanguage + push: + - meta_scope: meta.function-call.fish invalid.illegal.function-call.fish + - match: '(?=[\s;&)|<>])' + pop: true + - match: (?=\S) + comment: Anonymous scope - Base scope pipeline goes up until one of the definitive ends (newline and ';') or the sequences that could be an end if we're actually inside a $self scope right now (')' and "end") + push: + - match: \n|(;)|(?=\))|(?=end) + captures: + 1: meta.function-call.operator.fish keyword.operator.control.fish + pop: true + - match: '(?:[&|]|(?:[0-9]+)?(?:<|>>?|\^\^?))' + comment: Match operators ('&', pipe, and redirect) which cannot start a pipeline because they must be consumed within or after a pipeline + scope: invalid.illegal.operator.fish + - include: comment-internal-end + - match: (?=\S) + comment: The reason we match '&' here is because we explicitly require it come after a command (unlike ';' which can be alone on a line) + push: + - match: '(?=[\n;)])|(&)' + captures: + 1: meta.function-call.operator.fish keyword.operator.control.fish + pop: true + - include: pipeline + argument: + - match: '(?![\s;&)|<>^])' + comment: End arg if it precedes whitespace or operators (excluding stderr redirect '^' due to a fish quirk) + push: + - match: '(?=[\s;&)|<>])' + pop: true + - match: \% + comment: Process expansion only occurs if the '%' is at the front of the argument, and continues for the entire argument + captures: + 0: meta.string.unquoted.fish punctuation.definition.process.fish + push: + - meta_scope: meta.parameter.argument.process-expansion.fish + - match: '(?=[\s;&)|<>])' + pop: true + - match: '(?:self|last)(?=$|[\s;&)|<>])' + comment: Match special process names. By a convention that I'm making up, scope them as a type of variable + scope: meta.string.unquoted.fish variable.language.fish + - include: parameter-patterns + - match: '(?:[+-]?)(?:[0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+)(?=$|[\s;&)|<>])' + comment: Treat a sequence of integers (with possible sign and decimal separator) as a standalone constant. Do this separate to the + scope: meta.parameter.argument.numeric.fish meta.string.unquoted.fish constant.numeric.fish + - match: '(?![\s($])' + comment: This scope can be used by plugins to locate arguments which don't *start* with command substitution or variable expansion and may directly resolve to file paths. Of course, they could have command substitution or variable expansion further on in them, but looking ahead for that too is nontrivial + push: + - meta_scope: meta.parameter.argument.path.fish + - match: '(?=[\s;&)|<>])' + pop: true + - match: \~ + comment: Home directory expansion only occurs if the '~' is at the front of the argument, so check it first + scope: meta.string.unquoted.fish keyword.operator.tilde.fish + - include: parameter-patterns + - match: (?!\s) + comment: Use standard parameter patterns for whatever doesn't match the above + push: + - meta_scope: meta.parameter.argument.fish + - match: '(?=[\s;&)|<>])' + pop: true + - include: parameter-patterns + command-call-meta: + - match: '(builtin|command|exec)\b(?!\s+[-&|])' + comment: These meta commands force the parameter to behave as a standard command. They stop at piping + captures: + 1: support.function.fish + push: + - match: |- + (?x) + (?# Look ahead for control operations after whitespace) + (?=\s* + (?: + (?# Find simple control operations) + [\n;&)] + | + (?# Find piping) + (?:(?:[0-9]+)?(?:<|>>?|\^\^?))?\| + ) + ) + pop: true + - include: line-continuation + - include: command-call-standard + - match: '(not)\b(?!\s+[-&|])' + comment: This meta command acts as a unary operator on the command to the right, which can also be a meta command. It only applies to one command and stops at piping + captures: + 1: keyword.operator.word.fish + push: + - match: |- + (?x) + (?# Look ahead for control operations after whitespace) + (?=\s* + (?: + (?# Find simple control operations) + [\n;&)] + | + (?# Find piping) + (?:(?:[0-9]+)?(?:<|>>?|\^\^?))?\| + ) + ) + pop: true + - include: line-continuation + - include: command-call-meta + - include: command-call-standard + command-call-standard: + - match: '\#' + comment: A command call can't be a comment, but this match will only be satisfied if the command is first after a pipe because comments are otherwise consumed earlier + push: + - meta_scope: invalid.illegal.function-call.fish + - match: '(?=[\n)])' + pop: true + - match: "(?:[&|<>^])" + comment: Match an operator which cannot start a command call but does not stop the next characters from being interpreted as a command + scope: invalid.illegal.operator.fish + - match: (?=\S) + comment: Anonymous scope - A complete command comprising a name element and optional parameter, redirection, and comment elements + push: + - match: |- + (?x) + (?# Look ahead for operators) + (?= + (?: + (?# Find a control operator) + [\n;&)] + | + (?# Find a pipe operator) + (?:(?:[0-9]+)?(?:<|>>?|\^\^?))?\| + ) + ) + pop: true + - match: '(?![\s<>^%])' + comment: Anonymous scope - A name or block element. If a block is found, everything up to the `end` command is captured here. Note that redirection and process expansion can't start the element + push: + - match: '(?=[\s;&)|<>])' + pop: true + - include: command-call-standard-block + - match: '\[(?=[\s<>]|\\\n)' + comment: "Look for the alternate form of test, which uses a matching pair of '[' ']'" + captures: + 0: support.function.test.begin.fish + push: + - match: '(\])|(\n|[;&)|].*)' + captures: + 1: support.function.test.end.fish + 2: invalid.illegal.function-call.fish + pop: true + - include: line-continuation + - include: parameter + - include: redirection + - match: '(?:break|continue|return)(?=[\s;&)|<>])' + comment: Look for loop/function control commands. We perform no checking on the validity of their scope (because only allowing them in the correct scope won't work if they are used within if-blocks) or parameters (because fish does that during execution not parsing) + captures: + 0: keyword.control.conditional.fish + - match: (?!\s) + comment: Anonymous scope - A generic name element + push: + - match: '(?=[\s;&)|<>])' + pop: true + - match: (?=\() + comment: fish would match the whole command name invalid if there was a command substitution anywhere in it, but we can't look ahead that effectively + push: + - meta_scope: invalid.illegal.function-call.fish + - match: '(?=[\s;&)|<>])' + pop: true + - match: \( + push: + - match: '\)|(?=[\n;&)|<>])' + pop: true + - match: (?!\s) + comment: Otherwise, treat the element as a fraction of a name made of arbitrary strings (which breaks at an escaped newline) + push: + - meta_scope: variable.function.fish + - match: '(?=[\s;&()|<>])' + pop: true + - match: \$ + comment: The string scope explicitly forbids '$' so that the argument rule can pick it up as a variable expansion, but '$' is treated as a literal in command names, so we have to match it separately + scope: meta.string.unquoted.fish + - include: string + - match: \% + comment: A command name can't begin with a process expansion operator (however the variable expansion operator '$' is allowed) + push: + - meta_scope: invalid.illegal.function-call.fish + - match: '(?=[\s;&)|<>])' + pop: true + - include: string + - include: redirection + - match: '(?:[^\n\S]+)' + comment: Match any whitespace characters that aren't the newline + push: + - match: |- + (?x) + (?# Look ahead for operators) + (?= + (?: + (?# Find a control operator) + [\n;&)] + | + (?# Find a pipe operator) + (?:(?:[0-9]+)?(?:<|>>?|\^\^?))?\| + ) + ) + pop: true + - match: '(?!--[\s;&)|<>])' + comment: A list of elements that does not start with an end-of-options parameter + push: + - match: |- + (?x) + (?# Look ahead for operators or the end of options) + (?= + (?: + (?# Find a control operator) + [\n;&)] + | + (?# Find a pipe operator) + (?:(?:[0-9]+)?(?:<|>>?|\^\^?))?\| + | + (?# Find a double hyphen) + --[\s;&)|<>] + ) + ) + pop: true + - include: line-continuation + - include: comment-internal-end + - include: redirection + - include: parameter + - match: '(?=--[\s;&)|<>])' + comment: A list of elements that starts with an end-of-options parameter + push: + - match: |- + (?x) + (?# Look ahead for operators) + (?= + (?: + (?# Find a control operator) + [\n;&)] + | + (?# Find a pipe operator) + (?:(?:[0-9]+)?(?:<|>>?|\^\^?))?\| + ) + ) + pop: true + - match: '(?=--[\s;&)|<>])' + comment: Contain just the end-of-options parameter and give it the normal scope + push: + - match: '(?=[\s;&)|<>])' + pop: true + - include: parameter + - match: (?=\s) + comment: A list of elements (now forcibly using arguments) + push: + - match: |- + (?x) + (?# Look ahead for operators) + (?= + (?: + (?# Find a control operator) + [\n;&)] + | + (?# Find a pipe operator) + (?:(?:[0-9]+)?(?:<|>>?|\^\^?))?\| + ) + ) + pop: true + - include: line-continuation + - include: comment-internal-end + - include: redirection + - include: argument + command-call-standard-block: + - match: '(begin|while|if|for|switch|function)\s*([&|<>])' + comment: Block commands cannot be backgrounded, piped, or redirected + captures: + 1: variable.function.fish + 2: invalid.illegal.operator.fish + - match: (begin)\s*(\)) + comment: The begin command uniquely cannot be the last command in a command substitution + captures: + 1: variable.function.fish + 2: invalid.illegal.operator.fish + - match: 'begin(?=\s*$|\s*[\n;]|\s+[^\s-])' + comment: The begin command can be alone on a line or followed by any command that doesn't start with a '-'. If a '-' is seen it shouldn't be treated as a block + captures: + 0: keyword.control.conditional.fish + push: + - meta_scope: meta.block.begin.fish + - match: 'end(?=$|[\s;&)|<>])' + captures: + 0: keyword.control.conditional.fish + pop: true + - include: main + - match: '(?=while\s+[^\s;)-])' + comment: If the command name is followed by a valid string (not anything that closes the scope or a string starting with a '-') then open the scope + push: + - meta_scope: meta.block.while.fish + - match: 'end(?=$|[\s;&)|<>])' + captures: + 0: keyword.control.conditional.fish + pop: true + - match: while + comment: Anonymous scope - Capture the command name we know is there, include a single instance of a pipeline, and end when an operator is seen + captures: + 0: keyword.control.conditional.fish + push: + - match: '\s*(?=[\n;&)])' + pop: true + - include: line-continuation + - include: pipeline + - match: '\n|(;)|([&)])' + comment: Anonymous scope - Capture the operator we know is there, include the base scope, and end when an `end` command is seen + captures: + 1: keyword.operator.control.fish + 2: invalid.illegal.operator.fish + push: + - match: '(?=end(?:$|[\s;&)|<>]))' + pop: true + - include: main + - match: '(?=if\s+[^\s;)-])' + comment: If the command name is followed by a valid string (not anything that closes the scope or a string starting with a '-') then open the scope + push: + - meta_scope: meta.block.if.fish + - match: 'end(?=$|[\s;&)|<>])' + captures: + 0: keyword.control.conditional.fish + pop: true + - include: command-call-standard-block-if-internal + - match: '(?=for\s+[^\s;)-])' + comment: If the command name is followed by a valid string (not anything that closes the scope or a string starting with a '-') then open the scope + push: + - meta_scope: meta.block.for-in.fish + - match: 'end(?=$|[\s;&)|<>])' + captures: + 0: keyword.control.conditional.fish + pop: true + - match: (for)(?:\s+) + comment: Anonymous scope - Capture the command name we know is there, include a single instance of a parameter (the varname), and end when the whitespace after the varname is captured + captures: + 1: keyword.control.conditional.fish + push: + - match: \s+ + pop: true + - include: line-continuation + - include: parameter + - match: \S+ + comment: Capture anything that a parameter explicitly rejects, which is mostly operators + scope: invalid.illegal.operator.fish + - include: line-continuation + - match: in(?=\s) + comment: Anonymous scope - Capture the command name which might be there, include an arbitrary number of arguments, and end when the control operator is seen + captures: + 0: keyword.control.conditional.fish + push: + - match: '\s*(?=[\n;&)])' + pop: true + - include: line-continuation + - include: comment-internal-end + - include: argument + - match: '\n|(;)|([&)])' + comment: Anonymous scope - Capture the operator we know is there, include the base scope, and end when an `end` command is seen + captures: + 1: keyword.operator.control.fish + 2: invalid.illegal.operator.fish + push: + - match: '(?=end(?:$|[\s;&)|<>]))' + pop: true + - include: main + - match: '\S+?(?=[\s;&)])' + comment: Anything beside line continuation, "in", or a control operator is invalid + scope: invalid.illegal.function-call.fish + - match: '(?=switch\s+[^\s;)-])' + comment: If the command name is followed by a valid string (not anything that closes the scope or a string starting with a '-') then open the scope + push: + - meta_scope: meta.block.switch.fish + - match: 'end(?=$|[\s;&)|<>])' + captures: + 0: keyword.control.conditional.fish + pop: true + - match: (?=switch) + comment: Anonymous scope - Match the valid part of the switch statement, then look for an invalid part + push: + - match: '\s*(?=[\n;&)])' + pop: true + - match: (switch)(?:\s+) + comment: Anonymous scope - Capture the command name we know is there, include a single instance of a parameter (the value), and end when whitespace or a control operator is seen + captures: + 1: keyword.control.conditional.fish + push: + - match: '(?=[\s;&)])' + pop: true + - include: line-continuation + - include: parameter + - match: \S+ + comment: Capture anything that a parameter explicitly rejects, which is mostly operators + scope: invalid.illegal.operator.fish + - match: \s+ + comment: Anonymous scope - Capture whitespace which might be there, match any non-control-operator strings as invalid, and end when a control operator is seen + push: + - match: '(?=[\n;&)])' + pop: true + - match: '\S+?(?=[\s;&)])' + scope: invalid.illegal.string.fish + - match: '\n|(;)|([&)])' + comment: Anonymous scope - Capture the operator we know is there, include the base scope, and end when an `end` command is seen + captures: + 1: keyword.operator.control.fish + 2: invalid.illegal.operator.fish + push: + - match: '(?=end(?:$|[\s;&)|<>]))' + pop: true + - match: 'case(?=[\s;&)])' + comment: Anonymous scope - Capture the command name which might be there, include an arbitrary number of arguments, and end when the control operator is captured + captures: + 0: keyword.control.conditional.fish + push: + - match: '\n|(;)|([&)])' + captures: + 1: keyword.operator.control.fish + 2: invalid.illegal.operator.fish + pop: true + - include: line-continuation + - include: comment-internal-end + - include: argument + - match: '\S+?(?=[\s;&)])' + comment: Anything else (eg, redirection) is illegal + scope: invalid.illegal.operator.fish + - include: main + - match: '(?=function\s+[^\s;)-])' + comment: If the command name is followed by a valid string (not anything that closes the scope or a string starting with a '-') then open the scope + push: + - meta_scope: meta.block.function.fish + - match: 'end(?=$|[\s;&)|<>])' + captures: + 0: keyword.control.conditional.fish + pop: true + - match: (?=function) + comment: Anonymous scope - Match the defined name of the function statement, then look for further parameters + push: + - match: '\s*(?=[\n;&)])' + pop: true + - match: (function)(?:\s+) + comment: Anonymous scope - Capture the command name we know is there, include a single instance of a parameter (the value), and end when whitespace or a control operator is seen + captures: + 1: keyword.control.conditional.fish + push: + - match: '(?=[\s;&)])' + pop: true + - include: line-continuation + - match: "(?:[()|<>])" + push: + - meta_scope: invalid.illegal.string.fish + - match: '(?=[\s;&)])' + pop: true + - match: (?!\\\n) + comment: Anonymous scope - Start when an escaped newline isn't present, and end when whitespace or an operator is seen + push: + - match: '(?=[\s;&()|<>])' + pop: true + - match: (?!\s) + push: + - meta_scope: entity.name.function.fish + - match: '(?=[\s;&()|<>])' + pop: true + - include: parameter + - match: \s+ + comment: Anonymous scope - Capture whitespace which might be there, then match anything normal for a command call + push: + - match: '(?=[\n;&)])' + pop: true + - include: line-continuation + - include: comment-internal-end + - include: redirection + - include: parameter + - match: '\n|(;)|([&)])' + comment: Anonymous scope - Capture the operator we know is there, include the base scope, and end when an `end` command is seen + captures: + 1: keyword.operator.control.fish + 2: invalid.illegal.operator.fish + push: + - match: '(?=end(?:$|[\s;&)|<>]))' + pop: true + - include: main + command-call-standard-block-if-internal: + - match: '(?=if(?:\s*\n|\s+[^\s;]))' + comment: Anonymous scope - Capture an `if` and the command up to the control operator, then capture from the control operator indefinitely + push: + - match: '(?=end(?:$|[\s;&)|<>]))' + pop: true + - match: if + comment: Anonymous scope - Match the command name we know is there, include a single instance of a pipeline, and end when a control operator is seen + captures: + 0: keyword.control.conditional.fish + push: + - match: '\s*(?=[\n;&])' + pop: true + - include: line-continuation + - include: pipeline + - match: \n|(;)|(&) + comment: Anonymous scope - Match the operator we know is there, then include the base scope or an `else` structure + captures: + 1: keyword.operator.control.fish + 2: invalid.illegal.operator.fish + push: + - match: '(?=end(?:$|[\s;&)|<>]))' + pop: true + - match: '(?=else\s*[\s;])' + comment: Anonymous scope - Capture an `else` up to the control operator or the start of an `if` structure, then match from the control operator indefinitely or match an `if` structure + push: + - match: '(?=end(?:$|[\s;&)|<>]))' + pop: true + - match: 'else(?=\s*[\s;])' + comment: Anonymous scope - Match the `else` we know is there and any comment, and mark anything besides an `if` as illegal + captures: + 0: keyword.control.conditional.fish + push: + - match: '\s*(?=[\n;&]|if(?:\s*\n|\s+[^\s;]))' + pop: true + - include: line-continuation + - include: comment-internal-end + - match: '\S+?(?=[\s;&])' + comment: Anything else is illegal + scope: invalid.illegal.string.fish + - match: \n|(;)|(&) + comment: Anonymous scope - Match the operator which will be there if no `if` was seen, then include the base scope which marks further `else` commands as invalid + captures: + 1: keyword.operator.control.fish + 2: invalid.illegal.operator.fish + push: + - match: '(?=end(?:$|[\s;&)|<>]))' + pop: true + - include: main + - include: command-call-standard-block-if-internal + - include: main + command-substitution: + - match: (?=\() + comment: 'Capture "(...)" or "(...)[...]"' + push: + - match: '(?![\(\[])' + pop: true + - match: \( + captures: + 0: punctuation.section.parens.begin.fish + push: + - meta_scope: meta.parens.command-substitution.fish + - match: \) + captures: + 0: punctuation.section.parens.end.fish + pop: true + - include: main + - include: index-expansion + comment-external: + - match: '\#' + comment: A full or inline comment outside of any command call + captures: + 0: punctuation.definition.comment.fish + push: + - meta_scope: comment.line.external.fish + - match: \n + pop: true + comment-internal-end: + - match: '\#' + comment: An inline comment at the end of a command call. Does not consume the newline, thus allowing the command call to capture it and end + captures: + 0: punctuation.definition.comment.fish + push: + - meta_scope: comment.line.internal.end.fish + - match: (?=\n) + pop: true + index-expansion: + - match: '\[' + comment: In other words, the anonymous scope which contains the variable and the index expansion parameter list should only be allowed to contain a single copy of each of those two things. We cannot enforce that without a scope stack. Our workaround is to allow an infinite number of these and hope the user can keep track of when there are too many + captures: + 0: punctuation.section.brackets.begin.fish + push: + - meta_scope: meta.brackets.index-expansion.fish + - match: '\]' + captures: + 0: punctuation.section.brackets.end.fish + pop: true + - match: \.\. + scope: keyword.operator.range.fish + - include: command-substitution + - include: variable-expansion + - include: string-quoted + - match: '(?:[+-]?[0-9]+)(?=[\s;&)|<>]|\]|\.\.)' + scope: constant.numeric.fish + - match: '(?![\s''"]|\.\.)' + comment: 'Begin/end string as before with the addition of breaking at a '']'' or ".."' + push: + - match: '(?=[\s;&)|<>''"]|\]|\.\.)' + pop: true + - include: string-unquoted-patterns + line-continuation: + - match: (?=\\\n) + comment: End when an unescaped newline is seen, the first character of a line isn't whitespace or a comment character or the escaped newline itself, or if the next character after some consumed whitespace isn't more whitespace or a comment character + push: + - match: '(?=\n)|^(?![\s\#\\])|\s(?![\s\#])' + pop: true + - match: \\\n + scope: constant.character.escape + - match: '\#' + captures: + 0: punctuation.definition.comment.fish + push: + - meta_scope: comment.line.continuation.fish + - match: \n + pop: true + parameter: + - match: '(?![\s;&)|<>^])' + comment: See the argument rule for more general information on parameters + push: + - match: '(?=[\s;&)|<>])' + pop: true + - match: '(?:--)(?=[\s;&)|<>])' + comment: End of options (parameter of just two hyphens) + scope: meta.parameter.option.end.fish variable.parameter.fish punctuation.definition.option.end.fish meta.string.unquoted.fish + - match: (?=--) + comment: Long option (parameter starting with two hyphens) + push: + - meta_scope: meta.parameter.option.long.fish + - match: '(?=[\s;&)|<>])' + pop: true + - match: (?:--) + captures: + 0: punctuation.definition.option.long.begin.fish meta.string.unquoted.fish + push: + - meta_scope: variable.parameter.fish + - match: '(?=[\s;&)|<>]|=)' + pop: true + - include: command-substitution + - match: (?=\$) + push: + - meta_scope: meta.string.unquoted.fish + - match: (?!\$) + pop: true + - include: variable-expansion + - include: string-quoted + - match: '(?![''"])' + push: + - meta_scope: meta.string.unquoted.fish + - match: '(?=[\s;&()|<>''"$]|\=)' + pop: true + - include: string-unquoted-patterns + - match: (?:=) + comment: Consume the '=' and then use standard parameter patterns as well as numerics + captures: + 0: variable.parameter.fish punctuation.definition.option.long.separator.fish meta.string.unquoted.fish + push: + - match: '(?=[\s;&)|<>])' + pop: true + - match: '(?:[+-]?)(?:[0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+)(?=$|[\s;&)|<>])' + scope: meta.string.unquoted.fish constant.numeric.fish + - include: parameter-patterns + - match: '(?:-)(?=[^\s;&)|<>])' + comment: Short option (parameter starting with one hyphen) + captures: + 0: punctuation.definition.option.short.fish meta.string.unquoted.fish + push: + - meta_scope: meta.parameter.option.short.fish variable.parameter.fish + - match: '(?=[\s;&)|<>])' + pop: true + - include: parameter-patterns + - include: argument + parameter-patterns: + - include: command-substitution + - match: (?=\$) + comment: Give variable expansion the unquoted string scope + push: + - meta_scope: meta.string.unquoted.fish + - match: (?!\$) + pop: true + - include: variable-expansion + - include: string + pipeline: + - match: '(?:[&|]|(?:[0-9]+)?(?:<|>>?|\^\^?))' + comment: Todo - Restructure pipeline so that this match isn't duplicated from the base scope, which it must also be for any other scopes which implement their own control operator consumption. Might require the unary operator commands to become an explicit recursive match (though we tried this once and it was more complicated than anything should be) + scope: invalid.illegal.operator.fish + - match: (and|or)\b(?!\s+-) + comment: Todo - These commands cannot be followed by backgrounding, piping, or redirection alone. Add logic to catch these cases. It will be extensive... + scope: meta.function-call.fish keyword.operator.word.fish + - include: line-continuation + - match: (not)\b(?!\s+-) + comment: This is a hack for now, which allows nesting of 'not' and 'and'/'or' commands. A better solution will be explicit recursivity in these commands + scope: meta.function-call.fish keyword.operator.word.fish + - match: '(?:case|else|end)(?=[\s;&)|<>])' + comment: Match a command which is illegal in the base scope + scope: invalid.illegal.function-call.fish + - match: '(?=[^\s#])' + comment: Anonymous scope - Pipeline. Define a pipeline as either one command call, or multiple command calls linked by pipe operators ('|', '2>|', etc). The pipeline terminates at the first encounter of any control operator + push: + - match: '(\s*)(?=[\n;&)])' + captures: + 1: meta.function-call.fish + pop: true + - match: |- + (?x) + (?# Negative lookahead for piping) + (?! + (?:(?:[0-9]+)?(?:<|>>?|\^\^?))?\| + ) + comment: Match the first command of a potential pipeline + push: + - meta_scope: meta.function-call.fish + - match: |- + (?x) + (?# Look ahead for operators after whitespace) + (?=\s* + (?: + (?# Find a control operator) + [\n;&)] + | + (?# Find a pipe operator) + (?:(?:[0-9]+)?(?:<|>>?|\^\^?))?\| + ) + ) + pop: true + - include: command-call-meta + - include: command-call-standard + - match: |- + (?x) + (?# Look ahead for piping) + (?= + (?:(?:[0-9]+)?(?:<|>>?|\^\^?))?\| + ) + comment: Match a second or later command of a pipeline, starting with the connective piping + push: + - meta_scope: meta.function-call.fish + - match: '(?=\s*[\n;&)])' + pop: true + - match: |- + (?x) + (?# Look ahead for piping followed by either control operators or piping) + (?= + (?:(?:[0-9]+)?(?:<|>>?|\^\^?))?\| + \s* + (?: + $ + | + [\n;&)] + | + (?:(?:[0-9]+)?(?:<|>>?|\^\^?))?\| + ) + ) + comment: Match a pipe not followed by a command, hence a malformed segment of the pipeline + push: + - match: '(?=\s*$|\s*[\n;&)])' + pop: true + - match: '(?:(?:[0-9]+)?(?:<|>|>>))?\|(?=\s*$|\s*[\n)])' + comment: If the pipeline would end implicitly (ie, with a newline or close parenthesis), then mark the pipe itself invalid + scope: invalid.illegal.operator.fish + - match: |- + (?x) + (?# Consume valid piping; captures 1 2 3) + (?:([0-9]+)?(<|>>?|\^\^?))?(\|) + (?# Consume whitespace) + \s* + (?# Consume remainder; capture 4) + (.*) + comment: If the pipeline would end with an explicit operator or encounter a second set of piping, then mark the first set of piping as valid and beyond as invalid + captures: + 1: meta.pipe.fish constant.numeric.file-descriptor.fish + 2: meta.pipe.fish keyword.operator.redirect.fish + 3: meta.pipe.fish keyword.operator.pipe.fish + 4: invalid.illegal.function-call.fish + - match: '(?:([0-9]+)?(<|>>?|\^\^?))?(\|)' + comment: Pick up a legitimate pipe + scope: meta.pipe.fish + captures: + 1: constant.numeric.file-descriptor.fish + 2: keyword.operator.pipe.redirect.fish + 3: keyword.operator.pipe.fish + - include: line-continuation + - include: command-call-meta + - include: command-call-standard + redirection: + - match: '(?=(?:[0-9]+(?:<|>|>>)|>>|\^\^|[<>^])\&)' + comment: End at anything that would end a parameter, including redirections *if* they are *not* this same type of redirection (ie, have an '&'), in which case this scope stays open and we match the next one. The negative lookahead for <>^ at the end is to keep ST2 happy (not hanging) + push: + - match: '(?=[\s;&)|]|(?:[0-9]+(?:<|>|>>)|>>|\^\^|[<>^])(?![&<>^]))' + pop: true + - match: '(?:([0-9]+)(<|>|>>)|(>>|\^\^|[<>^]))(\&)\s*' + comment: We have to try and catch an '&' here because if it is seen by the outer end match then it will be considered a valid operator and the redirection scope will immediately terminate + captures: + 1: constant.numeric.file-descriptor.fish + 2: keyword.operator.redirect.fish + 3: keyword.operator.redirect.fish + 4: keyword.operator.redirect.dereference.fish + push: + - meta_scope: meta.redirection.fish + - match: '(\&.*$)|(?![&\\])' + captures: + 1: invalid.illegal.file-descriptor.fish + pop: true + - include: line-continuation + - match: (?=\\\n) + push: + - meta_scope: meta.redirection.fish + - match: (?!\\\n) + pop: true + - include: line-continuation + - match: (?=\() + comment: Evaluates to a string which may be an integer + push: + - meta_scope: meta.redirection.fish + - match: (?!\() + pop: true + - include: command-substitution + - match: (?=\$) + comment: Evaluates to a string which may be an integer + push: + - meta_scope: meta.redirection.fish + - match: (?!\$) + pop: true + - include: variable-expansion + - match: '(?=[''"])' + comment: May be a quoted integer, which is allowed + push: + - meta_scope: meta.redirection.fish + - match: '(?![''"])' + pop: true + - include: string-quoted + - match: '(?:[0-9]+)(?=$|[\s;&)|<>])' + scope: meta.redirection.file-descriptor.fish constant.numeric.file-descriptor.fish + - match: '(?:-)(?=$|[\s;&)|<>])' + scope: meta.redirection.file-descriptor.fish keyword.operator.redirect.close.fish + - match: (?:\S+.*)$ + comment: Anything else is illegal + scope: meta.redirection.fish invalid.illegal.file-descriptor.fish + - match: '(?=(?:[0-9]+(?:<|>|>>)|>>|\^\^|[<>^])\??)' + comment: End at anything that would end a parameter, including redirections *if* they are *not* this same type of redirection (ie, redirection into file descriptor, or into pipe), in which case this scope stays open and we match the next one + push: + - match: '(?=[\s;&)|]|(?:[0-9]+(?:<|>|>>)|>>|\^\^|[<>^])[&|])' + pop: true + - match: '(?:([0-9]+)(<|>|>>)|(>>|\^\^|[<>^]))(\?)?\s*' + comment: We have to try and catch bad operators here because if they are seen by the outer end match then they will be considered valid and the redirection scope will immediately terminate + captures: + 1: constant.numeric.file-descriptor.fish + 2: keyword.operator.redirect.fish + 3: keyword.operator.redirect.fish + 4: keyword.operator.redirect.clobber-test.fish + push: + - meta_scope: meta.redirection.fish + - match: "((?:[&?]|[0-9]*[<>^]).*$)|(?![&?<>^])" + captures: + 1: invalid.illegal.path.fish + pop: true + - include: line-continuation + - match: (?=\\\n) + push: + - meta_scope: meta.redirection.fish + - match: (?!\\\n) + pop: true + - include: line-continuation + - match: (?=\() + comment: Evaluates to a string, so path cannot begin with '(' + push: + - meta_scope: meta.redirection.fish + - match: (?!\() + pop: true + - include: command-substitution + - match: (?=\$) + comment: Evaluates to a string, so path cannot begin with '$' + push: + - meta_scope: meta.redirection.fish + - match: (?!\$) + pop: true + - include: variable-expansion + - match: "(?:[&?]|[0-9]*[<>^]).*$" + comment: Check for characters which are associated with redirection, so path cannot begin with them. Don't put them in the meta.redirection.path scope, so that only valid paths are in there + scope: meta.redirection.fish invalid.illegal.path.fish + - match: \~ + scope: meta.redirection.path.fish keyword.operator.tilde.fish + - match: '(?:\''(?:\\[\''\\]|[^\''\\])*\''|\"(?:\\[\"$\n\\]|[^\"$\n\\])*\"|(?:\\[abefnrtv $\\*?#(){}\[\]<>^&;|"'']|\\[~%]|\\[xX][0-9A-Fa-f]{1,2}|\\[0-7]{1,3}|\\u[0-9A-Fa-f]{1,4}|\\U[0-9A-Fa-f]{1,8}|\\c[?-~]|[^\s$\\*?~%#()<>&|;"'']|\\(?=[^abefnrtv\s$\\*?#(){}\[\]<>^&;|"''xXuUc])|\\\n|[~%#])+)+' + comment: Use the function call match to build a file path, as the syntax is fairly similar (possibly identical, after exceptions caught above? I haven't checked) + scope: meta.redirection.path.fish + string: + - include: string-quoted + - include: string-unquoted + string-quoted: + - match: \' + captures: + 0: punctuation.definition.string.begin.fish + push: + - meta_scope: string.quoted.single.fish + - match: \' + captures: + 0: punctuation.definition.string.end.fish + pop: true + - match: '\\[\''\\]' + comment: Only accepted escapes are \' and \\ + scope: constant.character.escape.fish + - match: \" + captures: + 0: punctuation.definition.string.begin.fish + push: + - meta_scope: string.quoted.double.fish + - match: \" + captures: + 0: punctuation.definition.string.end.fish + pop: true + - match: '\\[\n\"\\$]' + comment: Only accepted escapes are \, \", \\, and \$ + scope: constant.character.escape.fish + - include: variable-expansion + string-unquoted: + - match: '(?![\s;&()|<>''"$])' + comment: End unquoted string at anything that can't be in one + push: + - meta_scope: meta.string.unquoted.fish + - match: '(?=[\s;&()|<>''"$])' + pop: true + - include: string-unquoted-patterns + string-unquoted-patterns: + - match: |- + (?x) + \\[abefnrtv $\\*?#(){}\[\]<>^&|;"'] + | + \\[~%] + | + \\[xX][0-9A-Fa-f]{1,2} + | + \\[0-7]{1,3} + | + \\u[0-9A-Fa-f]{1,4} + | + \\U[0-9A-Fa-f]{1,8} + | + \\c[?-~] + comment: This list follows the order given in official fish documentation. Technically '~' and '%' only need escaping if they appear at the front of a parameter. If they are escaped within a parameter, then fish does not *highlight* the escape, however it does silently *parse* the escape and the backslash is removed before the parameter is passed to the command. So, we highlight these escapes as well since they are actually treated as valid escapes by fish + scope: constant.character.escape.fish + - match: \\\n + comment: Just for convenience we separate the newline escape + scope: constant.character.escape.fish + - match: '\{' + captures: + 0: punctuation.section.braces.begin.fish + push: + - meta_scope: meta.braces.brace-expansion.fish + - match: '(\})|(\n|[;&)|].*)' + captures: + 1: punctuation.section.braces.end.fish + 2: invalid.illegal.punctuation.section.fish + pop: true + - match: \, + scope: punctuation.section.braces.separator.fish + - include: command-substitution + - include: variable-expansion + - match: '(?:[^\S\n]+)' + comment: Unescaped spaces aren't allowed, as technically that separates the braces into two separate arguments. Don't consume a newline though, so the scope end capture can get it + scope: invalid.illegal.whitespace.fish + - include: string-quoted + - match: '(?:[+-]?)(?:[0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+)(?=$|[\s;&)|<>]|\}|\,)' + scope: constant.numeric.fish + - match: '(?![\s;&)|<>''"])' + comment: "Begin/end string as before with the addition of breaking at a '}' or ','" + push: + - match: '(?=[\s;&)|<>''"]|\}|\,)' + pop: true + - match: \\\, + scope: constant.character.escape.fish + - include: string-unquoted-patterns + - match: (\*\*)|(\*)|(\?) + scope: meta.wildcard-expansion.fish + captures: + 1: keyword.operator.double-star.fish + 2: keyword.operator.single-star.fish + 3: keyword.operator.question-mark.fish + variable-expansion: + - include: variable-expansion-illegal + - match: (?=\$) + comment: 'Capture "$foo" or "$foo[]" or "$$foo[][]" etc' + push: + - meta_scope: meta.variable-expansion.fish + - match: '(?=[^\$\w\[])' + pop: true + - match: \$ + captures: + 0: punctuation.definition.variable.fish + push: + - meta_scope: variable.other.fish + - match: '(?=[^\$\w])' + pop: true + - include: variable-expansion-illegal + - include: variable-expansion-simple + - include: index-expansion + variable-expansion-illegal: + - match: '\$(?:(?=[,''"\]}\s;&)|])|[^\w\$][^$,''"\]}\s;&)|]*)' + comment: A lone '$' in a scope, or an attempt to expand a variable starting with a nonword character, is an error. These boundaries are the same as for meta.string.unquoted + scope: invalid.illegal.variable-expansion.fish + variable-expansion-simple: + - match: \$ + captures: + 0: punctuation.definition.variable.fish + push: + - meta_scope: variable.other.fish + - match: '(?=[^\$\w])' + pop: true + - include: variable-expansion-illegal + - include: variable-expansion-simple diff --git a/assets/syntaxes/jsonnet.sublime-syntax b/assets/syntaxes/jsonnet.sublime-syntax new file mode 100644 index 0000000..09d37ba --- /dev/null +++ b/assets/syntaxes/jsonnet.sublime-syntax @@ -0,0 +1,122 @@ +%YAML 1.2 +--- +name: jsonnet +file_extensions: [jsonnet, libsonnet, libjsonnet] +scope: source.jsonnet + +contexts: + main: + - match: \b(\d+([Ee][+-]?\d+)?)\b + scope: constant.numeric.jsonnet + + - match: \b\d+[.]\d*([Ee][+-]?\d+)?\b + scope: constant.numeric.jsonnet + + - match: \b[.]\d+([Ee][+-]?\d+)?\b + scope: constant.numeric.jsonnet + + - match: \bstd[.](abs|acos|asciiLower|asciiUpper|asin|assertEqual|atan|base64|base64Decode|base64DecodeBytes)\b + scope: support.function.jsonnet + + - match: \bstd[.](ceil|char|codepoint|cos|count|endsWith)\b + scope: support.function.jsonnet + + - match: \bstd[.](escapeStringBash|escapeStringDollars|escapeStringJson|escapeStringPython)\b + scope: support.function.jsonnet + + - match: \bstd[.](exp|exponent|extVar|filter|filterMap|flattenArrays|floor|foldl|foldr|format)\b + scope: support.function.jsonnet + + - match: \bstd[.](isArray|isBoolean|isFunction|isNumber|isObject|isString|join|length|lines|log|makeArray)\b + scope: support.function.jsonnet + + - match: \bstd[.](manifestIni|manifestJsonEx|manifestPython|manifestPythonVars|manifestXmlJsonml|manifestYamlDoc|manifestYamlStream)\b + scope: support.function.jsonnet + + - match: \bstd[.](mantissa|map|mapWithIndex|mapWithKey|max|md5|mergePatch|min|mod)\b + scope: support.function.jsonnet + + - match: \bstd[.](objectFields|objectFieldsAll|objectHas|objectHasAll|parseInt|pow|prune|range)\b + scope: support.function.jsonnet + + - match: \bstd[.](set|setDiff|setInter|setMember|setUnion|sign|sin|sort|split|splitLimit|sqrt)\b + scope: support.function.jsonnet + + - match: \bstd[.](startsWith|stringChars|strReplace|substr|tan|toString|type|uniq)\b + scope: support.function.jsonnet + + - match: \bstd[.](native|thisFile)\b + scope: support.function.jsonnet + + - match: \b[$]\b + scope: variable.language.jsonnet + + - match: \b[a-zA-Z_][a-z0-9A-Z_]*\s*(\([^)]*\))?\s*\+?::?:? + scope: entity.name.function.jsonnet + + - match: \b(import|importstr)\b + scope: storage.type.jsonnet + + - match: \b(function)\b + scope: keyword.other.jsonnet + + - match: \b(self|super)\b + scope: variable.language.jsonnet + + - match: \b(if|then|else|for|in)\b + scope: keyword.control.jsonnet + + - match: \b(local|tailstrict)\b + scope: keyword.other.jsonnet + + - match: \b(true|false|null)\b + scope: constant.language.jsonnet + + - match: \b(error|assert)\b + scope: keyword.control.jsonnet + + - match: //.*$ + scope: comment.line.jsonnet + + - match: '#.*$' + scope: comment.block.jsonnet + + - match: /\* + push: comment + + - match: \|\|\| + push: unquoted + + - match: '"' + push: string + + - match: "\'" + push: single_string + + comment: + - meta_scope: comment.block.jsonnet + - match: \*/ + pop: true + + unquoted: + - meta_scope: string.unquoted.block.jsonnet + - match: \|\|\| + pop: true + + string: + - meta_scope: string.double.jsonnet + - match: '"' + pop: true + - match: \\(["\\/bfnrt]|(u[0-9a-fA-F]{4})) + scope: constant.character.escape.jsonnet + - match: \\[^"\\/bfnrtu] + scope: invalid.illegal.jsonnet + + single_string: + - meta_scope: string.double.jsonnet + - match: "\'" + pop: true + - match: \\(["\\/bfnrt]|(u[0-9a-fA-F]{4})) + scope: constant.character.escape.jsonnet + - match: \\[^"\\/bfnrtu] + scope: invalid.illegal.jsonnet diff --git a/assets/syntaxes/purescript.sublime-syntax b/assets/syntaxes/purescript.sublime-syntax new file mode 100644 index 0000000..27accf5 --- /dev/null +++ b/assets/syntaxes/purescript.sublime-syntax @@ -0,0 +1,387 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: PureScript +file_extensions: + - purs +scope: source.purescript +contexts: + main: + - match: ^\s*\b(module)\b + captures: + 1: keyword.other.purescript + push: + - meta_scope: meta.section.module.purescript + - match: \b(where)\b + captures: + 1: keyword.other.purescript + pop: true + - include: module-name + - match: \b(import)\b + captures: + 1: keyword.other.purescript + push: + - meta_scope: keyword.control.import.purescript + - match: '([A-Za-z0-9.]*)\s*' + captures: + 1: support.other.module.purescript + - match: \( + push: + - match: ',?\s*([A-Z][\w'']*)\s*(?:\(([A-Z][\w\s,'']*|..)\))?' + captures: + 1: entity.name.type.purescript + 2: entity.name.function.constructor.purescript + - match: ',?\s?class\s+([A-Z][\w'']*)' + captures: + 1: entity.name.typeclass.purescript + - match: ',?\s?([\w'']*)' + captures: + 1: entity.name.function + - match: \) + pop: true + - match: '(as)\s+([A-Z][\w'']*)' + captures: + 1: keyword.control.import.as + 2: support.other.module.purescript + - match: '(hiding)\s+\((?:,?\s?([A-Z][\w'']*))+\)' + meta_scope: meta.section.module.purescript + captures: + 1: keyword.control.import.hiding.purescript + - match: $ + pop: true + - include: module-name + - match: ^\s*\b(class)\b + captures: + 1: keyword.other.purescript + push: + - meta_scope: meta.declaration.typeclass.purescript + - match: \b(where)\b|$ + captures: + 1: keyword.other.purescript + pop: true + - match: '([A-Z][\w.'']*)' + scope: entity.other.inherited-class.purescript + - include: generic-tyvar + - match: ^\s*\b(instance)\b + captures: + 1: keyword.other.purescript + push: + - meta_scope: meta.declaration.instance.purescript + - match: \b(where)\b|$ + captures: + 1: keyword.other.purescript + pop: true + - include: type-signature + - match: '^\s*([a-z_][\w\d\'']*|\(.+\))\s*(::)' + captures: + 1: entity.name.function.purescript + 2: keyword.operator.has-type.purescript + push: + - meta_scope: meta.declaration.function.purescript + - match: $ + pop: true + - include: type-signature + - match: \s*(foreign)\s+(import)\s+(data)\s+(.+?)\s+(::) + scope: meta.declaration.ffi.data.purescript + captures: + 1: keyword.other.purescript + 2: keyword.other.purescript + 3: keyword.other.purescript + 4: entity.name.function.ffi.purescript + - match: \s*(foreign)\s+(import)\s+(.+?)\s+ + captures: + 1: keyword.other.purescript + 2: keyword.other.purescript + 3: entity.name.function.ffi.purescript + push: + - meta_scope: meta.declaration.ffi.function.purescript + - match: \s*(::)(.+?) + captures: + 1: keyword.operator.has-type.purescript + pop: true + - include: ffi + - include: comments + - include: reserveds + - include: constants + - include: numbers + - include: strings + - include: operator + - include: monoid + - include: prelude + - include: array + - include: eff + - include: either + - include: enum + - include: error + - include: global + - include: ioref + - include: maybe + - include: monad + - include: random + - include: regex + - include: st + - include: string + - include: trace + - include: tuple + - include: data + array: + - include: array-op + - include: array-constant + array-op: + - match: (:) + scope: keyword.operator.array.purescript + array-constant: + - match: \[\] + scope: constant.other.purescript + comments: + - match: \-\-.* + scope: comment.line.purescript + - match: '\{\-' + push: + - meta_scope: comment.block.purescript + - match: '\-\}' + pop: true + constants: + - match: \b(true|false)\b + scope: constant.language.purescript + data: + - match: '\b([A-Z]\w*)\b' + scope: constant.other.purescript + decl-ctor: + - match: '\s*([A-Z][\w\.]*?)\s+([A-Z][\w\.]*)\s*' + captures: + 1: storage.type.purescript + 2: constant.other.purescript + eff: + - include: eff-data + eff-data: + - match: \b(Effect)\b + scope: support.function.data.eff.purescript + either: + - include: either-data + - include: either-function + either-data: + - match: \b(Left|Right)\b + scope: support.function.data.either.purescript + either-function: + - match: \b(either)\b + scope: support.function.either.purescript + enum: + - include: enum-function + - include: enum-typeclass + enum-function: + - match: \b(fromEnum|toEnum)\b + scope: support.function.enum.purescript + enum-typeclass: + - match: \b(Enum)\b + scope: storage.type.enum.purescript + error: + - include: error-function + error-function: + - match: \b(catchError|throwError)\b + scope: support.function.error.purescript + ffi: + - match: '"' + push: + - match: '"' + pop: true + - include: scope:source.js + generic-tyvar: + - match: '\b([a-z][\w'']*)\b' + scope: variable.other.purescript + global: + - include: global-constant + - include: global-function + global-constant: + - match: \b(infinity|nan)\b + scope: constant.support.global.purescript + global-function: + - match: \b(decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|isFinite|isNaN|parseFloat|parseInt|toExponential|toFixed|toPrecision)\b + scope: support.function.global.purescript + ioref: + - include: ioref-data + - include: ioref-function + ioref-data: + - match: \b(IORef|Ref)\b + scope: support.function.data.ioref.purescript + ioref-function: + - match: \b(modifyIORef|newIORef|readIORef|unsafeRunIORef|writeIORef)\b + scope: support.function.ioref.purescript + maybe: + - include: maybe-data + - include: maybe-function + maybe-data: + - match: \b(Just|Nothing)\b + scope: support.function.data.maybe.purescript + maybe-function: + - match: \b(maybe|fromMaybe)\b + scope: support.function.maybe.purescript + module-name: + - match: '([A-Za-z][\w\.'']*)' + scope: support.other.module.purescript + monad: + - include: monad-function + monad-function: + - match: \b(replicateM|mapM|sequence|join|foldM|when)\b + scope: support.function.monad.purescript + monoid: + - include: monoid-function + - include: monoid-typeclass + monoid-function: + - match: \b(mconcat|mempty)\b + scope: support.function.monoid.purescript + monoid-typeclass: + - match: \b(Monoid)\b + scope: storage.type.monoid.purescript + numbers: + - match: \b([0-9]+|0([xX][0-9a-fA-F]+|[oO][0-7]+))\b + scope: constant.numeric.purescript + - match: \b([0-9]+\.[0-9]+([eE][+-]?[0-9]+)?|[0-9]+[eE][+-]?[0-9]+)\b + scope: constant.numeric.float.purescript + operator: + - match: '[|!%$#?~+:\-.=\\]+' + comment: In case this regex seems overly general, note that Purescript permits the definition of new operators which can be nearly any string of punctuation characters, such as $%^&*. + scope: keyword.operator.purescript + prelude: + - include: prelude-data + - include: prelude-function + prelude-data: + - match: \b(Ref)\b + scope: support.function.data.prelude.purescript + prelude-function: + - match: \b(const|flip)\b + scope: support.function.prelude.purescript + - include: prelude-function-alternative + - include: prelude-function-applicative + - include: prelude-function-bits + - include: prelude-function-boollike + - include: prelude-function-category + - include: prelude-function-monad + - include: prelude-function-num + - include: prelude-function-ord + - include: prelude-function-read + - include: prelude-function-ref + - include: prelude-function-show + prelude-function-alternative: + - match: \b(empty)\b + scope: support.function.prelude.alternative.purescript + prelude-function-applicative: + - match: \b(pure)\b + scope: support.function.prelude.applicative.purescript + prelude-function-bits: + - match: \b(complement|shl|shr|numAnd|numComplement|numOr|numShl|numShr|numXor|numZshr|zshr)\b + scope: support.function.prelude.bits.purescript + prelude-function-boollike: + - match: \b(boolAnd|boolNot|boolOr|not)\b + scope: support.function.prelude.boollike.purescript + prelude-function-category: + - match: \b(identity)\b + scope: support.function.prelude.category.purescript + prelude-function-monad: + - match: \b(return)\b + scope: support.function.prelude.monad.purescript + prelude-function-num: + - match: \b(negate|numAdd|numDiv|numMod|numMul|numNegate|numSub)\b + scope: support.function.prelude.num.purescript + prelude-function-ord: + - match: \b(numLess|numLessEq|numGreater|numGreaterEq)\b + scope: support.function.prelude.ord.purescript + prelude-function-read: + - match: \b(read|readNumber)\b + scope: support.function.prelude.read.purescript + prelude-function-ref: + - match: \b(liftRef|refEq|refIneq|unsafeRefEq|unsafeRefIneq)\b + scope: support.function.prelude.ref.purescript + prelude-function-show: + - match: \b(show|showNumber)\b + scope: support.function.prelude.show.purescript + random: + - include: random-data + - include: random-function + random-data: + - match: \b(Random)\b + scope: support.function.data.random.purescript + random-function: + - match: \b(random)\b + scope: support.function.random.purescript + regex: + - include: regex-data + - include: regex-function + regex-data: + - match: \b(Regex)\b + scope: support.function.data.regex.purescript + regex-function: + - match: \b(match|regex|replaceR|search|test)\b + scope: support.function.regex.purescript + reserveds: + - include: reserveds-control + - include: reserveds-other + reserveds-control: + - match: \b(case|do|else|if|in|let|of|then)\b + scope: keyword.control.purescript + reserveds-other: + - match: \b(as|class|data|forall|foreign|import|infix|infixl|infixr|instance|module|newtype|qualified|type|where)\b + scope: keyword.other.purescript + st: + - include: st-data + - include: st-function + st-data: + - match: \b(ST|STRef|STArray)\b + scope: support.function.data.st.purescript + st-function: + - match: \b(modifySTRef|newSTArray|newSTRef|peekSTArray|pokeSTArray|readSTRef|runST|runSTArray|writeSTRef)\b + scope: support.function.st.purescript + string: + - include: string-function + string-function: + - match: \b(charAt|indexOfS|lastIndexOfS|lengthS|localeCompare|replace|sliceS|split|substr|substring|toLower|toUpper|trim)\b + scope: support.function.string.purescript + strings: + - match: (\") + captures: + 0: punctuation.definition.string.begin.purescript + push: + - meta_scope: string.quoted.double.purescript + - match: (\") + captures: + 0: punctuation.definition.string.end.purescript + pop: true + - include: strings-escapes + strings-escapes: + - match: '\\(''|\"|\\|/|b|f|n|r|t|v|0|u[0-9a-fA-F]{4})' + scope: constant.character.escape + trace: + - include: trace-data + - include: trace-function + trace-data: + - match: \b(Trace)\b + scope: support.function.data.trace.purescript + trace-function: + - match: \b(print|trace)\b + scope: support.function.trace.purescript + tuple: + - include: tuple-function + tuple-function: + - match: \b(curry|uncurry|unzip|zip)\b + scope: support.function.tuple.purescript + type-constraint: + - match: '\s*(?:([A-Z][\w.'']*)(?:\s+([a-z_][\w.'']*))+ | \(([A-Z][\w.'']*)(?:\s+([a-z_][\w.'']*))+\))\s*(=>)' + scope: meta.constraint.purescript + captures: + 1: entity.other.inherited-class.purescript + 2: variable.other.purescript + 3: entity.other.inherited-class.purescript + 4: variable.other.purescript + 5: keyword.operator.purescript + type-signature: + - include: type-simple + - include: type-constraint + type-simple: + - match: \((->)\)|(->) + scope: arrow.operator.purescript + captures: + 1: keyword.operator.purescript + 2: keyword.operator.purescript + - match: '([A-Z][\w.'']*)' + scope: storage.type.purescript + - include: generic-tyvar diff --git a/assets/syntaxes/requirementstxt.sublime-syntax b/assets/syntaxes/requirementstxt.sublime-syntax new file mode 100644 index 0000000..8ef40fe --- /dev/null +++ b/assets/syntaxes/requirementstxt.sublime-syntax @@ -0,0 +1,19 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: requirements.txt +file_extensions: + - requirements.txt +scope: source.requirementstxt +contexts: + main: + - match: (#).*$\n? + scope: comment.line.requirementstxt + captures: + 1: punctuation.definition.comment.requirementstxt + - match: '(?i)^[a-z0-9_\-\.]+' + scope: string.package_name.requirementstxt + - match: (?i)==|<|<=|>=|> + scope: keyword.operator.logical.punctuation.requirementstxt + - match: '(?i)\d+\.[\da-z\-_\.]*' + scope: constant.numeric.verions.requirementstxt diff --git a/assets/syntaxes/show-nonprintable.sublime-syntax b/assets/syntaxes/show-nonprintable.sublime-syntax new file mode 100644 index 0000000..d964715 --- /dev/null +++ b/assets/syntaxes/show-nonprintable.sublime-syntax @@ -0,0 +1,27 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: Highlight non-printables +file_extensions: + - show-nonprintable +scope: whitespace +contexts: + main: + - match: "•" + scope: support.function.show-nonprintable.space + - match: "├─*┤" + scope: constant.character.escape.show-nonprintable.tab + - match: "↹" + scope: constant.character.escape.show-nonprintable.tab + - match: "␊" + scope: keyword.operator.show-nonprintable.line-feed + - match: "␍" + scope: string.show-nonprintable.carriage-return + - match: "␀" + scope: entity.other.attribute-name.show-nonprintable.null + - match: "␇" + scope: entity.other.attribute-name.show-nonprintable.bell + - match: "␛" + scope: entity.other.attribute-name.show-nonprintable.escape + - match: "␈" + scope: entity.other.attribute-name.show-nonprintable.backspace diff --git a/assets/syntaxes/syslog.sublime-syntax b/assets/syntaxes/syslog.sublime-syntax new file mode 100644 index 0000000..c49ea11 --- /dev/null +++ b/assets/syntaxes/syslog.sublime-syntax @@ -0,0 +1,41 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: syslog +file_extensions: + - log +scope: source.syslog +contexts: + main: + - match: \b(WAR|WARNING)\b + scope: invalid.deprecated + - match: (^(INVITE|ACK|PUBLISH|OPTIONS|CANCEL|BYE|SUBSCRIBE|NOTIFY|INFO|REFER|UPDATE|MESSAGE) sip.+$|SIP/2.0 180 Ringing|SIP/2.0 200 OK) + scope: variable.parameter + - match: '-----\>step.+$' + scope: support.function + - match: '.+\*{3,}.+' + scope: comment + - match: \b(INFO|VERBOSE)\b + scope: comment + - match: \bNOTICE\b + scope: support.class + - match: \b(ERR|ERROR)\b + scope: invalid.illegal + - match: '^\s*\[.+?\]' + scope: string.quote.single + - match: (--->|<---)( SIP read from | Transmitting \(NAT\) to | SIP transmit to).+$ + scope: comment.line + - match: \<— SIP read from .+ —\> + scope: constant.character + - match: \<— Transmitting \(NAT\) .+ —\> + scope: constant.numeric + - match: (SEND\:|recv\:).+\> + scope: constant.numeric + - match: ^Call-ID\:.+$ + scope: constant.numeric + - match: ^(User-Agent|Server)\:.+$ + scope: entity.name.function + - match: (AMI Send\:|AMI Recv\:|m\=).+ + scope: constant.language + - match: .*)\s*(?=[(])' + scope: keyword.operator.varlink + set: block + + block: + - include: comments + - match: '\)' + scope: punctuation.section.group.end.varlink + pop: true + - match: '\(' + scope: punctuation.section.group.begin.varlink + push: block-inner + + block-inner: + - include: comments + - match: '(?=\))' + pop: true + - match: '\b{{field_name}}\b' + scope: variable.parameter.varlink + - match: ',' + scope: punctuation.separator.varlink + - match: ":" + scope: punctuation.separator.varlink + push: type + + type: + - include: comments + - match: '(?=\()' + push: block + - match: '(?=\))' + pop: true + - match: '(?=,)' + pop: true + - match: '\b(string|bool|int|float|object)\b' + scope: storage.type.varlink + - match: '(\[\]|\[string\]|\?)' + scope: storage.modifier.varlink + - match: '\b{{identifier}}\b' + scope: entity.name.type.varlink + + comments: + - match: "#" + scope: punctuation.definition.comment.varlink + push: + - meta_scope: comment.line.documentation.varlink + - match: $\n? + pop: true diff --git a/assets/themes/1337.tmTheme b/assets/themes/1337.tmTheme new file mode 100644 index 0000000..fdff5bf --- /dev/null +++ b/assets/themes/1337.tmTheme @@ -0,0 +1,616 @@ + + + + + + + name + 1337 + settings + + + settings + + background + #191919 + caret + #F8F8F0 + foreground + #F8F8F2 + invisibles + #3B3A32 + lineHighlight + #3D3D3D55 + selection + #515151 + + + + name + Comment + scope + comment + settings + + foreground + #6d6d6d + + + + name + String + scope + string + settings + + foreground + #fbe3bf + + + + name + Number + scope + constant.numeric + settings + + foreground + #fdb082 + + + + name + Built-in constant + scope + constant.language + settings + + foreground + #ff8942 + + + + name + User-defined constant + scope + constant.character, constant.other + settings + + foreground + #fdb082 + + + + name + Variable + scope + variable + settings + + foreground + #e9fdac + + + + name + Keyword + scope + keyword + settings + + foreground + #ff5e5e + + + + name + Storage + scope + storage + settings + + fontStyle + + foreground + #ff5e5e + + + + name + Storage type + scope + storage.type + settings + + fontStyle + italic + foreground + #fbdfb5 + + + + name + Class name + scope + entity.name.class + settings + + fontStyle + underline + foreground + #8cdaff + + + + name + Inherited class + scope + entity.other.inherited-class + settings + + fontStyle + italic underline + foreground + #8cdaff + + + + name + Function name + scope + entity.name.function + settings + + fontStyle + + foreground + #8cdaff + + + + name + Function argument + scope + variable.parameter + settings + + fontStyle + italic + foreground + #fc9354 + + + + name + Tag name + scope + entity.name.tag + settings + + fontStyle + + foreground + #ff5e5e + + + + name + Tag attribute + scope + entity.other.attribute-name + settings + + fontStyle + + foreground + #97d8ea + + + + name + Library function + scope + support.function + settings + + fontStyle + + foreground + #6699cc + + + + name + Library constant + scope + support.constant + settings + + fontStyle + + foreground + #ecfdb9 + + + + name + Library class/type + scope + support.type, support.class + settings + + foreground + #fbe3bf + + + + name + Library variable + scope + support.other.variable + settings + + fontStyle + + + + + name + PHP Namespaces + scope + support.other.namespace, entity.name.type.namespace + settings + + foreground + #FFB2F9 + + + + name + PHP Namespace Alias + scope + support.other.namespace.use-as.php + settings + + foreground + #66D9EF + + + + name + PHP Namespace Keyword + scope + variable.language.namespace.php + settings + + foreground + #D66990 + + + + name + PHP Namespace Separator + scope + punctuation.separator.inheritance.php + settings + + foreground + #F92672 + + + + name + CSS Functions / Property Values + scope + support.function.misc.css, support.constant.property-value.css, support.constant.font-name.css + settings + + foreground + #fdb082 + + + + name + Twig Tagbraces + scope + meta.tag.template.value.twig, meta.tag.template.block.twig + settings + + foreground + #CD5AC5 + + + + name + Twig Keywords + scope + keyword.control.twig + settings + + foreground + #E05D8C + + + + name + Twig Objects + scope + variable.other.twig + settings + + foreground + #E5A5E0 + + + + name + Twig Object Properties + scope + variable.other.property.twig + settings + + foreground + #FFE1FC + + + + name + Twig Language Constants + scope + constant.language.twig + settings + + foreground + #FFD2A6 + + + + name + Twig Numerical Constants + scope + constant.numeric.twig + settings + + foreground + #FFD0FB + + + + name + Twig Filters + scope + support.function.twig + settings + + foreground + #90E7F7 + + + + name + Twig User-Defined Filters + scope + meta.function-call.other.twig + settings + + foreground + #FAB85A + + + + name + Twig Macros + scope + meta.function-call.twig + settings + + foreground + #FAB85A + + + + name + Invalid + scope + invalid + settings + + background + #f92649 + fontStyle + + foreground + #F8F8F0 + + + + name + Invalid deprecated + scope + invalid.deprecated + settings + + background + #ff9664 + foreground + #F8F8F0 + + + + name + Punctuation + scope + punctuation.definition.string, punctuation.definition.variable, punctuation.definition.string, punctuation.definition.parameters, punctuation.definition.string, punctuation.definition.array + settings + + foreground + #ffffff + + + + name + Text + scope + variable.parameter.function + settings + + foreground + #d0d0d0 + + + + name + Attribute IDs + scope + entity.other.attribute-name.id, punctuation.definition.entity + settings + + foreground + #66a9ec + + + + name + Language Literal + scope + variable.language.super, variable.language.this, variable.language.self + settings + + foreground + #d699ff + + + + name + GitGutter deleted + scope + markup.deleted.git_gutter + settings + + foreground + #F92672 + + + + name + GitGutter inserted + scope + markup.inserted.git_gutter + settings + + foreground + #A6E22E + + + + name + GitGutter changed + scope + markup.changed.git_gutter + settings + + foreground + #CC00FF + + + + name + GitGutter ignored + scope + markup.ignored.git_gutter + settings + + foreground + #999999 + + + + name + GitGutter untracked + scope + markup.untracked.git_gutter + settings + + foreground + #565656 + + + + name + diff.header + scope + meta.diff, meta.diff.header + settings + + foreground + #75715E + + + + name + diff.deleted + scope + markup.deleted + settings + + foreground + #F92672 + + + + name + diff.inserted + scope + markup.inserted + settings + + foreground + #A6E22E + + + + name + diff.changed + scope + markup.changed + settings + + foreground + #CC00FF + + + + uuid + 233F0694-0B9C-43E3-A44A-ECECF7DF6C73 + colorSpaceName + sRGB + semanticClass + theme.dark.1337 + author + Mark Herpich + comment + http://www.twitter.com/markisrocking + + diff --git a/assets/themes/DarkNeon.tmTheme b/assets/themes/DarkNeon.tmTheme new file mode 100644 index 0000000..b6ffe72 --- /dev/null +++ b/assets/themes/DarkNeon.tmTheme @@ -0,0 +1,818 @@ + + + + + name + Dark Neon + settings + + + settings + + background + #000000 + caret + #FFFFFF + foreground + #FFFFFF + invisibles + #CAE2FB3D + lineHighlight + #FFFFFF24 + selection + #333333 + + + + name + Comment + scope + comment + settings + + fontStyle + + foreground + #7C7C7C + background + #212121 + + + + name + Entity + scope + entity + settings + + fontStyle + + foreground + #F8F8F8 + + + + name + Keyword + scope + keyword + settings + + fontStyle + + foreground + #66CCFF + + + + name + Keyword.control + scope + keyword.control + settings + + fontStyle + + foreground + #66CCFF + + + + name + Keyword.Operator + scope + keyword.operator + settings + + foreground + #AAAAAA + + + + name + Class + scope + entity.name.type + settings + + fontStyle + underline + foreground + #FFFFB6 + + + + name + Support + scope + support + settings + + fontStyle + + foreground + #FFFFB6 + + + + name + Storage + scope + storage + settings + + fontStyle + + foreground + #CFCB90 + + + + name + Storage.modifier + scope + storage.modifier + settings + + fontStyle + + foreground + #66CCFF + + + + name + Constant + scope + constant + settings + + fontStyle + + foreground + #99CC99 + + + + name + String + scope + string + settings + + fontStyle + normal + foreground + #CCFF66 + + + + name + Number + scope + constant.numeric + settings + + fontStyle + bold + foreground + #FF73FD + + + + name + Punctuation + scope + punctuation + settings + + fontStyle + + + + + name + Variable + scope + variable + settings + + fontStyle + + foreground + #c6c5fe + + + + name + Invalid – Deprecated + scope + invalid.deprecated + settings + + fontStyle + italic underline + foreground + #FD5FF1 + + + + name + Invalid – Illegal + scope + invalid.illegal + settings + + background + #562D56BF + foreground + #FD5FF1 + + + + name + ----------------------------------- + settings + + + + + name + ♦ Embedded Source (Bright) + scope + text source + settings + + background + #B1B3BA08 + fontStyle + + + + + name + ♦ Entity inherited-class + scope + entity.other.inherited-class + settings + + fontStyle + italic + foreground + #9B5C2E + + + + name + ♦ String embedded-variable + scope + source string source + settings + + fontStyle + + foreground + #EDEDED + + + + name + ♦ String punctuation + scope + source string source punctuation.section.embedded + settings + + fontStyle + + foreground + #00A0A0 + + + + name + ♦ String constant + scope + string constant + settings + + fontStyle + + foreground + #00A0A0 + + + + name + ♦ String.regexp + scope + string.regexp + settings + + foreground + #E9C062 + + + + name + ♦ String.regexp.«special» + scope + string.regexp constant.character.escape, string.regexp source.ruby.embedded, string.regexp string.regexp.arbitrary-repitition + settings + + fontStyle + + foreground + #FF8000 + + + + name + ♦ String.regexp.group + scope + string.regexp.group + settings + + background + #FFFFFF0F + fontStyle + + foreground + #C6A24F + + + + name + ♦ String.regexp.character-class + scope + string.regexp.character-class + settings + + fontStyle + + foreground + #B18A3D + + + + name + ♦ String variable + scope + string variable + settings + + fontStyle + + foreground + #8A9A95 + + + + name + ♦ Support.function + scope + support.function + settings + + fontStyle + + foreground + #DAD085 + + + + name + ♦ Support.constant + scope + support.constant + settings + + fontStyle + + foreground + #FFD2A7 + + + + name + c C/C++ Preprocessor Line + scope + meta.preprocessor.c + settings + + foreground + #8996A8 + + + + name + c C/C++ Preprocessor Directive + scope + meta.preprocessor.c keyword + settings + + fontStyle + + foreground + #AFC4DB + + + + name + j Cast + scope + meta.cast + settings + + fontStyle + italic + foreground + #676767 + + + + name + ✘ Doctype/XML Processing + scope + meta.sgml.html meta.doctype, meta.sgml.html meta.doctype entity, meta.sgml.html meta.doctype string, meta.xml-processing, meta.xml-processing entity, meta.xml-processing string + settings + + foreground + #494949 + + + + name + ✘ Meta.tag.«all» + scope + meta.tag, meta.tag entity + settings + + fontStyle + normal + foreground + #66CCFF + + + + name + ✘ Meta.tag.inline + scope + source entity.name.tag, source entity.other.attribute-name, meta.tag.inline, meta.tag.inline entity + settings + + fontStyle + + foreground + #66CCFF + + + + name + ✘ Meta.tag.attribute-name + scope + entity.other.attribute-name + settings + + fontStyle + + foreground + #aaaaaa + + + + name + ✘ Namespaces + scope + entity.name.tag.namespace, entity.other.attribute-name.namespace + settings + + fontStyle + + foreground + #E18964 + + + + name + § css tag-name + scope + meta.selector.css entity.name.tag + settings + + fontStyle + underline + foreground + #66CCFF + + + + name + § css:pseudo-class + scope + meta.selector.css entity.other.attribute-name.tag.pseudo-class + settings + + fontStyle + + foreground + #8F9D6A + + + + name + § css#id + scope + meta.selector.css entity.other.attribute-name.id + settings + + fontStyle + + foreground + #8B98AB + + + + name + § css.class + scope + meta.selector.css entity.other.attribute-name.class + settings + + fontStyle + + foreground + #62B1FE + + + + name + § css property-name: + scope + support.type.property-name.css + settings + + foreground + #EDEDED + + + + name + § css property-value; + scope + meta.property-group support.constant.property-value.css, meta.property-value support.constant.property-value.css + settings + + fontStyle + + foreground + #F9EE98 + + + + name + § css @at-rule + scope + meta.preprocessor.at-rule keyword.control.at-rule + settings + + foreground + #8693A5 + + + + name + § css additional-constants + scope + meta.property-value support.constant.named-color.css, meta.property-value constant + settings + + fontStyle + + foreground + #87C38A + + + + name + § css constructor.argument + scope + meta.constructor.argument.css + settings + + foreground + #8F9D6A + + + + name + ⎇ diff.header + scope + meta.diff, meta.diff.header + settings + + background + #0E2231 + fontStyle + italic + foreground + #F8F8F8 + + + + name + ⎇ diff.deleted + scope + markup.deleted + settings + + background + #420E09 + foreground + #F8F8F8 + + + + name + ⎇ diff.changed + scope + markup.changed + settings + + background + #4A410D + foreground + #F8F8F8 + + + + name + ⎇ diff.inserted + scope + markup.inserted + settings + + background + #253B22 + foreground + #F8F8F8 + + + + name + -------------------------------- + settings + + + + + name + Markup: Italic + scope + markup.italic + settings + + fontStyle + italic + foreground + #E9C062 + + + + name + Markup: Bold + scope + markup.bold + settings + + fontStyle + bold + foreground + #E9C062 + + + + name + Markup: Underline + scope + markup.underline + settings + + fontStyle + underline + foreground + #E18964 + + + + name + Markup: Quote + scope + markup.quote + settings + + background + #FEE09C12 + fontStyle + italic + foreground + #E1D4B9 + + + + name + Markup: Heading + scope + markup.heading, markup.heading entity + settings + + background + #632D04 + fontStyle + + foreground + #FEDCC5 + + + + name + Markup: List + scope + markup.list + settings + + foreground + #E1D4B9 + + + + name + Markup: Raw + scope + markup.raw + settings + + background + #B1B3BA08 + fontStyle + + foreground + #578BB3 + + + + name + Markup: Comment + scope + markup comment + settings + + fontStyle + italic + foreground + ##555555 + + + + name + Markup: Separator + scope + meta.separator + settings + + background + #242424 + foreground + #60A633 + + + + name + Log Entry + scope + meta.line.entry.logfile, meta.line.exit.logfile + settings + + background + #EEEEEE29 + + + + name + Log Entry Error + scope + meta.line.error.logfile + settings + + background + #751012 + + + + uuid + D039AEA9-9DD2-4237-A963-E84494B0B3FB + colorSpaceName + sRGB + semanticClass + theme.dark.dark_neon + + diff --git a/assets/themes/GitHub.tmTheme b/assets/themes/GitHub.tmTheme new file mode 100644 index 0000000..05703e2 --- /dev/null +++ b/assets/themes/GitHub.tmTheme @@ -0,0 +1,526 @@ + + + + + name + GitHub + settings + + + settings + + background + #FFFFFF + caret + #333333 + foreground + #333333 + invisibles + #E0E0E0 + lineHighlight + #F8EEC7 + selection + #B0CDE7 + selectionBorder + #B0CDE7 + inactiveSelection + #EDEDED + findHighlight + #FFE792 + findHighlightForeground + #333333 + + + + name + Comments + scope + comment + settings + + foreground + #969896 + + + + name + Operators + scope + keyword.operator, support.constant + settings + + fontStyle + + foreground + #A71D5D + + + + name + Operators + scope + constant.language + settings + + fontStyle + + foreground + #0086B3 + + + + name + Keywords + scope + keyword, storage + settings + + fontStyle + + foreground + #a71d5d + + + + name + Types + scope + storage.type + settings + + fontStyle + + foreground + #a71d5d + + + + name + Types + scope + support.type + settings + + fontStyle + + foreground + #0086B3 + + + + scope + variable + settings + + foreground + #0086b3 + + + + scope + variable.language + settings + + foreground + #df5000 + + + + scope + variable.parameter.function + settings + + foreground + #333 + + + + name + Functions + scope + entity.name.function, entity + settings + + fontStyle + + foreground + #795da3 + + + + name + Functions + scope + support.function + settings + + fontStyle + + foreground + #0086B3 + + + + name + Classes + scope + entity.name.type, entity.other.inherited-class + settings + + fontStyle + + foreground + #000000 + + + + name + Classes + scope + support.class + settings + + fontStyle + + foreground + #0086b3 + + + + name + Exceptions + scope + entity.name.exception + settings + + foreground + #F93232 + + + + name + Sections + scope + entity.name.section + settings + + fontStyle + + + + + name + Numbers + scope + constant.numeric, constant + settings + + fontStyle + + foreground + #0086b3 + + + + name + Strings + scope + constant.character, string, string punctuation + settings + + fontStyle + + foreground + #183691 + + + + name + Strings: Regular Expressions + scope + string.regexp, string.regexp constant.character, string.regexp punctuation + settings + + fontStyle + + foreground + #009926 + + + + name + Strings: Symbols + scope + constant.other.symbol + settings + + foreground + #990073 + + + + name + Embedded Source + scope + string source, text source + settings + + fontStyle + + foreground + #333333 + + + + scope + variable.other.property + settings + + foreground + #333 + fontStyle + + + + + scope + entity.name + settings + + fontStyle + + foreground + #333333 + + + + scope + invalid + settings + + fontStyle + + foreground + #f00 + + + + + + + name + HTML: Tags + scope + entity.name.tag + settings + + fontStyle + + foreground + #63a35c + + + + name + HTML: Tags Punctuation + scope + punctuation.definition.tag + settings + + fontStyle + + foreground + #333 + + + + name + HTML: Attribute Punctuation + scope + meta.tag string punctuation + settings + + fontStyle + + foreground + #183691 + + + + name + HTML: Entities + scope + constant.character.entity + settings + + fontStyle + + foreground + #000000 + + + + name + HTML: Attribute Names + scope + entity.other.attribute-name + settings + + fontStyle + + foreground + #795da3 + + + + name + HTML: Attribute Values + scope + meta.tag string.quoted, meta.tag string.quoted constant.character.entity + settings + + fontStyle + + foreground + #183691 + + + + + + scope + meta.selector, meta.selector entity, meta.selector entity punctuation, entity.name.tag.css, entity.other.attribute-name.class, keyword.control.html.sass + settings + + fontStyle + + foreground + #63a35c + + + + scope + entity.other.attribute-name.class, constant.other.unit + settings + + fontStyle + + foreground + #795da3 + + + + scope + support.type.property-name, support.constant.property-value + settings + + fontStyle + + foreground + #0086b3 + + + + + + + scope + keyword.other.special-method.ruby.gem + settings + + foreground + #0086B3 + fontStyle + + + + + scope + variable.other.block.ruby + settings + + foreground + #000 + fontStyle + + + + + + + scope + support.function.prelude, variable.other.generic-type.haskell + settings + + foreground + #000 + fontStyle + + + + + scope + constant.other.haskell, support.constant.haskell + settings + + fontStyle + + foreground + #445588 + + + + + + name + diff.header + scope + meta.diff, meta.diff.header + settings + + foreground + #75715E + + + + name + diff.deleted + scope + markup.deleted + settings + + foreground + #770000 + background + #FFDDDD + + + + name + diff.inserted + scope + markup.inserted + settings + + foreground + #003300 + background + #DDFFDD + + + + name + diff.changed + scope + markup.changed + settings + + foreground + #ececec + + + + uuid + BF4E1964-0DB9-4E88-8142-E8F52D7EDEEC + + diff --git a/assets/themes/Monokai Extended Bright.tmTheme b/assets/themes/Monokai Extended Bright.tmTheme new file mode 100644 index 0000000..91b98eb --- /dev/null +++ b/assets/themes/Monokai Extended Bright.tmTheme @@ -0,0 +1,999 @@ + + + + + author + @tapionlinna + colorSpaceName + sRGB + name + Monokai Extended Bright + semanticClass + theme.dark.monokai_bright_extended + settings + + + settings + + activeGuide + #9D550FB0 + background + #272822 + bracketContentsForeground + #F8F8F2A5 + bracketContentsOptions + underline + bracketsForeground + #F8F8F2A5 + bracketsOptions + underline + caret + #F8F8F0 + findHighlight + #FFE792 + findHighlightForeground + #000000 + foreground + #F8F8F2 + inactiveSelection + #bbbbbb + inactiveSelectionForeground + #222222 + invisibles + #3B3A32 + lineHighlight + #3E3D32 + selection + #9D550F + selectionBorder + #1C1C1C + selectionForeground + #fffff8 + tagsOptions + stippled_underline + + + + name + Comment + scope + comment + settings + + foreground + #75715E + + + + name + String + scope + string + settings + + foreground + #E6DB74 + + + + name + Number + scope + constant.numeric + settings + + foreground + #AE81FF + + + + name + Built-in constant + scope + constant.language + settings + + foreground + #AE81FF + + + + name + User-defined constant + scope + constant.character, constant.other + settings + + foreground + #AE81FF + + + + name + Variable + scope + variable + settings + + fontStyle + + + + + name + Entity + scope + entity + settings + + fontStyle + + foreground + #F92672 + + + + name + Keyword + scope + keyword + settings + + foreground + #F92672 + + + + name + Storage + scope + storage + settings + + fontStyle + + foreground + #F92672 + + + + name + Storage type + scope + storage.type + settings + + fontStyle + italic + foreground + #66D9EF + + + + name + Class name + scope + entity.name.class + settings + + fontStyle + underline + foreground + #A6E22E + + + + name + Inherited class + scope + entity.other.inherited-class + settings + + fontStyle + italic underline + foreground + #A6E22E + + + + name + Function name + scope + entity.name.function + settings + + fontStyle + + foreground + #A6E22E + + + + name + Function argument + scope + variable.parameter + settings + + fontStyle + italic + foreground + #FD971F + + + + name + Tag name + scope + entity.name.tag + settings + + fontStyle + + foreground + #F92672 + + + + name + Tag attribute + scope + entity.other.attribute-name + settings + + fontStyle + + foreground + #A6E22E + + + + name + Library function + scope + support.function + settings + + fontStyle + + foreground + #66D9EF + + + + name + Library constant + scope + support.constant + settings + + fontStyle + + foreground + #66D9EF + + + + name + Library class/type + scope + support.type, support.class + settings + + fontStyle + italic + foreground + #66D9EF + + + + name + Library variable + scope + support.other.variable + settings + + fontStyle + + + + + name + String constant + scope + string constant + settings + + foreground + #66D9EF + + + + name + String.regexp + scope + string.regexp + settings + + foreground + #F6AA11 + + + + name + String variable + scope + string variable + settings + + foreground + #FFFFFF + + + + name + Support.function + scope + support.function + settings + + fontStyle + + foreground + #66D9EF + + + + name + Doctype/XML Processing + scope + meta.tag.sgml.doctype.xml, declaration.sgml.html declaration.doctype, declaration.sgml.html declaration.doctype entity, declaration.sgml.html declaration.doctype string, declaration.xml-processing, declaration.xml-processing entity, declaration.xml-processing string, doctype + settings + + foreground + #73817D + + + + name + HTML: punctuations tags + scope + punctuation.definition.tag.end, punctuation.definition.tag.begin, punctuation.definition.tag + settings + + foreground + #FFFFFF + + + + name + CSS: tag-name + scope + meta.selector.css entity.name.tag + settings + + fontStyle + underline + foreground + #F92672 + + + + name + CSS: @import + scope + keyword.control.at-rule.import.css + settings + + foreground + #F92672 + + + + name + CSS: @at-rule + scope + meta.preprocessor.at-rule keyword.control.at-rule + settings + + foreground + #F6AA11 + + + + name + CSS: id + scope + meta.selector.css entity.other.attribute-name.id + settings + + foreground + #F6AA11 + + + + name + CSS: class + scope + meta.selector.css entity.other.attribute-name.class + settings + + foreground + #A6E22E + + + + name + CSS: property-name + scope + support.type.property-name.css + settings + + foreground + #66D9EF + + + + name + CSS: property-value + scope + meta.property-group support.constant.property-value.css, meta.property-value support.constant.property-value.css + settings + + foreground + #F6F080 + + + + name + CSS: additional-constants + scope + meta.property-value support.constant.named-color.css, meta.property-value constant + settings + + foreground + #EDF080 + + + + name + CSS: constructor.argument + scope + meta.constructor.argument.css + settings + + foreground + #F6AA11 + + + + name + LESS variables + scope + variable.other.less + settings + + foreground + #FFFFFF + + + + name + LESS mixins + scope + entity.other.less.mixin + settings + + foreground + #9DF39F + + + + name + CoffeeScript String Interpolated + scope + punctuation.section.embedded.coffee + settings + + foreground + #e69f66 + + + + name + Invalid + scope + invalid + settings + + background + #F92672 + fontStyle + + foreground + #F8F8F0 + + + + name + Invalid deprecated + scope + invalid.deprecated + settings + + background + #AE81FF + foreground + #F8F8F0 + + + + name + JSON String + scope + meta.structure.dictionary.json string.quoted.double.json + settings + + foreground + #CFCFC2 + + + + name + diff.header + scope + meta.diff, meta.diff.header + settings + + foreground + #75715E + + + + name + diff.deleted + scope + markup.deleted + settings + + foreground + #F92672 + + + + name + diff.inserted + scope + markup.inserted + settings + + foreground + #A6E22E + + + + name + diff.changed + scope + markup.changed + settings + + foreground + #E6DB74 + + + + name + diff.range + scope + meta.diff, meta.diff.range + settings + + foreground + #3BC0F0 + + + + name + Markdown: Plain + scope + text.html.markdown + settings + + foreground + #FFFFFF + + + + name + Markup: Raw Inline + scope + text.html.markdown markup.raw.inline + settings + + foreground + #EC3533 + + + + name + Markdown: Linebreak + scope + text.html.markdown meta.dummy.line-break + settings + + foreground + #E0EDDD + + + + name + Markup: Heading + scope + Markdown.heading, markup.heading | markup.heading entity.name, markup.heading.markdown punctuation.definition.heading.markdown + settings + + fontStyle + + foreground + #FD971F + + + + name + Markup: Heading 1 + scope + markup.heading.1.markdown + settings + + fontStyle + + foreground + #fc951e + + + + name + Markup: Heading 2 + scope + markup.heading.2.markdown + settings + + fontStyle + + foreground + #e8891c + + + + name + Markup: Heading 3 + scope + markup.heading.3.markdown + settings + + fontStyle + + foreground + #d47d19 + + + + name + Markup: Heading 4 + scope + markup.heading.4.markdown + settings + + fontStyle + + foreground + #bf7117 + + + + name + Markup: Heading 5 + scope + markup.heading.5.markdown + settings + + fontStyle + + foreground + #ab6515 + + + + name + Markup: Heading 6 + scope + markup.heading.6.markdown + settings + + fontStyle + + foreground + #965912 + + + + name + Markup: Italic + scope + markup.italic + settings + + fontStyle + italic + foreground + #F92672DD + + + + name + Markup: Bold + scope + markup.bold + settings + + fontStyle + bold + foreground + #F92672 + + + + name + Markup: Underline + scope + markup.underline + settings + + fontStyle + underline + foreground + #A6E22E + + + + name + Markup: strike + scope + markup.strike + settings + + fontStyle + + foreground + #cc4273 + + + + name + Markdown: Blockquote + scope + markup.quote, punctuation.definition.blockquote.markdown + settings + + fontStyle + italic + foreground + #66D9EF + + + + name + Markup: Quote + scope + markup.quote + settings + + fontStyle + italic + foreground + #66D9EF + + + + name + Markup: Link + scope + string.other.link.title.markdown + settings + + fontStyle + underline + foreground + #66D9EF + + + + name + Markup: Raw Block + scope + markup.raw.block + settings + + foreground + #AE81FF + + + + name + Markdown: Raw Block + scope + markup.raw.block.fenced.markdown + settings + + background + #222 + foreground + #FFFFFF + + + + name + Markdown: List Items punctuation + scope + punctuation.definition.list_item.markdown + settings + + foreground + #93A1A1 + + + + name + Fenced Code Block + scope + punctuation.definition.fenced.markdown,variable.language.fenced.markdown + settings + + background + #222222 + foreground + #93A1A1 + + + + name + Fenced markdown language + scope + variable.language.fenced.markdown + settings + + fontStyle + italic + foreground + #C6CECE + + + + name + Markup: Table + scope + markup.table + settings + + background + #FF3A281A + foreground + #B42A1D + + + + name + Markdown: Separator + scope + meta.separator + settings + + background + #FFFFFF0F + fontStyle + bold + foreground + #FFFFFF33 + + + + name + LaTeX: Math Variables + scope + variable.other.math.tex + settings + + foreground + #E6DB74 + + + + name + GitGutter deleted + scope + markup.deleted.git_gutter + settings + + foreground + #F92672 + + + + name + GitGutter inserted + scope + markup.inserted.git_gutter + settings + + foreground + #A6E22E + + + + name + GitGutter changed + scope + markup.changed.git_gutter + settings + + foreground + #FC951E + + + + name + GitGutter ignored + scope + markup.ignored.git_gutter + settings + + foreground + #565656 + + + + name + GitGutter untracked + scope + markup.untracked.git_gutter + settings + + foreground + #565656 + + + + scope + constant.numeric.line-number.find-in-files - match + settings + + foreground + #AE81FFA0 + + + + scope + entity.name.filename.find-in-files + settings + + foreground + #E6DB74 + + + + name + Nginx path + scope + string.other.path.nginx + settings + + foreground + #fc951e + + + + uuid + b76b4488-20c3-40a7-9499-457a451ee558 + + diff --git a/assets/themes/Monokai Extended Light.tmTheme b/assets/themes/Monokai Extended Light.tmTheme new file mode 100644 index 0000000..dfcd381 --- /dev/null +++ b/assets/themes/Monokai Extended Light.tmTheme @@ -0,0 +1,1975 @@ + + + + + author + github.com/szupie + colorSpaceName + sRGB + gutterSettings + + background + #073642 + divider + #586e75 + foreground + #839496 + selectionBackground + #586e75 + selectionForeground + #679c00 + + name + Monokai Extended Light + semanticClass + theme.light.monokai_extended + settings + + + settings + + activeGuide + #06B512 + background + #fafafa + bracketContentsForeground + #49483ea5 + bracketContentsOptions + underline + bracketsForeground + #49483ea5 + bracketsOptions + underline + caret + #666663 + findHighlight + #ffe792 + findHighlightForeground + #000000 + foreground + #49483e + invisibles + #3b3a32 + lineHighlight + #e6e3c4 + selection + #ccc9ad + selectionBorder + #93917d + stackGuide + #C2A51C + tagsOptions + stippled_underline + + + + name + Comment + scope + comment + settings + + foreground + #75715e + + + + name + String + scope + string + settings + + foreground + #998f2f + + + + name + Number + scope + constant.numeric + settings + + foreground + #684d99 + + + + name + Constant: Built-in + scope + constant.language, meta.preprocessor + settings + + foreground + #684d99 + + + + name + Constant: User-defined + scope + constant.character, constant.other + settings + + foreground + #684d99 + + + + name + Variable + scope + variable.language, variable.other + settings + + foreground + #49483e + + + + name + Keyword + scope + keyword + settings + + foreground + #f9005a + + + + name + Storage + scope + storage + settings + + fontStyle + + foreground + #f9005a + + + + name + Storage type + scope + storage.type + settings + + fontStyle + italic + foreground + #0089b3 + + + + name + Class name + scope + entity.name.class + settings + + fontStyle + underline + foreground + #679c00 + + + + name + Inherited class + scope + entity.other.inherited-class + settings + + fontStyle + italic underline + foreground + #679c00 + + + + name + Function name + scope + entity.name.function + settings + + fontStyle + + foreground + #679c00 + + + + name + Function argument + scope + variable.parameter + settings + + fontStyle + italic + foreground + #cf7000 + + + + name + Tag name + scope + entity.name.tag + settings + + fontStyle + + foreground + #f9005a + + + + name + Tag attribute + scope + entity.other.attribute-name + settings + + fontStyle + + foreground + #679c00 + + + + name + Library function + scope + support.function + settings + + fontStyle + + foreground + #0089b3 + + + + name + Library constant + scope + support.constant + settings + + fontStyle + + foreground + #0089b3 + + + + name + Library class/type + scope + support.type, support.class + settings + + fontStyle + italic + foreground + #0089b3 + + + + name + Library variable + scope + support.other.variable + settings + + fontStyle + + + + + name + String constant + scope + string constant + settings + + foreground + #0089b3 + + + + name + String.regexp + scope + string.regexp + settings + + foreground + #f6aa11 + + + + name + String variable + scope + string variable + settings + + foreground + #49483e + + + + name + Variable: punctuation + scope + punctuation.definition.variable + settings + + foreground + #49483e + + + + name + Entity + scope + entity + settings + + fontStyle + + foreground + #679c00 + + + + name + HTML: Doctype/XML Processing + scope + meta.tag.sgml.doctype.xml, declaration.sgml.html declaration.doctype, declaration.sgml.html declaration.doctype entity, declaration.sgml.html declaration.doctype string, declaration.xml-processing, declaration.xml-processing entity, declaration.xml-processing string, doctype + settings + + foreground + #c8cecc + + + + name + HTML: Comment Block + scope + comment.block.html + settings + + fontStyle + + foreground + #7c7865 + + + + name + HTML: Script + scope + entity.name.tag.script.html + settings + + fontStyle + italic + + + + name + HTML: Attribute punctuation + scope + text.html.basic meta.tag.other.html, text.html.basic meta.tag.any.html, text.html.basic meta.tag.block.any, text.html.basic meta.tag.inline.any, text.html.basic meta.tag.structure.any.html, text.html.basic source.js.embedded.html, punctuation.separator.key-value.html + settings + + fontStyle + + foreground + #679c00 + + + + name + HTML: Attributes + scope + text.html.basic entity.other.attribute-name.html + settings + + foreground + #679c00 + + + + name + HTML: Quotation Marks + scope + text.html.basic meta.tag.structure.any.html punctuation.definition.string.begin.html, punctuation.definition.string.begin.html, punctuation.definition.string.end.html + settings + + fontStyle + + foreground + #49483e + + + + name + HTML: Tags punctuation + scope + punctuation.definition.tag.end, punctuation.definition.tag.begin, punctuation.definition.tag + settings + + foreground + #49483e + + + + name + Handlebars: Variable + scope + variable.parameter.handlebars + settings + + foreground + #f6aa11 + + + + name + Handlebars: Constant + scope + support.constant.handlebars, meta.function.block.start.handlebars + settings + + foreground + #0089b3 + + + + name + CSS: @at-rule + scope + meta.preprocessor.at-rule keyword.control.at-rule + settings + + foreground + #f6aa11 + + + + name + CSS: #Id + scope + meta.selector.css entity.other.attribute-name.id + settings + + foreground + #f6aa11 + + + + name + CSS: #Id for SCSS + scope + entity.other.attribute-name.id + settings + + foreground + #f6aa11 + + + + name + CSS: .class + scope + meta.selector.css entity.other.attribute-name.class + settings + + foreground + #679c00 + + + + name + CSS: Property Name + scope + support.type.property-name.css + settings + + foreground + #0089b3 + + + + name + CSS: Constructor Argument + scope + meta.constructor.argument.css + settings + + foreground + #f6aa11 + + + + name + CSS: {} + scope + punctuation.section.property-list.css + settings + + foreground + #49483e + + + + name + CSS: Tag Punctuation + scope + punctuation.definition.tag.css + settings + + foreground + #f9005a + + + + name + CSS: : , + scope + punctuation.separator.key-value.css, punctuation.terminator.rule.css + settings + + fontStyle + + foreground + #49483e + + + + name + CSS :pseudo + scope + entity.other.attribute-name.pseudo-element.css, entity.other.attribute-name.pseudo-class.css, entity.other.attribute-name.pseudo-selector.css + settings + + fontStyle + + foreground + #679c00 + + + + name + LESS variables + scope + variable.other.less + settings + + foreground + #49483e + + + + name + LESS mixins + scope + entity.other.less.mixin + settings + + fontStyle + italic + foreground + #e0fdce + + + + name + LESS: Extend + scope + entity.other.attribute-name.pseudo-element.less + settings + + fontStyle + + foreground + #ff9117 + + + + name + JS: Function Name + scope + meta.function.js, entity.name.function.js, support.function.dom.js + settings + + fontStyle + + foreground + #679c00 + + + + name + JS: Storage Type + scope + storage.type.js + settings + + fontStyle + italic + foreground + #0089b3 + + + + name + JS: Source + scope + text.html.basic source.js.embedded.html + settings + + fontStyle + + foreground + #49483e + + + + name + JS: Function + scope + storage.type.function.js + settings + + fontStyle + italic + foreground + #0089b3 + + + + name + JS: Numeric Constant + scope + constant.numeric.js + settings + + foreground + #ae81ff + + + + name + JS: [] + scope + meta.brace.square.js + settings + + foreground + #49483e + + + + name + JS: () + scope + meta.brace.round, punctuation.definition.parameters.begin.js, punctuation.definition.parameters.end.js + settings + + foreground + #49483e + + + + name + JS: {} + scope + meta.brace.curly.js + settings + + foreground + #49483e + + + + name + JSON String + scope + meta.structure.dictionary.json string.quoted.double.json + settings + + foreground + #9f9f66 + + + + name + CoffeeScript String Interpolated + scope + punctuation.section.embedded.coffee + settings + + foreground + #e69f66 + + + + name + PHP: [] + scope + keyword.operator.index-start.php, keyword.operator.index-end.php + settings + + foreground + #49483e + + + + name + PHP: Array + scope + meta.array.php + settings + + foreground + #49483e + + + + name + PHP: Array() + scope + meta.array.php support.function.construct.php, meta.array.empty.php support.function.construct.php + settings + + fontStyle + + foreground + #0089b3 + + + + name + PHP: Array Construct + scope + support.function.construct.php + settings + + foreground + #0089b3 + + + + name + PHP: Storage Type Function + scope + storage.type.function.php + settings + + foreground + #0089b3 + + + + name + PHP: Numeric Constant + scope + constant.numeric.php + settings + + foreground + #684d99 + + + + name + PHP: New + scope + keyword.other.new.php + settings + + foreground + #e42e70 + + + + name + PHP: :: + scope + support.class.php + settings + + fontStyle + italic + foreground + #0089b3 + + + + name + PHP: Other Property + scope + variable.other.property.php + settings + + foreground + #f6aa11 + + + + name + PHP: Class + scope + storage.modifier.extends.php, storage.type.class.php, keyword.operator.class.php + settings + + foreground + #e42e70 + + + + name + PHP: Inherited Class + scope + meta.other.inherited-class.php + settings + + fontStyle + + foreground + #0089b3 + + + + name + PHP: Storage Type + scope + storage.type.php + settings + + foreground + #0089b3 + + + + name + PHP: Function + scope + entity.name.function.php + settings + + foreground + #679c00 + + + + name + PHP: Function Construct + scope + support.function.construct.php + settings + + foreground + #0089b3 + + + + name + PHP: Function Call + scope + entity.name.type.class.php, meta.function-call.php, meta.function-call.static.php, meta.function-call.object.php + settings + + foreground + #49483e + + + + name + PHP: Source Emebedded + scope + source.php.embedded.block.html + settings + + foreground + #49483e + + + + name + Invalid + scope + invalid + settings + + background + #f9005a + fontStyle + + foreground + #666663 + + + + name + Invalid deprecated + scope + invalid.deprecated + settings + + background + #ae81ff + foreground + #666663 + + + + name + diff.header + scope + meta.diff, meta.diff.header + settings + + foreground + #75715e + + + + name + diff.deleted + scope + markup.deleted + settings + + foreground + #f9005a + + + + name + diff.inserted + scope + markup.inserted + settings + + foreground + #679c00 + + + + name + diff.changed + scope + markup.changed + settings + + foreground + #998f2f + + + + name + diff.range + scope + meta.diff, meta.diff.range + settings + + foreground + #3bc0f0 + + + + name + Python: storage + scope + storage.type.class.python, storage.type.function.python, storage.modifier.global.python + settings + + fontStyle + + foreground + #3bc0f0 + + + + name + Python: import + scope + keyword.control.import.python, keyword.control.import.from.python + settings + + foreground + #f9005add + + + + name + Python: Support.exception + scope + support.type.exception.python + settings + + foreground + #0089b3 + + + + name + Perl: variables + scope + punctuation.definition.variable.perl, variable.other.readwrite.global.perl, variable.other.predefined.perl, keyword.operator.comparison.perl + settings + + foreground + #e42e70 + + + + name + Perl: functions + scope + support.function.perl + settings + + foreground + #0089b3 + + + + name + Perl: comments + scope + comment.line.number-sign.perl + settings + + fontStyle + italic + foreground + #75715e + + + + name + Perl: quotes + scope + punctuation.definition.string.begin.perl, punctuation.definition.string.end.perl + settings + + foreground + #49483e + + + + name + Perl: char + scope + constant.character.escape.perl + settings + + foreground + #dc322f + + + + name + Ruby: Constant + scope + constant.language.ruby, constant.numeric.ruby + settings + + foreground + #ae81ff + + + + name + Ruby: Variable definition + scope + punctuation.definition.variable.ruby + settings + + fontStyle + + foreground + #f6aa11 + + + + name + Ruby: Function Name + scope + meta.function.method.with-arguments.ruby + settings + + foreground + #679c00 + + + + name + Ruby: Variable + scope + variable.language.ruby + settings + + foreground + #49483e + + + + name + Ruby: Function + scope + entity.name.function.ruby + settings + + foreground + #f6aa11 + + + + name + Ruby: Keyword Control + scope + keyword.control.ruby, keyword.control.def.ruby + settings + + fontStyle + bold + foreground + #679c00 + + + + name + Ruby: Class + scope + keyword.control.class.ruby, meta.class.ruby + settings + + foreground + #679c00 + + + + name + Ruby: Class Name + scope + entity.name.type.class.ruby + settings + + fontStyle + + foreground + #0089b3 + + + + name + Ruby: Keyword + scope + keyword.control.ruby + settings + + fontStyle + + foreground + #679c00 + + + + name + Ruby: Support Class + scope + support.class.ruby + settings + + fontStyle + + foreground + #0089b3 + + + + name + Ruby: Special Method + scope + keyword.other.special-method.ruby + settings + + foreground + #679c00 + + + + name + Ruby: Constant Other + scope + variable.other.constant.ruby + settings + + fontStyle + + foreground + #0089b3 + + + + name + Ruby: :symbol + scope + constant.other.symbol.ruby + settings + + fontStyle + + foreground + #f6f080 + + + + name + Ruby: Punctuation Section + scope + punctuation.section.embedded.ruby, punctuation.definition.string.begin.ruby, punctuation.definition.string.end.ruby + settings + + foreground + #f9005a + + + + name + Ruby: Special Method + scope + keyword.other.special-method.ruby + settings + + foreground + #e42e70 + + + + name + Markdown: plain + scope + text.html.markdown + settings + + foreground + #49483e + + + + name + Markup: raw inline + scope + text.html.markdown markup.raw.inline + settings + + foreground + #ec3533 + + + + name + Markdown: linebreak + scope + text.html.markdown meta.dummy.line-break + settings + + foreground + #e0eddd + + + + name + Markdown: heading + scope + markdown.heading, markup.heading | markup.heading entity.name, markup.heading.markdown punctuation.definition.heading.markdown + settings + + fontStyle + + foreground + #cf7000 + + + + name + Markup: Heading 1 + scope + markup.heading.1.markdown + settings + + fontStyle + + foreground + #cf6e00 + + + + name + Markup: Heading 2 + scope + markup.heading.2.markdown + settings + + fontStyle + + foreground + #ba6300 + + + + name + Markup: Heading 3 + scope + markup.heading.3.markdown + settings + + fontStyle + + foreground + #a65800 + + + + name + Markup: Heading 4 + scope + markup.heading.4.markdown + settings + + fontStyle + + foreground + #914e00 + + + + name + Markup: Heading 5 + scope + markup.heading.5.markdown + settings + + fontStyle + + foreground + #7d4300 + + + + name + Markup: Heading 6 + scope + markup.heading.6.markdown + settings + + fontStyle + + foreground + #693800 + + + + name + Markup: italic + scope + markup.italic + settings + + fontStyle + italic + foreground + #e42e70 + + + + name + Markup: bold + scope + markup.bold + settings + + fontStyle + bold + foreground + #f9005a + + + + name + Markup: underline + scope + markup.underline + settings + + fontStyle + underline + foreground + #679c00 + + + + name + Markup: strike + scope + markup.strike + settings + + fontStyle + strike + foreground + #cc4273 + + + + name + Markdown: Blockquote + scope + markup.quote, punctuation.definition.blockquote.markdown + settings + + fontStyle + italic + foreground + #0089b3 + + + + name + Markup: Quote + scope + markup.quote + settings + + fontStyle + italic + foreground + #0089b3 + + + + name + Markdown: Link + scope + string.other.link.title.markdown + settings + + fontStyle + underline + foreground + #0089b3 + + + + name + Markup: Raw block + scope + markup.raw.block + settings + + foreground + #ae81ff + + + + name + Markdown: List Items Punctuation + scope + punctuation.definition.list_item.markdown + settings + + foreground + #49483e + + + + name + Markdown: Raw Block fenced + scope + markup.raw.block.fenced.markdown + settings + + background + #222 + foreground + #49483e + + + + name + Markdown: Fenced Bode Block + scope + punctuation.definition.fenced.markdown, variable.language.fenced.markdown + settings + + background + #fafafa + foreground + #636050 + + + + name + Markdown: Fenced Language + scope + variable.language.fenced.markdown + settings + + fontStyle + + foreground + #7c7865 + + + + name + Markdown: Separator + scope + meta.separator + settings + + background + #49483e0f + fontStyle + bold + foreground + #49483e33 + + + + name + Markup: table + scope + markup.table + settings + + background + #ff3a281a + foreground + #b42a1d + + + + name + LaTeX: Math Variables + scope + variable.other.math.tex + settings + + foreground + #998f2f + + + + name + Other: Removal + scope + other.package.exclude, other.remove + settings + + fontStyle + + foreground + #d3201f + + + + name + Shell: builtin + scope + support.function.builtin.shell + settings + + foreground + #679c00 + + + + name + Shell: variable + scope + variable.other.normal.shell + settings + + foreground + #0089b3 + + + + name + Shell: DOTFILES + scope + source.shell + settings + + fontStyle + + foreground + #49483e + + + + name + Shell: meta scope in loop + scope + meta.scope.for-in-loop.shell, variable.other.loop.shell + settings + + fontStyle + + foreground + #cf7000 + + + + name + Shell: Function name + scope + entity.name.function.shell + settings + + fontStyle + + foreground + #679c00 + + + + name + Shell: Quotation Marks + scope + punctuation.definition.string.end.shell, punctuation.definition.string.begin.shell + settings + + fontStyle + + foreground + #49483e + + + + name + Shell: Meta Block + scope + meta.scope.case-block.shell, meta.scope.case-body.shell + settings + + fontStyle + + foreground + #cf7000 + + + + name + Shell: [] + scope + punctuation.definition.logical-expression.shell + settings + + fontStyle + + foreground + #49483e + + + + name + Shell: Comment + scope + comment.line.number-sign.shell + settings + + fontStyle + italic + foreground + #7c7865 + + + + name + Makefile: Comment + scope + comment.line.number-sign.makefile + settings + + fontStyle + + foreground + #7c7865 + + + + name + Makefile: Comment punctuation + scope + punctuation.definition.comment.makefile + settings + + fontStyle + + foreground + #7c7865 + + + + name + Makefile: Variables + scope + variable.other.makefile + settings + + fontStyle + + foreground + #f9005a + + + + name + Makefile: Function name + scope + entity.name.function.makefile + settings + + fontStyle + + foreground + #679c00 + + + + name + Makefile: Function + scope + meta.function.makefile + settings + + fontStyle + + foreground + #0089b3 + + + + name + GitGutter deleted + scope + markup.deleted.git_gutter + settings + + foreground + #f9005a + + + + name + GitGutter inserted + scope + markup.inserted.git_gutter + settings + + foreground + #679c00 + + + + name + GitGutter changed + scope + markup.changed.git_gutter + settings + + foreground + #FC951E + + + + name + GitGutter ignored + scope + markup.ignored.git_gutter + settings + + foreground + #565656 + + + + name + GitGutter untracked + scope + markup.untracked.git_gutter + settings + + foreground + #565656 + + + + name + SublimeLinter Annotations + scope + sublimelinter.annotations + settings + + background + #FFFFAA + foreground + #e6e3c4 + + + + name + SublimeLinter Error Outline + scope + sublimelinter.outline.illegal + settings + + background + #FF4A52 + foreground + #49483e + + + + name + SublimeLinter Error Underline + scope + sublimelinter.underline.illegal + settings + + background + #FF0000 + + + + name + SublimeLinter Warning Outline + scope + sublimelinter.outline.warning + settings + + background + #DF9400 + foreground + #49483e + + + + name + SublimeLinter Warning Underline + scope + sublimelinter.underline.warning + settings + + background + #FF0000 + + + + name + SublimeLinter Violation Outline + scope + sublimelinter.outline.violation + settings + + background + #49483e33 + foreground + #49483e + + + + name + SublimeLinter Violation Underline + scope + sublimelinter.underline.violation + settings + + background + #FF0000 + + + + scope + constant.numeric.line-number.find-in-files - match + settings + + foreground + #AE81FFA0 + + + + scope + entity.name.filename.find-in-files + settings + + foreground + #998f2f + + + + name + SublimeLinter Error + scope + sublimelinter.mark.error + settings + + foreground + #D02000 + + + + name + SublimeLinter Warning + scope + sublimelinter.mark.warning + settings + + foreground + #DDB700 + + + + name + SublimeLinter Gutter Mark + scope + sublimelinter.gutter-mark + settings + + foreground + #49483e + + + + name + Nginx path + scope + string.other.path.nginx + settings + + foreground + #fc951e + + + + uuid + 0fbea17d-3c09-4ac5-a1aa-98f4946035e3 + + diff --git a/assets/themes/Monokai Extended Origin.tmTheme b/assets/themes/Monokai Extended Origin.tmTheme new file mode 100644 index 0000000..a865aca --- /dev/null +++ b/assets/themes/Monokai Extended Origin.tmTheme @@ -0,0 +1,1919 @@ + + + + + author + github.com/SuperPaintman + colorSpaceName + sRGB + gutterSettings + + background + #272822 + divider + #586e75 + foreground + #F8F8F2 + selectionBackground + #49483E + selectionForeground + #a6e22e + + name + Monokai Extended Origin + semanticClass + theme.dark.monokai_extended + settings + + + settings + + activeGuide + #9D550FB0 + background + #272822 + bracketContentsForeground + #F8F8F2A5 + bracketContentsOptions + underline + bracketsForeground + #F8F8F2A5 + bracketsOptions + underline + caret + #F8F8F0 + findHighlight + #FFE792 + findHighlightForeground + #000000 + foreground + #F8F8F2 + invisibles + #3B3A32 + lineHighlight + #3E3D32 + selection + #49483E + selectionBorder + #222218 + tagsOptions + stippled_underline + + + + name + Comment + scope + comment + settings + + foreground + #75715E + + + + name + String + scope + string + settings + + foreground + #E6DB74 + + + + name + Number + scope + constant.numeric + settings + + foreground + #AE81FF + + + + name + Built-in constant + scope + constant.language + settings + + foreground + #AE81FF + + + + name + User-defined constant + scope + constant.character, constant.other + settings + + foreground + #AE81FF + + + + name + Variable + scope + variable + settings + + fontStyle + + foreground + #ffffff + + + + name + Keyword + scope + keyword + settings + + foreground + #F92672 + + + + name + Storage + scope + storage + settings + + fontStyle + + foreground + #F92672 + + + + name + Storage type + scope + storage.type + settings + + fontStyle + italic + foreground + #66D9EF + + + + name + Class name + scope + entity.name.class + settings + + fontStyle + underline + foreground + #A6E22E + + + + name + Inherited class + scope + entity.other.inherited-class + settings + + fontStyle + italic underline + foreground + #A6E22E + + + + name + Function name + scope + entity.name.function + settings + + fontStyle + + foreground + #A6E22E + + + + name + Function argument + scope + variable.parameter + settings + + fontStyle + italic + foreground + #FD971F + + + + name + Tag name + scope + entity.name.tag + settings + + fontStyle + + foreground + #F92672 + + + + name + Tag attribute + scope + entity.other.attribute-name + settings + + fontStyle + + foreground + #A6E22E + + + + name + Library function + scope + support.function + settings + + fontStyle + + foreground + #66D9EF + + + + name + Library constant + scope + support.constant + settings + + fontStyle + + foreground + #66D9EF + + + + name + Library class/type + scope + support.type, support.class + settings + + fontStyle + italic + foreground + #66D9EF + + + + name + Library variable + scope + support.other.variable + settings + + fontStyle + + + + + name + Invalid + scope + invalid + settings + + background + #F92672 + fontStyle + + foreground + #F8F8F0 + + + + name + Invalid deprecated + scope + invalid.deprecated + settings + + background + #AE81FF + foreground + #F8F8F0 + + + + name + JSON String + scope + meta.structure.dictionary.json string.quoted.double.json + settings + + foreground + #CFCFC2 + + + + name + diff.header + scope + meta.diff, meta.diff.header + settings + + foreground + #75715E + + + + name + diff.deleted + scope + markup.deleted + settings + + fontStyle + + foreground + #F92672 + + + + name + diff.inserted + scope + markup.inserted + settings + + foreground + #A6E22E + + + + name + diff.changed + scope + markup.changed + settings + + fontStyle + + foreground + #E6DB74 + + + + name + HTML: Script + scope + constant.numeric.line-number.find-in-files - match + settings + + fontStyle + italic + foreground + #AE81FFA0 + + + + name + HTML: Attribute punctuation + scope + entity.name.filename.find-in-files + settings + + fontStyle + + foreground + #E6DB74 + + + + name + HTML: Attributes + scope + text.html.basic entity.other.attribute-name.html + settings + + foreground + #a6e22e + + + + name + HTML: Quotation Marks + scope + text.html.basic meta.tag.structure.any.html punctuation.definition.string.begin.html, punctuation.definition.string.begin.html, punctuation.definition.string.end.html + settings + + fontStyle + + foreground + #ffffff + + + + name + HTML: Tags punctuation + scope + punctuation.definition.tag.end, punctuation.definition.tag.begin, punctuation.definition.tag + settings + + foreground + #ffffff + + + + name + Handlebars: Variable + scope + variable.parameter.handlebars + settings + + foreground + #f6aa11 + + + + name + Handlebars: Constant + scope + support.constant.handlebars, meta.function.block.start.handlebars + settings + + foreground + #66d9ef + + + + name + CSS: @at-rule + scope + meta.preprocessor.at-rule keyword.control.at-rule + settings + + foreground + #f6aa11 + + + + name + CSS: #Id + scope + meta.selector.css entity.other.attribute-name.id + settings + + foreground + #f6aa11 + + + + name + CSS: .class + scope + meta.selector.css entity.other.attribute-name.class + settings + + foreground + #a6e22e + + + + name + CSS: Property Name + scope + support.type.property-name.css + settings + + foreground + #66d9ef + + + + name + CSS: Constructor Argument + scope + meta.constructor.argument.css + settings + + foreground + #f6aa11 + + + + name + CSS: {} + scope + punctuation.section.property-list.css + settings + + foreground + #ffffff + + + + name + CSS: Tag Punctuation + scope + punctuation.definition.tag.css + settings + + foreground + #f92672 + + + + name + CSS: : , + scope + punctuation.separator.key-value.css, punctuation.terminator.rule.css + settings + + fontStyle + + foreground + #ffffff + + + + name + CSS :pseudo + scope + entity.other.attribute-name.pseudo-element.css, entity.other.attribute-name.pseudo-class.css, entity.other.attribute-name.pseudo-selector.css + settings + + fontStyle + + foreground + #a6e22e + + + + name + LESS variables + scope + variable.other.less + settings + + foreground + #ffffff + + + + name + LESS mixins + scope + entity.other.less.mixin + settings + + fontStyle + italic + foreground + #e0fdce + + + + name + LESS: Extend + scope + entity.other.attribute-name.pseudo-element.less + settings + + fontStyle + + foreground + #ff9117 + + + + name + JS: this + scope + variable.language.this.js + settings + + foreground + #ae81ff + + + + name + JS: Function Name + scope + meta.function.js, entity.name.function.js, support.function.dom.js + settings + + fontStyle + + foreground + #a6e22e + + + + name + JS: Method Name + scope + entity.name.method.js + settings + + fontStyle + + foreground + #a6e22e + + + + name + JS: Accessor Name + scope + entity.name.accessor.js + settings + + fontStyle + + foreground + #a6e22e + + + + name + JS: Storage Type + scope + storage.type.js + settings + + fontStyle + italic + foreground + #66d9ef + + + + name + JS: Source + scope + text.html.basic, source.js.embedded.html + settings + + fontStyle + + foreground + #ffffff + + + + name + JS: Function + scope + storage.type.function.js + settings + + fontStyle + italic + foreground + #66d9ef + + + + name + JS: Numeric Constant + scope + constant.numeric.js + settings + + foreground + #ae81ff + + + + name + JS: [] + scope + meta.brace.square.js + settings + + foreground + #ffffff + + + + name + JS: () + scope + meta.brace.round, punctuation.definition.parameters.begin.js, punctuation.definition.parameters.end.js + settings + + foreground + #ffffff + + + + name + JS: {} + scope + meta.brace.curly.js + settings + + foreground + #ffffff + + + + name + JS: Template String + scope + punctuation.template-string.element.begin.js, punctuation.template-string.element.end.js + settings + + foreground + #e69f66 + + + + name + JSON String + scope + meta.structure.dictionary.json string.quoted.double.json + settings + + foreground + #cfcfc2 + + + + name + CoffeeScript: Template String + scope + punctuation.section.embedded.coffee + settings + + foreground + #e69f66 + + + + name + CoffeeScript: this + scope + variable.language.this.coffee + settings + + foreground + #ae81ff + + + + name + PHP: [] + scope + keyword.operator.index-start.php, keyword.operator.index-end.php + settings + + foreground + #ffffff + + + + name + PHP: Array + scope + meta.array.php + settings + + foreground + #ffffff + + + + name + PHP: Array() + scope + meta.array.php support.function.construct.php, meta.array.empty.php support.function.construct.php + settings + + fontStyle + + foreground + #e42e70 + + + + name + PHP: Array Construct + scope + support.function.construct.php + settings + + foreground + #e42e70 + + + + name + PHP: Storage Type Function + scope + storage.type.function.php + settings + + foreground + #f92672dd + + + + name + PHP: Numeric Constant + scope + constant.numeric.php + settings + + foreground + #be84ff + + + + name + PHP: New + scope + keyword.other.new.php + settings + + foreground + #f6aa11 + + + + name + PHP: :: + scope + support.class.php + settings + + fontStyle + + foreground + #ffffff + + + + name + PHP: Other Property + scope + variable.other.property.php + settings + + foreground + #f6aa11 + + + + name + PHP: Class + scope + storage.modifier.extends.php, storage.type.class.php, keyword.operator.class.php + settings + + foreground + #a6e22e + + + + name + PHP: Inherited Class + scope + meta.other.inherited-class.php + settings + + fontStyle + + foreground + #a6e22e + + + + name + PHP: Storage Type + scope + storage.type.php + settings + + foreground + #66d9ef + + + + name + PHP: Function + scope + entity.name.function.php + settings + + foreground + #66d9ef + + + + name + PHP: Function Construct + scope + support.function.construct.php + settings + + foreground + #a6e22e + + + + name + PHP: Function Call + scope + entity.name.type.class.php, meta.function-call.php, meta.function-call.static.php, meta.function-call.object.php + settings + + foreground + #ffffff + + + + name + PHP: Comment + scope + keyword.other.phpdoc + settings + + fontStyle + + foreground + #7c7865 + + + + name + PHP: Source Emebedded + scope + source.php.embedded.block.html + settings + + foreground + #ffffff + + + + name + Invalid + scope + invalid + settings + + background + #f92672 + fontStyle + + foreground + #f8f8f0 + + + + name + Invalid deprecated + scope + invalid.deprecated + settings + + background + #ae81ff + foreground + #f8f8f0 + + + + name + diff.header + scope + meta.diff, meta.diff.header + settings + + foreground + #75715e + + + + name + diff.deleted + scope + markup.deleted + settings + + foreground + #f92672 + + + + name + diff.inserted + scope + markup.inserted + settings + + foreground + #a6e22e + + + + name + diff.changed + scope + markup.changed + settings + + foreground + #e6db74 + + + + name + diff.range + scope + meta.diff, meta.diff.range + settings + + foreground + #3bc0f0 + + + + name + Python: storage + scope + storage.type.class.python, storage.type.function.python, storage.modifier.global.python + settings + + fontStyle + + foreground + #3bc0f0 + + + + name + Python: import + scope + keyword.control.import.python, keyword.control.import.from.python + settings + + foreground + #f92672dd + + + + name + Python: Support.exception + scope + support.type.exception.python + settings + + foreground + #66d9ef + + + + name + Python: function call + scope + meta.function-call.python - punctuation - meta.function-call.arguments.python + settings + + foreground + #A6E22E + + + + name + Perl: variables + scope + punctuation.definition.variable.perl, variable.other.readwrite.global.perl, variable.other.predefined.perl, keyword.operator.comparison.perl + settings + + foreground + #e42e70 + + + + name + Perl: functions + scope + support.function.perl + settings + + foreground + #66d9ef + + + + name + Perl: comments + scope + comment.line.number-sign.perl + settings + + fontStyle + italic + foreground + #75715e + + + + name + Perl: quotes + scope + punctuation.definition.string.begin.perl, punctuation.definition.string.end.perl + settings + + foreground + #ffffff + + + + name + Perl: char + scope + constant.character.escape.perl + settings + + foreground + #dc322f + + + + name + Ruby: Constant + scope + constant.language.ruby, constant.numeric.ruby + settings + + foreground + #ae81ff + + + + name + Ruby: Variable definition + scope + punctuation.definition.variable.ruby + settings + + fontStyle + + foreground + #f6aa11 + + + + name + Ruby: Function Name + scope + meta.function.method.with-arguments.ruby + settings + + foreground + #a6e22e + + + + name + Ruby: Variable + scope + variable.language.ruby + settings + + foreground + #ffffff + + + + name + Ruby: Function + scope + entity.name.function.ruby + settings + + foreground + #f6aa11 + + + + name + Ruby: Keyword Control + scope + keyword.control.ruby, keyword.control.def.ruby + settings + + fontStyle + bold + foreground + #a6e22e + + + + name + Ruby: Class + scope + keyword.control.class.ruby, meta.class.ruby + settings + + foreground + #a6e22e + + + + name + Ruby: Class Name + scope + entity.name.type.class.ruby + settings + + fontStyle + + foreground + #66d9ef + + + + name + Ruby: Keyword + scope + keyword.control.ruby + settings + + fontStyle + + foreground + #a6e22e + + + + name + Ruby: Support Class + scope + support.class.ruby + settings + + fontStyle + + foreground + #66d9ef + + + + name + Ruby: Special Method + scope + keyword.other.special-method.ruby + settings + + foreground + #a6e22e + + + + name + Ruby: Constant Other + scope + variable.other.constant.ruby + settings + + fontStyle + + foreground + #66d9ef + + + + name + Ruby: :symbol + scope + constant.other.symbol.ruby + settings + + fontStyle + + foreground + #f6f080 + + + + name + Ruby: Punctuation Section + scope + punctuation.section.embedded.ruby, punctuation.definition.string.begin.ruby, punctuation.definition.string.end.ruby + settings + + foreground + #f92672 + + + + name + Ruby: Special Method + scope + keyword.other.special-method.ruby + settings + + foreground + #e42e70 + + + + name + Markdown: plain + scope + text.html.markdown + settings + + foreground + #ffffff + + + + name + Markup: raw inline + scope + text.html.markdown markup.raw.inline + settings + + foreground + #ec3533 + + + + name + Markdown: linebreak + scope + text.html.markdown meta.dummy.line-break + settings + + foreground + #e0eddd + + + + name + Markdown: heading + scope + markdown.heading, markup.heading | markup.heading entity.name, markup.heading.markdown punctuation.definition.heading.markdown + settings + + fontStyle + + foreground + #fd971f + + + + name + Markup: Heading 1 + scope + markup.heading.1.markdown + settings + + fontStyle + + foreground + #fc951e + + + + name + Markup: Heading 2 + scope + markup.heading.2.markdown + settings + + fontStyle + + foreground + #e8891c + + + + name + Markup: Heading 3 + scope + markup.heading.3.markdown + settings + + fontStyle + + foreground + #d47d19 + + + + name + Markup: Heading 4 + scope + markup.heading.4.markdown + settings + + fontStyle + + foreground + #bf7117 + + + + name + Markup: Heading 5 + scope + markup.heading.5.markdown + settings + + fontStyle + + foreground + #ab6515 + + + + name + Markup: Heading 6 + scope + markup.heading.6.markdown + settings + + fontStyle + + foreground + #965912 + + + + name + Markup: italic + scope + markup.italic + settings + + fontStyle + italic + foreground + #e42e70 + + + + name + Markup: bold + scope + markup.bold + settings + + fontStyle + bold + foreground + #f92672 + + + + name + Markup: underline + scope + markup.underline + settings + + fontStyle + underline + foreground + #a6e22e + + + + name + Markup: strike + scope + markup.strike + settings + + fontStyle + + foreground + #cc4273 + + + + name + Markdown: Blockquote + scope + markup.quote, punctuation.definition.blockquote.markdown + settings + + fontStyle + italic + foreground + #66d9ef + + + + name + Markup: Quote + scope + markup.quote + settings + + fontStyle + italic + foreground + #66d9ef + + + + name + Markdown: Link + scope + string.other.link.title.markdown + settings + + fontStyle + underline + foreground + #66d9ef + + + + name + Markup: Raw block + scope + markup.raw.block + settings + + foreground + #ae81ff + + + + name + Markdown: List Items Punctuation + scope + punctuation.definition.list_item.markdown + settings + + foreground + #ffffff + + + + name + Markdown: Raw Block fenced + scope + markup.raw.block.fenced.markdown + settings + + background + #222 + foreground + #ffffff + + + + name + Markdown: Fenced Bode Block + scope + punctuation.definition.fenced.markdown, variable.language.fenced.markdown + settings + + background + #222222 + foreground + #636050 + + + + name + Markdown: Fenced Language + scope + variable.language.fenced.markdown + settings + + fontStyle + + foreground + #7c7865 + + + + name + Markdown: Separator + scope + meta.separator + settings + + background + #ffffff0f + fontStyle + bold + foreground + #ffffff33 + + + + name + Markup: table + scope + markup.table + settings + + background + #ff3a281a + foreground + #b42a1d + + + + name + Other: Removal + scope + other.package.exclude, other.remove + settings + + fontStyle + + foreground + #d3201f + + + + name + Shell: builtin + scope + support.function.builtin.shell + settings + + foreground + #a6e22e + + + + name + Shell: variable + scope + variable.other.normal.shell + settings + + foreground + #66d9ef + + + + name + Shell: DOTFILES + scope + source.shell + settings + + fontStyle + + foreground + #ffffff + + + + name + Shell: meta scope in loop + scope + meta.scope.for-in-loop.shell, variable.other.loop.shell + settings + + fontStyle + + foreground + #fd971f + + + + name + Shell: Function name + scope + entity.name.function.shell + settings + + fontStyle + + foreground + #a6e22e + + + + name + Shell: Quotation Marks + scope + punctuation.definition.string.end.shell, punctuation.definition.string.begin.shell + settings + + fontStyle + + foreground + #ffffff + + + + name + Shell: Meta Block + scope + meta.scope.case-block.shell, meta.scope.case-body.shell + settings + + fontStyle + + foreground + #fd971f + + + + name + Shell: [] + scope + punctuation.definition.logical-expression.shell + settings + + fontStyle + + foreground + #ffffff + + + + name + Shell: Comment + scope + comment.line.number-sign.shell + settings + + fontStyle + italic + foreground + #7c7865 + + + + name + Makefile: Comment + scope + comment.line.number-sign.makefile + settings + + fontStyle + + foreground + #7c7865 + + + + name + Makefile: Comment punctuation + scope + punctuation.definition.comment.makefile + settings + + fontStyle + + foreground + #7c7865 + + + + name + Makefile: Variables + scope + variable.other.makefile + settings + + fontStyle + + foreground + #f92672 + + + + name + Makefile: Function name + scope + entity.name.function.makefile + settings + + fontStyle + + foreground + #a6e22e + + + + name + Makefile: Function + scope + meta.function.makefile + settings + + fontStyle + + foreground + #66d9ef + + + + name + LaTeX: Math Variables + scope + variable.other.math.tex + settings + + foreground + #E6DB74 + + + + name + GitGutter deleted + scope + markup.deleted.git_gutter + settings + + foreground + #F92672 + + + + name + GitGutter inserted + scope + markup.inserted.git_gutter + settings + + foreground + #A6E22E + + + + name + GitGutter changed + scope + markup.changed.git_gutter + settings + + foreground + #FC951E + + + + name + GitGutter ignored + scope + markup.ignored.git_gutter + settings + + foreground + #565656 + + + + name + GitGutter untracked + scope + markup.untracked.git_gutter + settings + + foreground + #565656 + + + + name + Nginx path + scope + string.other.path.nginx + settings + + foreground + #fc951e + + + + uuid + 6d3d6dae-b9c2-48ad-9e2a-71fefe15be64 + + diff --git a/assets/themes/Monokai Extended.tmTheme b/assets/themes/Monokai Extended.tmTheme new file mode 100644 index 0000000..9c2aa3e --- /dev/null +++ b/assets/themes/Monokai Extended.tmTheme @@ -0,0 +1,1878 @@ + + + + + author + github.com/jonschlinkert + colorSpaceName + sRGB + gutterSettings + + background + #073642 + divider + #586e75 + foreground + #839496 + selectionBackground + #586e75 + selectionForeground + #a6e22e + + name + Monokai Extended + semanticClass + theme.dark.monokai_extended + settings + + + settings + + activeGuide + #9d550fb0 + background + #222222 + bracketContentsForeground + #f8f8f2a5 + bracketContentsOptions + underline + bracketsForeground + #f8f8f2a5 + bracketsOptions + underline + caret + #f8f8f0 + findHighlight + #ffe792 + findHighlightForeground + #000000 + foreground + #f8f8f2 + invisibles + #3b3a32 + lineHighlight + #333333 + selection + #444444 + selectionBorder + #1c1c1c + tagsOptions + stippled_underline + + + + name + Comment + scope + comment + settings + + foreground + #75715e + + + + name + String + scope + string + settings + + foreground + #e6db74 + + + + name + Number + scope + constant.numeric + settings + + foreground + #be84ff + + + + name + Constant: Built-in + scope + constant.language, meta.preprocessor + settings + + foreground + #be84ff + + + + name + Constant: User-defined + scope + constant.character, constant.other + settings + + foreground + #be84ff + + + + name + Variable + scope + variable.language, variable.other + settings + + foreground + #ffffff + + + + name + Keyword + scope + keyword + settings + + foreground + #f92672 + + + + name + Storage + scope + storage + settings + + fontStyle + + foreground + #f92672 + + + + name + Storage type + scope + storage.type + settings + + fontStyle + italic + foreground + #66d9ef + + + + name + Class name + scope + entity.name.class + settings + + fontStyle + underline + foreground + #66D9EF + + + + name + Inherited class + scope + entity.other.inherited-class + settings + + fontStyle + italic underline + foreground + #a6e22e + + + + name + Function name + scope + entity.name.function + settings + + fontStyle + + foreground + #a6e22e + + + + name + Function argument + scope + variable.parameter + settings + + fontStyle + italic + foreground + #fd971f + + + + name + Tag name + scope + entity.name.tag + settings + + fontStyle + + foreground + #f92672 + + + + name + Tag attribute + scope + entity.other.attribute-name + settings + + fontStyle + + foreground + #a6e22e + + + + name + Library function + scope + support.function + settings + + fontStyle + + foreground + #66d9ef + + + + name + Library constant + scope + support.constant + settings + + fontStyle + + foreground + #66d9ef + + + + name + Library class/type + scope + support.type, support.class + settings + + fontStyle + italic + foreground + #A6E22E + + + + name + Library variable + scope + support.other.variable + settings + + fontStyle + + + + + name + String constant + scope + string constant + settings + + foreground + #66d9ef + + + + name + String.regexp + scope + string.regexp + settings + + foreground + #f6aa11 + + + + name + String variable + scope + string variable + settings + + foreground + #ffffff + + + + name + Variable: punctuation + scope + punctuation.definition.variable + settings + + foreground + #ffffff + + + + name + Entity + scope + entity + settings + + fontStyle + + foreground + #a6e22e + + + + name + HTML: Doctype/XML Processing + scope + meta.tag.sgml.doctype.xml, declaration.sgml.html declaration.doctype, declaration.sgml.html declaration.doctype entity, declaration.sgml.html declaration.doctype string, declaration.xml-processing, declaration.xml-processing entity, declaration.xml-processing string, doctype + settings + + foreground + #c8cecc + + + + name + HTML: Comment Block + scope + comment.block.html + settings + + fontStyle + + foreground + #7c7865 + + + + name + HTML: Script + scope + entity.name.tag.script.html + settings + + fontStyle + italic + + + + name + HTML: Attribute punctuation + scope + text.html.basic meta.tag.other.html, text.html.basic meta.tag.any.html, text.html.basic meta.tag.block.any, text.html.basic meta.tag.inline.any, text.html.basic meta.tag.structure.any.html, text.html.basic source.js.embedded.html, punctuation.separator.key-value.html + settings + + fontStyle + + foreground + #a6e22e + + + + name + HTML: Attributes + scope + text.html.basic entity.other.attribute-name.html + settings + + foreground + #a6e22e + + + + name + HTML: Quotation Marks + scope + text.html.basic meta.tag.structure.any.html punctuation.definition.string.begin.html, punctuation.definition.string.begin.html, punctuation.definition.string.end.html + settings + + fontStyle + + foreground + #ffffff + + + + name + HTML: Tags punctuation + scope + punctuation.definition.tag.end, punctuation.definition.tag.begin, punctuation.definition.tag + settings + + foreground + #ffffff + + + + name + Handlebars: Variable + scope + variable.parameter.handlebars + settings + + foreground + #f6aa11 + + + + name + Handlebars: Constant + scope + support.constant.handlebars, meta.function.block.start.handlebars + settings + + foreground + #66d9ef + + + + name + CSS: @at-rule + scope + meta.preprocessor.at-rule keyword.control.at-rule + settings + + foreground + #f6aa11 + + + + name + CSS: #Id + scope + meta.selector.css entity.other.attribute-name.id + settings + + foreground + #f6aa11 + + + + name + CSS: .class + scope + meta.selector.css entity.other.attribute-name.class + settings + + foreground + #a6e22e + + + + name + CSS: Property Name + scope + support.type.property-name.css + settings + + foreground + #66d9ef + + + + name + CSS: Constructor Argument + scope + meta.constructor.argument.css + settings + + foreground + #f6aa11 + + + + name + CSS: {} + scope + punctuation.section.property-list.css + settings + + foreground + #ffffff + + + + name + CSS: Tag Punctuation + scope + punctuation.definition.tag.css + settings + + foreground + #f92672 + + + + name + CSS: : , + scope + punctuation.separator.key-value.css, punctuation.terminator.rule.css + settings + + fontStyle + + foreground + #ffffff + + + + name + CSS :pseudo + scope + entity.other.attribute-name.pseudo-element.css, entity.other.attribute-name.pseudo-class.css, entity.other.attribute-name.pseudo-selector.css + settings + + fontStyle + + foreground + #a6e22e + + + + name + LESS variables + scope + variable.other.less + settings + + foreground + #ffffff + + + + name + LESS mixins + scope + entity.other.less.mixin + settings + + fontStyle + italic + foreground + #e0fdce + + + + name + LESS: Extend + scope + entity.other.attribute-name.pseudo-element.less + settings + + fontStyle + + foreground + #ff9117 + + + + name + JS: Instance constructor + scope + meta.instance.constructor meta.function-call.constructor.js + settings + + fontStyle + + foreground + #a6e22e + + + + name + JS: es6 template delimiters ${} + scope + meta.template.expression.js punctuation.definition.template-expression.begin.js, meta.template.expression.js punctuation.definition.template-expression.end.js, meta.template.expression.js punctuation.accessor + settings + + fontStyle + + foreground + #AFF132 + + + + name + JS: Function Name + scope + meta.function.js, entity.name.function.js, support.function.dom.js + settings + + fontStyle + + foreground + #a6e22e + + + + name + JS: Param commas + scope + source.js meta.function.js punctuation.separator.parameter.function.js + settings + + fontStyle + + foreground + #ffffff + + + + name + JS: Object dot notation + scope + meta.property.object.js, keyword.operator.accessor.js + settings + + fontStyle + + foreground + #ffffff + + + + name + JS: colons + scope + source.js meta.group.braces.curly constant.other.object.key.js punctuation.separator.key-value.js + settings + + fontStyle + + foreground + #ffffff + + + + name + JS: unquoted string + scope + source.js meta.group.braces.curly constant.other.object.key.js string.unquoted.label.js + settings + + fontStyle + + foreground + #ffffff + + + + name + JS: receiver + scope + support.type.object.module.js, source.js meta.function.declaration.js support.class.js + settings + + fontStyle + + foreground + #66d9ef + + + + name + JS: receiver property + scope + support.type.object.module.js support.type.object.module.js + settings + + fontStyle + + foreground + #a6e22e + + + + name + JS: Storage Type + scope + storage.type.js + settings + + fontStyle + italic + foreground + #66d9ef + + + + name + JS: Source + scope + text.html.basic source.js.embedded.html + settings + + fontStyle + + foreground + #ffffff + + + + name + JS: Function + scope + storage.type.function.js + settings + + fontStyle + italic + foreground + #66d9ef + + + + name + JS: Numeric Constant + scope + constant.numeric.js + settings + + foreground + #ae81ff + + + + name + JS: Literal language variable + scope + variable.language.arguments.js, variable.language.super.js, variable.language.this.js, variable.language.self.js, variable.language.proto.js, variable.language.constructor.js, variable.language.prototype.js + settings + + fontStyle + italic + foreground + #66d9ef + + + + name + JS: [] + scope + meta.brace.square.js + settings + + foreground + #ffffff + + + + name + JS: () + scope + meta.brace.round, punctuation.definition.parameters.begin.js, punctuation.definition.parameters.end.js, punctuation.definition.group + settings + + foreground + #ffffff + + + + name + JS: object literal {} + scope + meta.brace.curly.js, meta.object-literal.js + settings + + foreground + #ffffff + + + + name + JSON String + scope + meta.structure.dictionary.json string.quoted.double.json + settings + + foreground + #cfcfc2 + + + + name + CoffeeScript String Interpolated + scope + punctuation.section.embedded.coffee + settings + + foreground + #e69f66 + + + + name + PHP: [] + scope + keyword.operator.index-start.php, keyword.operator.index-end.php + settings + + foreground + #ffffff + + + + name + PHP: Array + scope + meta.array.php + settings + + foreground + #ffffff + + + + name + PHP: Array() + scope + meta.array.php support.function.construct.php, meta.array.empty.php support.function.construct.php + settings + + fontStyle + + foreground + #e42e70 + + + + name + PHP: Array Construct + scope + support.function.construct.php + settings + + foreground + #e42e70 + + + + name + PHP: Storage Type Function + scope + storage.type.function.php + settings + + foreground + #f92672dd + + + + name + PHP: Numeric Constant + scope + constant.numeric.php + settings + + foreground + #be84ff + + + + name + PHP: New + scope + keyword.other.new.php + settings + + foreground + #f6aa11 + + + + name + PHP: :: + scope + support.class.php + settings + + fontStyle + + foreground + #ffffff + + + + name + PHP: Other Property + scope + variable.other.property.php + settings + + foreground + #f6aa11 + + + + name + PHP: Class + scope + storage.modifier.extends.php, storage.type.class.php, keyword.operator.class.php + settings + + foreground + #a6e22e + + + + name + PHP: Inherited Class + scope + meta.other.inherited-class.php + settings + + fontStyle + + foreground + #a6e22e + + + + name + PHP: Storage Type + scope + storage.type.php + settings + + foreground + #66d9ef + + + + name + PHP: Function + scope + entity.name.function.php + settings + + foreground + #66d9ef + + + + name + PHP: Function Construct + scope + support.function.construct.php + settings + + foreground + #a6e22e + + + + name + PHP: Function Call + scope + entity.name.type.class.php, meta.function-call.php, meta.function-call.static.php, meta.function-call.object.php + settings + + foreground + #ffffff + + + + name + PHP: Comment + scope + keyword.other.phpdoc + settings + + fontStyle + + foreground + #7c7865 + + + + name + PHP: Source Emebedded + scope + source.php.embedded.block.html + settings + + foreground + #ffffff + + + + name + Invalid + scope + invalid + settings + + background + #f92672 + fontStyle + + foreground + #f8f8f0 + + + + name + Invalid deprecated + scope + invalid.deprecated + settings + + background + #ae81ff + foreground + #f8f8f0 + + + + name + diff.header + scope + meta.diff, meta.diff.header + settings + + foreground + #75715e + + + + name + diff.deleted + scope + markup.deleted + settings + + foreground + #f92672 + + + + name + diff.inserted + scope + markup.inserted + settings + + foreground + #a6e22e + + + + name + diff.changed + scope + markup.changed + settings + + foreground + #e6db74 + + + + name + diff.range + scope + meta.diff, meta.diff.range + settings + + foreground + #3bc0f0 + + + + name + Python: storage + scope + storage.type.class.python, storage.type.function.python, storage.modifier.global.python + settings + + fontStyle + + foreground + #a6e22e + + + + name + Python: import + scope + keyword.control.import.python, keyword.control.import.from.python + settings + + foreground + #f92672dd + + + + name + Python: Support.exception + scope + support.type.exception.python + settings + + foreground + #66d9ef + + + + name + Perl: variables + scope + punctuation.definition.variable.perl, variable.other.readwrite.global.perl, variable.other.predefined.perl, keyword.operator.comparison.perl + settings + + foreground + #e42e70 + + + + name + Perl: functions + scope + support.function.perl + settings + + foreground + #66d9ef + + + + name + Perl: comments + scope + comment.line.number-sign.perl + settings + + fontStyle + italic + foreground + #75715e + + + + name + Perl: quotes + scope + punctuation.definition.string.begin.perl, punctuation.definition.string.end.perl + settings + + foreground + #ffffff + + + + name + Perl: char + scope + constant.character.escape.perl + settings + + foreground + #dc322f + + + + name + Ruby: Constant + scope + constant.language.ruby, constant.numeric.ruby + settings + + foreground + #ae81ff + + + + name + Ruby: Variable definition + scope + punctuation.definition.variable.ruby + settings + + fontStyle + + foreground + #f6aa11 + + + + name + Ruby: Function Name + scope + meta.function.method.with-arguments.ruby + settings + + foreground + #a6e22e + + + + name + Ruby: Variable + scope + variable.language.ruby + settings + + foreground + #ffffff + + + + name + Ruby: Function + scope + entity.name.function.ruby + settings + + foreground + #f6aa11 + + + + name + Ruby: Keyword Control + scope + keyword.control.ruby, keyword.control.def.ruby + settings + + fontStyle + bold + foreground + #a6e22e + + + + name + Ruby: Class + scope + keyword.control.class.ruby, meta.class.ruby + settings + + foreground + #a6e22e + + + + name + Ruby: Class Name + scope + entity.name.type.class.ruby + settings + + fontStyle + + foreground + #66d9ef + + + + name + Ruby: Keyword + scope + keyword.control.ruby + settings + + fontStyle + + foreground + #a6e22e + + + + name + Ruby: Support Class + scope + support.class.ruby + settings + + fontStyle + + foreground + #66d9ef + + + + name + Ruby: Special Method + scope + keyword.other.special-method.ruby + settings + + foreground + #a6e22e + + + + name + Ruby: Constant Other + scope + variable.other.constant.ruby + settings + + fontStyle + + foreground + #66d9ef + + + + name + Ruby: :symbol + scope + constant.other.symbol.ruby + settings + + fontStyle + + foreground + #f6f080 + + + + name + Ruby: Punctuation Section + scope + punctuation.section.embedded.ruby, punctuation.definition.string.begin.ruby, punctuation.definition.string.end.ruby + settings + + foreground + #f92672 + + + + name + Ruby: Special Method + scope + keyword.other.special-method.ruby + settings + + foreground + #e42e70 + + + + name + Markdown: plain + scope + text.html.markdown + settings + + foreground + #ffffff + + + + name + Markup: raw inline + scope + text.html.markdown markup.raw.inline + settings + + foreground + #ec3533 + + + + name + Markdown: linebreak + scope + text.html.markdown meta.dummy.line-break + settings + + foreground + #e0eddd + + + + name + Markdown: heading + scope + markdown.heading, markup.heading | markup.heading entity.name, markup.heading.markdown punctuation.definition.heading.markdown + settings + + fontStyle + + foreground + #fd971f + + + + name + Markup: italic + scope + markup.italic + settings + + fontStyle + italic + foreground + #e42e70 + + + + name + Markup: bold + scope + markup.bold + settings + + fontStyle + bold + foreground + #f92672 + + + + name + Markup: underline + scope + markup.underline + settings + + fontStyle + underline + foreground + #a6e22e + + + + name + Markup: strike + scope + markup.strike + settings + + fontStyle + + foreground + #cc4273 + + + + name + Markdown: Blockquote + scope + markup.quote, punctuation.definition.blockquote.markdown + settings + + fontStyle + italic + foreground + #66d9ef + + + + name + Markup: Quote + scope + markup.quote + settings + + fontStyle + italic + foreground + #66d9ef + + + + name + Markdown: Link + scope + string.other.link.title.markdown + settings + + fontStyle + underline + foreground + #66d9ef + + + + name + Markup: Raw block + scope + markup.raw.block + settings + + foreground + #ae81ff + + + + name + Markdown: List Items Punctuation + scope + punctuation.definition.list_item.markdown + settings + + foreground + #777777 + + + + name + Markdown: Raw Block fenced + scope + markup.raw.block.fenced.markdown + settings + + background + #222 + foreground + #ffffff + + + + name + Markdown: Fenced Bode Block + scope + punctuation.definition.fenced.markdown, variable.language.fenced.markdown + settings + + background + #222222 + foreground + #636050 + + + + name + Markdown: Fenced Language + scope + variable.language.fenced.markdown + settings + + fontStyle + + foreground + #7c7865 + + + + name + Markdown: Separator + scope + meta.separator + settings + + background + #ffffff0f + fontStyle + bold + foreground + #ffffff33 + + + + name + Markup: table + scope + markup.table + settings + + background + #ff3a281a + foreground + #b42a1d + + + + name + LaTeX: Math Variables + scope + variable.other.math.tex + settings + + foreground + #e6db74 + + + + name + Other: Removal + scope + other.package.exclude, other.remove + settings + + fontStyle + + foreground + #d3201f + + + + name + Shell: builtin + scope + support.function.builtin.shell + settings + + foreground + #a6e22e + + + + name + Shell: variable + scope + variable.other.normal.shell + settings + + foreground + #66d9ef + + + + name + Shell: DOTFILES + scope + source.shell + settings + + fontStyle + + foreground + #ffffff + + + + name + Shell: meta scope in loop + scope + meta.scope.for-in-loop.shell, variable.other.loop.shell + settings + + fontStyle + + foreground + #fd971f + + + + name + Shell: Function name + scope + entity.name.function.shell + settings + + fontStyle + + foreground + #a6e22e + + + + name + Shell: Quotation Marks + scope + punctuation.definition.string.end.shell, punctuation.definition.string.begin.shell + settings + + fontStyle + + foreground + #ffffff + + + + name + Shell: Meta Block + scope + meta.scope.case-block.shell, meta.scope.case-body.shell + settings + + fontStyle + + foreground + #fd971f + + + + name + Shell: [] + scope + punctuation.definition.logical-expression.shell + settings + + fontStyle + + foreground + #ffffff + + + + name + Shell: Comment + scope + comment.line.number-sign.shell + settings + + fontStyle + italic + foreground + #7c7865 + + + + name + Makefile: Comment + scope + comment.line.number-sign.makefile + settings + + fontStyle + + foreground + #7c7865 + + + + name + Makefile: Comment punctuation + scope + punctuation.definition.comment.makefile + settings + + fontStyle + + foreground + #7c7865 + + + + name + Makefile: Variables + scope + variable.other.makefile + settings + + fontStyle + + foreground + #f92672 + + + + name + Makefile: Function name + scope + entity.name.function.makefile + settings + + fontStyle + + foreground + #a6e22e + + + + name + Makefile: Function + scope + meta.function.makefile + settings + + fontStyle + + foreground + #66d9ef + + + + name + GitGutter deleted + scope + markup.deleted.git_gutter + settings + + foreground + #F92672 + + + + name + GitGutter inserted + scope + markup.inserted.git_gutter + settings + + foreground + #A6E22E + + + + name + GitGutter changed + scope + markup.changed.git_gutter + settings + + foreground + #FC951E + + + + name + GitGutter ignored + scope + markup.ignored.git_gutter + settings + + foreground + #565656 + + + + name + GitGutter untracked + scope + markup.untracked.git_gutter + settings + + foreground + #565656 + + + + name + Nginx path + scope + string.other.path.nginx + settings + + foreground + #fc951e + + + + uuid + 1D07ACC0-832F-11E2-9E96-0800200C9A66 + + diff --git a/assets/themes/OneHalfDark.tmTheme b/assets/themes/OneHalfDark.tmTheme new file mode 100644 index 0000000..b16050c --- /dev/null +++ b/assets/themes/OneHalfDark.tmTheme @@ -0,0 +1,663 @@ + + + + + + name + OneHalfLight + semanticClass + theme.dark.one_half_dark + uuid + + colorSpaceName + sRGB + author + Son A. Pham <sp@sonpham.me> + comment + A dark iTerm color scheme based on Atom's One. See github.com/sonph/onehalf for installation instructions, a light color scheme, and versions for other editors/terminals such as (Neo)Vim and Sublime Text. + settings + + + settings + + fontStyle + + foreground + #dcdfe4 + background + #282c34 + bracketsOptions + underline + caret + #a3b3cc + gutter + #282c34 + gutterForeground + #919baa + invisibles + #5c6370 + lineHighlight + #313640 + selection + #474e5d + selectionBorder + #474e5d + tagsForeground + + tagsOptions + stippled_underline + bracketContentsOptions + underline + + + + name + Comments + scope + comment + settings + + foreground + #5c6370 + + + + name + Text + scope + variable.parameter.function + settings + + foreground + #dcdfe4 + + + + name + Delimiters + scope + none + settings + + foreground + + + + + name + Operators + scope + keyword.operator + settings + + foreground + + + + + name + Keywords + scope + keyword + settings + + foreground + #c678dd + + + + name + Variables + scope + variable + settings + + foreground + #e06c75 + + + + name + Functions + scope + entity.name.function, meta.require, support.function.any-method + settings + + foreground + #61afef + + + + name + Classes + scope + support.class, entity.name.class, entity.name.type.class + settings + + foreground + #e5c07b + + + + name + Classes + scope + meta.class + settings + + foreground + #e5c07b + + + + name + Methods + scope + keyword.other.special-method + settings + + foreground + #61afef + + + + name + Storage + scope + storage + settings + + foreground + #c678dd + + + + name + Support + scope + support.function + settings + + foreground + #61afef + + + + name + Strings, Inherited Class + scope + string + settings + + foreground + #98c379 + + + + name + Integers + scope + constant.numeric + settings + + foreground + #e5c07b + + + + name + Floats + scope + none + settings + + foreground + #e5c07b + + + + name + Boolean + scope + none + settings + + foreground + #e5c07b + + + + name + Constants + scope + constant + settings + + foreground + #e5c07b + + + + name + HTML: Tags + scope + entity.name.tag + settings + + foreground + #e06c75 + + + + name + HTML: Tag attributes + scope + entity.other.attribute-name + settings + + foreground + #e5c07b + + + + name + Attribute IDs + scope + entity.other.attribute-name.id, punctuation.definition.entity + settings + + foreground + #e5c07b + + + + name + Selector + scope + meta.selector + settings + + foreground + #c678dd + + + + name + Markdown: Headings + scope + markup.heading punctuation.definition.heading, entity.name.section + settings + + fontStyle + + foreground + #61afef + + + + name + Markdown: Bold + scope + markup.bold, punctuation.definition.bold + settings + + foreground + #c678dd + + + + name + Markdown: Italic + scope + markup.italic, punctuation.definition.italic + settings + + foreground + #c678dd + + + + name + Markdown: Code + scope + markup.raw.inline + settings + + foreground + #98c379 + + + + name + Markdown: Link Text + scope + string.other.link, punctuation.definition.string.end.markdown + settings + + foreground + + + + + name + Markdown: Link Url + scope + meta.link + settings + + foreground + #98c379 + + + + name + Markdown: Lists + scope + markup.list + settings + + foreground + + + + + name + Markdown: Quotes + scope + markup.quote + settings + + foreground + #98c379 + + + + name + Java Source + scope + source.java meta.class.java meta.method.java + settings + + foreground + #dcdfe4 + + + + name + Java Class Body + scope + source.java meta.class.java meta.class.body.java + settings + + foreground + #dcdfe4 + + + + name + Javascript: Function Arguments + scope + source.js meta.function.js variable.parameter.function.js + settings + + foreground + #e06c75 + + + + name + Javascript: New Variables + scope + source.js variable.other.readwrite.js + settings + + foreground + #e06c75 + + + + name + Javascript: Variables + scope + source.js variable.other.object.js + settings + + foreground + #dcdfe4 + + + + name + Javascript: Variables in Function Calls + scope + source.js meta.function-call.method.js variable.other.readwrite.js + settings + + foreground + #e06c75 + + + + name + Javascript: New Block Variables + scope + source.js meta.block.js variable.other.readwrite.js + settings + + foreground + #e06c75 + + + + name + Javascript: Block Variables + scope + source.js meta.block.js variable.other.object.js + settings + + foreground + #dcdfe4 + + + + name + Javascript: Block Variables in Function Calls + scope + source.js meta.block.js meta.function-call.method.js variable.other.readwrite.js + settings + + foreground + #dcdfe4 + + + + name + Javascript: Function Calls + scope + source.js meta.function-call.method.js variable.function.js + settings + + foreground + #dcdfe4 + + + + name + Javascript: Properties + scope + source.js meta.property.object.js entity.name.function.js + settings + + foreground + #61afef + + + + name + Javascript: Prototypes + scope + source.js support.constant.prototype.js + settings + + foreground + #dcdfe4 + + + + name + Separator + scope + meta.separator + settings + + background + + foreground + + + + + name + Inserted + scope + markup.inserted + settings + + foreground + #98c379 + + + + name + Deleted + scope + markup.deleted + settings + + foreground + #e06c75 + + + + name + Changed + scope + markup.changed + settings + + foreground + #e5c07b + + + + name + Regular Expressions + scope + string.regexp + settings + + foreground + #98c379 + + + + name + Escape Characters + scope + constant.character.escape + settings + + foreground + #56b6c2 + + + + name + Embedded + scope + punctuation.section.embedded, variable.interpolation + settings + + foreground + + + + + name + Illegal + scope + invalid.illegal + settings + + background + #e06c75 + foreground + #dcdfe4 + + + + name + Broken + scope + invalid.broken + settings + + background + #e5c07b + foreground + #dcdfe4 + + + + name + Deprecated + scope + invalid.deprecated + settings + + background + #e5c07b + foreground + #dcdfe4 + + + + name + Unimplemented + scope + invalid.unimplemented + settings + + background + #c678dd + foreground + #dcdfe4 + + + + + \ No newline at end of file diff --git a/assets/themes/OneHalfLight.tmTheme b/assets/themes/OneHalfLight.tmTheme new file mode 100644 index 0000000..a18ec7b --- /dev/null +++ b/assets/themes/OneHalfLight.tmTheme @@ -0,0 +1,663 @@ + + + + + + name + OneHalfLight + semanticClass + theme.light.one_half_light + uuid + + colorSpaceName + sRGB + author + Son A. Pham <sp@sonpham.me> + comment + A light iTerm color scheme based on Atom's One. See github.com/sonph/onehalf for installation instructions, a dark color scheme, and versions for other editors/terminals such as (Neo)Vim and Sublime Text. + settings + + + settings + + fontStyle + + foreground + #383a42 + background + #fafafa + bracketsOptions + underline + caret + #383a42 + gutter + #fafafa + gutterForeground + #d4d4d4 + invisibles + #a0a1a7 + lineHighlight + #f0f0f0 + selection + #bfceff + selectionBorder + #bfceff + tagsForeground + + tagsOptions + stippled_underline + bracketContentsOptions + underline + + + + name + Comments + scope + comment + settings + + foreground + #a0a1a7 + + + + name + Text + scope + variable.parameter.function + settings + + foreground + #383a42 + + + + name + Delimiters + scope + none + settings + + foreground + + + + + name + Operators + scope + keyword.operator + settings + + foreground + + + + + name + Keywords + scope + keyword + settings + + foreground + #a626a4 + + + + name + Variables + scope + variable + settings + + foreground + #e45649 + + + + name + Functions + scope + entity.name.function, meta.require, support.function.any-method + settings + + foreground + #0184bc + + + + name + Classes + scope + support.class, entity.name.class, entity.name.type.class + settings + + foreground + #c18401 + + + + name + Classes + scope + meta.class + settings + + foreground + #c18401 + + + + name + Methods + scope + keyword.other.special-method + settings + + foreground + #0184bc + + + + name + Storage + scope + storage + settings + + foreground + #a626a4 + + + + name + Support + scope + support.function + settings + + foreground + #0184bc + + + + name + Strings, Inherited Class + scope + string + settings + + foreground + #50a14f + + + + name + Integers + scope + constant.numeric + settings + + foreground + #c18401 + + + + name + Floats + scope + none + settings + + foreground + #c18401 + + + + name + Boolean + scope + none + settings + + foreground + #c18401 + + + + name + Constants + scope + constant + settings + + foreground + #c18401 + + + + name + HTML: Tags + scope + entity.name.tag + settings + + foreground + #e45649 + + + + name + HTML: Tag attributes + scope + entity.other.attribute-name + settings + + foreground + #c18401 + + + + name + Attribute IDs + scope + entity.other.attribute-name.id, punctuation.definition.entity + settings + + foreground + #c18401 + + + + name + Selector + scope + meta.selector + settings + + foreground + #a626a4 + + + + name + Markdown: Headings + scope + markup.heading punctuation.definition.heading, entity.name.section + settings + + fontStyle + + foreground + #0184bc + + + + name + Markdown: Bold + scope + markup.bold, punctuation.definition.bold + settings + + foreground + #a626a4 + + + + name + Markdown: Italic + scope + markup.italic, punctuation.definition.italic + settings + + foreground + #a626a4 + + + + name + Markdown: Code + scope + markup.raw.inline + settings + + foreground + #50a14f + + + + name + Markdown: Link Text + scope + string.other.link, punctuation.definition.string.end.markdown + settings + + foreground + + + + + name + Markdown: Link Url + scope + meta.link + settings + + foreground + #50a14f + + + + name + Markdown: Lists + scope + markup.list + settings + + foreground + + + + + name + Markdown: Quotes + scope + markup.quote + settings + + foreground + #50a14f + + + + name + Java Source + scope + source.java meta.class.java meta.method.java + settings + + foreground + #383a42 + + + + name + Java Class Body + scope + source.java meta.class.java meta.class.body.java + settings + + foreground + #383a42 + + + + name + Javascript: Function Arguments + scope + source.js meta.function.js variable.parameter.function.js + settings + + foreground + #e45649 + + + + name + Javascript: New Variables + scope + source.js variable.other.readwrite.js + settings + + foreground + #e45649 + + + + name + Javascript: Variables + scope + source.js variable.other.object.js + settings + + foreground + #383a42 + + + + name + Javascript: Variables in Function Calls + scope + source.js meta.function-call.method.js variable.other.readwrite.js + settings + + foreground + #e45649 + + + + name + Javascript: New Block Variables + scope + source.js meta.block.js variable.other.readwrite.js + settings + + foreground + #e45649 + + + + name + Javascript: Block Variables + scope + source.js meta.block.js variable.other.object.js + settings + + foreground + #383a42 + + + + name + Javascript: Block Variables in Function Calls + scope + source.js meta.block.js meta.function-call.method.js variable.other.readwrite.js + settings + + foreground + #383a42 + + + + name + Javascript: Function Calls + scope + source.js meta.function-call.method.js variable.function.js + settings + + foreground + #383a42 + + + + name + Javascript: Properties + scope + source.js meta.property.object.js entity.name.function.js + settings + + foreground + #0184bc + + + + name + Javascript: Prototypes + scope + source.js support.constant.prototype.js + settings + + foreground + #383a42 + + + + name + Separator + scope + meta.separator + settings + + background + + foreground + + + + + name + Inserted + scope + markup.inserted + settings + + foreground + #98c379 + + + + name + Deleted + scope + markup.deleted + settings + + foreground + #e06c75 + + + + name + Changed + scope + markup.changed + settings + + foreground + #e5c07b + + + + name + Regular Expressions + scope + string.regexp + settings + + foreground + #50a14f + + + + name + Escape Characters + scope + constant.character.escape + settings + + foreground + #0997b3 + + + + name + Embedded + scope + punctuation.section.embedded, variable.interpolation + settings + + foreground + + + + + name + Illegal + scope + invalid.illegal + settings + + background + #e06c75 + foreground + #fafafa + + + + name + Broken + scope + invalid.broken + settings + + background + #e5c07b + foreground + #fafafa + + + + name + Deprecated + scope + invalid.deprecated + settings + + background + #e5c07b + foreground + #fafafa + + + + name + Unimplemented + scope + invalid.unimplemented + settings + + background + #c678dd + foreground + #fafafa + + + + + \ No newline at end of file diff --git a/assets/themes/Monokai.tmTheme b/assets/themes/Sublime Snazzy.tmTheme similarity index 83% rename from assets/themes/Monokai.tmTheme rename to assets/themes/Sublime Snazzy.tmTheme index edf2014..2b62d34 100644 --- a/assets/themes/Monokai.tmTheme +++ b/assets/themes/Sublime Snazzy.tmTheme @@ -1,30 +1,26 @@ - - - - name - Monokai + Sublime Snazzy settings settings background - #272822 + #282A36 caret - #F8F8F0 + #97979B foreground #F8F8F2 invisibles - #3B3A32 + #686868 lineHighlight - #3E3D32 + #000000 selection - #49483E + #57C7FF @@ -35,7 +31,7 @@ settings foreground - #75715E + #686868 @@ -46,7 +42,7 @@ settings foreground - #E6DB74 + #F3F99D @@ -57,7 +53,7 @@ settings foreground - #AE81FF + #F1F1F0 @@ -68,7 +64,7 @@ settings foreground - #AE81FF + #5AF78E @@ -79,7 +75,7 @@ settings foreground - #AE81FF + #5AF78E @@ -101,7 +97,7 @@ settings foreground - #F92672 + #FF5C57 @@ -114,7 +110,7 @@ fontStyle foreground - #F92672 + #FF5C57 @@ -127,7 +123,7 @@ fontStyle italic foreground - #66D9EF + #9AEDFE @@ -140,7 +136,7 @@ fontStyle underline foreground - #A6E22E + #9AEDFE @@ -153,7 +149,7 @@ fontStyle italic underline foreground - #A6E22E + #9AEDFE @@ -166,7 +162,7 @@ fontStyle foreground - #A6E22E + #9AEDFE @@ -179,7 +175,7 @@ fontStyle italic foreground - #FD971F + #FF6AC1 @@ -192,7 +188,7 @@ fontStyle foreground - #F92672 + #5AF78E @@ -205,7 +201,7 @@ fontStyle foreground - #A6E22E + #9AEDFE @@ -218,7 +214,7 @@ fontStyle foreground - #66D9EF + #F3F99D @@ -231,7 +227,7 @@ fontStyle foreground - #66D9EF + #F3F99D @@ -241,10 +237,8 @@ support.type, support.class settings - fontStyle - italic foreground - #66D9EF + #F3F99D @@ -266,11 +260,11 @@ settings background - #F92672 + #FF5C57 fontStyle foreground - #F8F8F0 + #F1F1F0 @@ -281,9 +275,9 @@ settings background - #AE81FF + #FF5C57 foreground - #F8F8F0 + #57C7FF @@ -294,4 +288,4 @@ semanticClass theme.dark.monokai - \ No newline at end of file + diff --git a/assets/themes/TwoDark.tmTheme b/assets/themes/TwoDark.tmTheme new file mode 100644 index 0000000..87fd358 --- /dev/null +++ b/assets/themes/TwoDark.tmTheme @@ -0,0 +1,878 @@ + + + + + author + Roberto Mauro (erremauro@icloud.com) + name + TwoDark + semanticClass + theme.dark.two_dark + colorSpaceName + sRGB + gutterSettings + + background + #393939 + divider + #393939 + foreground + #747369 + selectionBackground + #515151 + selectionForeground + #a09f93 + + settings + + + settings + + background + #282C34 + caret + #528BFF + foreground + #ABB2BF + invisibles + #747369 + lineHighlight + #2B313A + selection + #3D4350 + + + + name + Text + scope + variable.parameter.function + settings + + foreground + #ABB2BF + + + + name + Comments + scope + comment, punctuation.definition.comment + settings + + foreground + #5C6370 + fontStyle + italic + + + + name + Delimiters + scope + none + settings + + foreground + #ABB2BF + + + + name + Operators + scope + keyword.operator + settings + + foreground + #ABB2BF + + + + name + Keywords + scope + keyword + settings + + foreground + #C678DD + + + + name + Variables + scope + variable + settings + + foreground + #E06C75 + + + + name + Functions + scope + entity.name.function, meta.require, support.function.any-method + settings + + foreground + #61AFEF + + + + name + Classes + scope + support.class, entity.name.class, entity.name.type.class + settings + + foreground + #E5C07B + + + + name + Classes + scope + meta.class + settings + + foreground + #ABB2BF + + + + name + Methods + scope + keyword.other.special-method + settings + + foreground + #61AFEF + + + + name + Storage + scope + storage + settings + + foreground + #C678DD + + + + name + Support + scope + support.function + settings + + foreground + #56B6C2 + + + + name + Strings, Inherited Class + scope + string, constant.other.symbol, entity.other.inherited-class + settings + + foreground + #98C379 + + + + name + Integers + scope + constant.numeric + settings + + foreground + #D19A66 + + + + name + Floats + scope + none + settings + + foreground + #D19A66 + + + + name + Boolean + scope + none + settings + + foreground + #D19A66 + + + + name + Constants + scope + constant + settings + + foreground + #D19A66 + + + + name + Tags + scope + entity.name.tag + settings + + foreground + #E06C75 + + + + name + Attributes + scope + entity.other.attribute-name + settings + + foreground + #D19A66 + + + + name + Attribute IDs + scope + entity.other.attribute-name.id, punctuation.definition.entity + settings + + foreground + #D19A66 + + + + name + Selector + scope + meta.selector + settings + + foreground + #C678DD + + + + name + Values + scope + none + settings + + foreground + #D19A66 + + + + name + Headings + scope + markup.heading punctuation.definition.heading, entity.name.section + settings + + fontStyle + + foreground + #61AFEF + + + + name + Units + scope + keyword.other.unit + settings + + foreground + #D19A66 + + + + name + Bold + scope + markup.bold, punctuation.definition.bold + settings + + foreground + #E5C07B + + + + name + Italic + scope + markup.italic, punctuation.definition.italic + settings + + foreground + #C678DD + + + + name + Code + scope + markup.raw.inline + settings + + foreground + #98C379 + + + + name + Link Text + scope + string.other.link, punctuation.definition.string.end.markdown + settings + + foreground + #E06C75 + + + + name + Link Url + scope + meta.link + settings + + foreground + #D19A66 + + + + name + Lists + scope + markup.list + settings + + foreground + #E06C75 + + + + name + Quotes + scope + markup.quote + settings + + foreground + #D19A66 + + + + name + Separator + scope + meta.separator + settings + + background + #515151 + foreground + #ABB2BF + + + + name + Inserted + scope + markup.inserted + settings + + foreground + #98C379 + + + + name + Deleted + scope + markup.deleted + settings + + foreground + #E06C75 + + + + name + Changed + scope + markup.changed + settings + + foreground + #C678DD + + + + name + Colors + scope + constant.other.color + settings + + foreground + #56B6C2 + + + + name + Regular Expressions + scope + string.regexp + settings + + foreground + #56B6C2 + + + + name + Escape Characters + scope + constant.character.escape + settings + + foreground + #56B6C2 + + + + name + Embedded + scope + punctuation.section.embedded, variable.interpolation + settings + + foreground + #BE5046 + + + + name + Illegal + scope + invalid.illegal + settings + + background + #f2777a + foreground + #272B33 + + + + name + Broken + scope + invalid.broken + settings + + background + #f99157 + foreground + #2d2d2d + + + + name + Deprecated + scope + invalid.deprecated + settings + + background + #d27b53 + foreground + #272B33 + + + + name + Unimplemented + scope + invalid.unimplemented + settings + + background + #747369 + foreground + #272B33 + + + + name + Json key + scope + source.json meta.structure.dictionary.json string.quoted.double.json + settings + + foreground + #E06C75 + + + + name + Json value + scope + source.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json + settings + + foreground + #98C379 + + + + name + json sub key + scope + source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json string.quoted.double.json + settings + + foreground + #E06C75 + + + + name + Json sub value + scope + source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json + settings + + foreground + #98C379 + + + + name + laravel blade tag + scope + text.html.laravel-blade source.php.embedded.line.html entity.name.tag.laravel-blade + settings + + foreground + #C678DD + + + + name + laravel blade @ + scope + text.html.laravel-blade source.php.embedded.line.html support.constant.laravel-blade + settings + + foreground + #C678DD + + + + name + python function parameter + scope + source.python meta.function.python meta.function.parameters.python variable.parameter.function.python + settings + + foreground + #D19A66 + + + + name + python meta function + scope + source.python meta.function-call.python support.type.python + settings + + foreground + #56B6C2 + + + + name + python logical keyword + scope + source.python keyword.operator.logical.python + settings + + foreground + #C678DD + + + + name + python class ( begin + scope + source.python meta.class.python punctuation.definition.inheritance.begin.python + settings + + foreground + #E5C07B + + + + name + python class ) end + scope + source.python meta.class.python punctuation.definition.inheritance.end.python + settings + + foreground + #E5C07B + + + + name + python function call parameter name + scope + source.python meta.function-call.python meta.function-call.arguments.python variable.parameter.function.python + settings + + foreground + #D19A66 + + + + name + php fcuntion constants + scope + text.html.basic source.php.embedded.block.html support.constant.std.php + settings + + foreground + #D19A66 + + + + name + php namespace name + scope + text.html.basic source.php.embedded.block.html meta.namespace.php entity.name.type.namespace.php + settings + + foreground + #E5C07B + + + + name + javascript meta constant + scope + source.js meta.function.js support.constant.js + settings + + foreground + #D19A66 + + + + name + php namespace in top + scope + text.html.basic` source.php.embedded.block.html constant.other.php + settings + + foreground + #C678DD + + + + name + php namespace name in top + scope + text.html.basic source.php.embedded.block.html support.other.namespace.php + settings + + foreground + #D19A66 + + + + name + latex label names + scope + text.tex.latex meta.function.environment.math.latex string.other.math.block.environment.latex meta.definition.label.latex variable.parameter.definition.label.latex + settings + + foreground + #ABB2BF + + + + name + latex italic emph + scope + text.tex.latex meta.function.emph.latex markup.italic.emph.latex + settings + + fontStyle + italic + foreground + #C678DD + + + + name + subl_new js vars + scope + source.js variable.other.readwrite.js + settings + + foreground + ABB2BF + + + + name + new_subl js $ + scope + source.js meta.function-call.with-arguments.js variable.function.js + settings + + foreground + #ABB2BF + + + + name + new_subl js call method + scope + source.js meta.group.braces.round meta.group.braces.curly meta.function-call.method.without-arguments.js variable.function.js + settings + + foreground + #ABB2BF + + + + name + new_subl e js + scope + source.js meta.group.braces.round meta.group.braces.curly variable.other.object.js + settings + + foreground + #ABB2BF + + + + name + new_subl js key + scope + source.js meta.group.braces.round meta.group.braces.curly constant.other.object.key.js string.unquoted.label.js + settings + + foreground + #ABB2BF + + + + name + new_subl obejct key + scope + source.js meta.group.braces.round meta.group.braces.curly constant.other.object.key.js punctuation.separator.key-value.js + settings + + foreground + #ABB2BF + + + + name + new_subl js method with args + scope + source.js meta.group.braces.round meta.group.braces.curly meta.function-call.method.with-arguments.js variable.function.js + settings + + foreground + #ABB2BF + + + + name + new_subl js variable function + scope + source.js meta.function-call.method.with-arguments.js variable.function.js + settings + + foreground + #ABB2BF + + + + name + new_subl variabel function method + scope + source.js meta.function-call.method.without-arguments.js variable.function.js + settings + + foreground + #ABB2BF + + + + name + SublimeLinter Error + scope + sublimelinter.mark.error + settings + + foreground + #D02000 + + + name + SublimeLinter Gutter Mark + scope + sublimelinter.gutter-mark + settings + + foreground + #FFFFFF + + + name + SublimeLinter Warning + scope + sublimelinter.mark.warning + settings + + foreground + #DDB700 + + + uuid + 32bd64fa-d60a-4858-a5fc-5164cc49a2b8 + comment + Work in progress + + \ No newline at end of file diff --git a/assets/themes/ansi-dark.tmTheme b/assets/themes/ansi-dark.tmTheme new file mode 100644 index 0000000..a797695 --- /dev/null +++ b/assets/themes/ansi-dark.tmTheme @@ -0,0 +1,504 @@ + + + + + + author + Template: Chris Kempson, Scheme: Mitchell Kember + name + ANSI Dark + colorSpaceName + sRGB + settings + + + settings + + background + #00000000 + caret + #07000000 + foreground + #07000000 + invisibles + #07000000 + lineHighlight + #07000000 + selection + #07000000 + gutter + #00000000 + gutterForeground + #07000000 + + + + name + Text + scope + variable.parameter.function + settings + + foreground + #07000000 + + + + name + Comments + scope + comment, punctuation.definition.comment + settings + + foreground + #02000000 + + + + name + Punctuation + scope + punctuation.definition.string, punctuation.definition.variable, punctuation.definition.string, punctuation.definition.parameters, punctuation.definition.string, punctuation.definition.array + settings + + foreground + #07000000 + + + + name + Delimiters + scope + none + settings + + foreground + #07000000 + + + + name + Operators + scope + keyword.operator + settings + + foreground + #07000000 + + + + name + Keywords + scope + keyword + settings + + foreground + #05000000 + + + + name + Variables + scope + variable + settings + + foreground + #07000000 + + + + name + Functions + scope + entity.name.function, meta.require, support.function.any-method + settings + + foreground + #04000000 + + + + name + Labels + scope + entity.name.label + settings + + foreground + #06000000 + + + + name + Classes + scope + support.class, entity.name.class, entity.name.type.class + settings + + foreground + #03000000 + + + + name + Classes + scope + meta.class + settings + + foreground + #07000000 + + + + name + Methods + scope + keyword.other.special-method + settings + + foreground + #04000000 + + + + name + Storage + scope + storage + settings + + foreground + #05000000 + + + + name + Support + scope + support.function + settings + + foreground + #06000000 + + + + name + Strings, Inherited Class + scope + string, constant.other.symbol, entity.other.inherited-class + settings + + foreground + #02000000 + + + + name + Integers + scope + constant.numeric + settings + + foreground + #03000000 + + + + name + Floats + scope + none + settings + + foreground + #03000000 + + + + name + Boolean + scope + none + settings + + foreground + #03000000 + + + + name + Constants + scope + constant + settings + + foreground + #03000000 + + + + name + Tags + scope + entity.name.tag + settings + + foreground + #01000000 + + + + name + Attributes + scope + entity.other.attribute-name + settings + + foreground + #03000000 + + + + name + Attribute IDs + scope + entity.other.attribute-name.id, punctuation.definition.entity + settings + + foreground + #04000000 + + + + name + Selector + scope + meta.selector + settings + + foreground + #05000000 + + + + name + Values + scope + none + settings + + foreground + #03000000 + + + + name + Headings + scope + markup.heading punctuation.definition.heading, entity.name.section + settings + + fontStyle + + foreground + #04000000 + + + + name + Units + scope + keyword.other.unit + settings + + foreground + #03000000 + + + + name + Bold + scope + markup.bold, punctuation.definition.bold + settings + + fontStyle + bold + foreground + #03000000 + + + + name + Italic + scope + markup.italic, punctuation.definition.italic + settings + + fontStyle + italic + foreground + #05000000 + + + + name + Code + scope + markup.raw.inline + settings + + foreground + #02000000 + + + + name + Link Text + scope + string.other.link, punctuation.definition.string.end.markdown, punctuation.definition.string.begin.markdown + settings + + foreground + #01000000 + + + + name + Link Url + scope + meta.link + settings + + foreground + #03000000 + + + + name + Quotes + scope + markup.quote + settings + + foreground + #03000000 + + + + name + Inserted + scope + markup.inserted + settings + + foreground + #02000000 + + + + name + Deleted + scope + markup.deleted + settings + + foreground + #01000000 + + + + name + Changed + scope + markup.changed + settings + + foreground + #05000000 + + + + name + Colors + scope + constant.other.color + settings + + foreground + #06000000 + + + + name + Regular Expressions + scope + string.regexp + settings + + foreground + #06000000 + + + + name + Escape Characters + scope + constant.character.escape + settings + + foreground + #06000000 + + + + name + Embedded + scope + punctuation.section.embedded, variable.interpolation + settings + + foreground + #05000000 + + + + name + Illegal + scope + invalid.illegal + settings + + background + #01000000 + foreground + #07000000 + + + + name + Broken + scope + invalid.broken + settings + + background + #03000000 + foreground + #00000000 + + + + uuid + uuid + + diff --git a/assets/themes/ansi-light.tmTheme b/assets/themes/ansi-light.tmTheme new file mode 100644 index 0000000..5dfb94e --- /dev/null +++ b/assets/themes/ansi-light.tmTheme @@ -0,0 +1,504 @@ + + + + + + author + Template: Chris Kempson, Scheme: Mitchell Kember + name + ANSI Light + colorSpaceName + sRGB + settings + + + settings + + background + #07000000 + caret + #00000000 + foreground + #00000000 + invisibles + #00000000 + lineHighlight + #00000000 + selection + #00000000 + gutter + #07000000 + gutterForeground + #00000000 + + + + name + Text + scope + variable.parameter.function + settings + + foreground + #00000000 + + + + name + Comments + scope + comment, punctuation.definition.comment + settings + + foreground + #02000000 + + + + name + Punctuation + scope + punctuation.definition.string, punctuation.definition.variable, punctuation.definition.string, punctuation.definition.parameters, punctuation.definition.string, punctuation.definition.array + settings + + foreground + #00000000 + + + + name + Delimiters + scope + none + settings + + foreground + #00000000 + + + + name + Operators + scope + keyword.operator + settings + + foreground + #00000000 + + + + name + Keywords + scope + keyword + settings + + foreground + #05000000 + + + + name + Variables + scope + variable + settings + + foreground + #00000000 + + + + name + Functions + scope + entity.name.function, meta.require, support.function.any-method + settings + + foreground + #04000000 + + + + name + Labels + scope + entity.name.label + settings + + foreground + #06000000 + + + + name + Classes + scope + support.class, entity.name.class, entity.name.type.class + settings + + foreground + #03000000 + + + + name + Classes + scope + meta.class + settings + + foreground + #00000000 + + + + name + Methods + scope + keyword.other.special-method + settings + + foreground + #04000000 + + + + name + Storage + scope + storage + settings + + foreground + #05000000 + + + + name + Support + scope + support.function + settings + + foreground + #06000000 + + + + name + Strings, Inherited Class + scope + string, constant.other.symbol, entity.other.inherited-class + settings + + foreground + #02000000 + + + + name + Integers + scope + constant.numeric + settings + + foreground + #03000000 + + + + name + Floats + scope + none + settings + + foreground + #03000000 + + + + name + Boolean + scope + none + settings + + foreground + #03000000 + + + + name + Constants + scope + constant + settings + + foreground + #03000000 + + + + name + Tags + scope + entity.name.tag + settings + + foreground + #01000000 + + + + name + Attributes + scope + entity.other.attribute-name + settings + + foreground + #03000000 + + + + name + Attribute IDs + scope + entity.other.attribute-name.id, punctuation.definition.entity + settings + + foreground + #04000000 + + + + name + Selector + scope + meta.selector + settings + + foreground + #05000000 + + + + name + Values + scope + none + settings + + foreground + #03000000 + + + + name + Headings + scope + markup.heading punctuation.definition.heading, entity.name.section + settings + + fontStyle + + foreground + #04000000 + + + + name + Units + scope + keyword.other.unit + settings + + foreground + #03000000 + + + + name + Bold + scope + markup.bold, punctuation.definition.bold + settings + + fontStyle + bold + foreground + #03000000 + + + + name + Italic + scope + markup.italic, punctuation.definition.italic + settings + + fontStyle + italic + foreground + #05000000 + + + + name + Code + scope + markup.raw.inline + settings + + foreground + #02000000 + + + + name + Link Text + scope + string.other.link, punctuation.definition.string.end.markdown, punctuation.definition.string.begin.markdown + settings + + foreground + #01000000 + + + + name + Link Url + scope + meta.link + settings + + foreground + #03000000 + + + + name + Quotes + scope + markup.quote + settings + + foreground + #03000000 + + + + name + Inserted + scope + markup.inserted + settings + + foreground + #02000000 + + + + name + Deleted + scope + markup.deleted + settings + + foreground + #01000000 + + + + name + Changed + scope + markup.changed + settings + + foreground + #05000000 + + + + name + Colors + scope + constant.other.color + settings + + foreground + #06000000 + + + + name + Regular Expressions + scope + string.regexp + settings + + foreground + #06000000 + + + + name + Escape Characters + scope + constant.character.escape + settings + + foreground + #06000000 + + + + name + Embedded + scope + punctuation.section.embedded, variable.interpolation + settings + + foreground + #05000000 + + + + name + Illegal + scope + invalid.illegal + settings + + background + #01000000 + foreground + #00000000 + + + + name + Broken + scope + invalid.broken + settings + + background + #03000000 + foreground + #07000000 + + + + uuid + uuid + + diff --git a/assets/themes/base16.tmTheme b/assets/themes/base16.tmTheme new file mode 100644 index 0000000..eff2eba --- /dev/null +++ b/assets/themes/base16.tmTheme @@ -0,0 +1,543 @@ + + + + + + author + Template: Chris Kempson, Scheme: Mitchell Kember + name + Base16 + colorSpaceName + sRGB + settings + + + settings + + background + #00000000 + caret + #07000000 + foreground + #07000000 + invisibles + #08000000 + lineHighlight + #08000000 + selection + #0b000000 + gutter + #0a000000 + gutterForeground + #08000000 + + + + name + Text + scope + variable.parameter.function + settings + + foreground + #07000000 + + + + name + Comments + scope + comment, punctuation.definition.comment + settings + + foreground + #08000000 + + + + name + Punctuation + scope + punctuation.definition.string, punctuation.definition.variable, punctuation.definition.string, punctuation.definition.parameters, punctuation.definition.string, punctuation.definition.array + settings + + foreground + #07000000 + + + + name + Delimiters + scope + none + settings + + foreground + #07000000 + + + + name + Operators + scope + keyword.operator + settings + + foreground + #07000000 + + + + name + Keywords + scope + keyword + settings + + foreground + #05000000 + + + + name + Variables + scope + variable + settings + + foreground + #07000000 + + + + name + Functions + scope + entity.name.function, meta.require, support.function.any-method + settings + + foreground + #04000000 + + + + name + Labels + scope + entity.name.label + settings + + foreground + #0e000000 + + + + name + Classes + scope + support.class, entity.name.class, entity.name.type.class + settings + + foreground + #03000000 + + + + name + Classes + scope + meta.class + settings + + foreground + #0f000000 + + + + name + Methods + scope + keyword.other.special-method + settings + + foreground + #04000000 + + + + name + Storage + scope + storage + settings + + foreground + #05000000 + + + + name + Support + scope + support.function + settings + + foreground + #06000000 + + + + name + Strings, Inherited Class + scope + string, constant.other.symbol, entity.other.inherited-class + settings + + foreground + #02000000 + + + + name + Integers + scope + constant.numeric + settings + + foreground + #09000000 + + + + name + Floats + scope + none + settings + + foreground + #09000000 + + + + name + Boolean + scope + none + settings + + foreground + #09000000 + + + + name + Constants + scope + constant + settings + + foreground + #09000000 + + + + name + Tags + scope + entity.name.tag + settings + + foreground + #01000000 + + + + name + Attributes + scope + entity.other.attribute-name + settings + + foreground + #09000000 + + + + name + Attribute IDs + scope + entity.other.attribute-name.id, punctuation.definition.entity + settings + + foreground + #04000000 + + + + name + Selector + scope + meta.selector + settings + + foreground + #05000000 + + + + name + Values + scope + none + settings + + foreground + #09000000 + + + + name + Headings + scope + markup.heading punctuation.definition.heading, entity.name.section + settings + + fontStyle + + foreground + #04000000 + + + + name + Units + scope + keyword.other.unit + settings + + foreground + #09000000 + + + + name + Bold + scope + markup.bold, punctuation.definition.bold + settings + + fontStyle + bold + foreground + #03000000 + + + + name + Italic + scope + markup.italic, punctuation.definition.italic + settings + + fontStyle + italic + foreground + #05000000 + + + + name + Code + scope + markup.raw.inline + settings + + foreground + #02000000 + + + + name + Link Text + scope + string.other.link, punctuation.definition.string.end.markdown, punctuation.definition.string.begin.markdown + settings + + foreground + #01000000 + + + + name + Link Url + scope + meta.link + settings + + foreground + #09000000 + + + + name + Quotes + scope + markup.quote + settings + + foreground + #09000000 + + + + name + Separator + scope + meta.separator + settings + + background + #0b000000 + foreground + #07000000 + + + + name + Inserted + scope + markup.inserted + settings + + foreground + #02000000 + + + + name + Deleted + scope + markup.deleted + settings + + foreground + #01000000 + + + + name + Changed + scope + markup.changed + settings + + foreground + #05000000 + + + + name + Colors + scope + constant.other.color + settings + + foreground + #06000000 + + + + name + Regular Expressions + scope + string.regexp + settings + + foreground + #06000000 + + + + name + Escape Characters + scope + constant.character.escape + settings + + foreground + #06000000 + + + + name + Embedded + scope + punctuation.section.embedded, variable.interpolation + settings + + foreground + #05000000 + + + + name + Illegal + scope + invalid.illegal + settings + + background + #01000000 + foreground + #0f000000 + + + + name + Broken + scope + invalid.broken + settings + + background + #09000000 + foreground + #00000000 + + + + name + Deprecated + scope + invalid.deprecated + settings + + background + #0e000000 + foreground + #0f000000 + + + + name + Unimplemented + scope + invalid.unimplemented + settings + + background + #08000000 + foreground + #0f000000 + + + + uuid + uuid + + diff --git a/assets/themes/zenburn.tmTheme b/assets/themes/zenburn.tmTheme new file mode 100644 index 0000000..8fc06f5 --- /dev/null +++ b/assets/themes/zenburn.tmTheme @@ -0,0 +1,744 @@ + + + + + author + Jani Nurminen. Adapted and modified by Colin T.A. Gray and William D. Neumann + name + zenburn + settings + + + settings + + background + #393939 + caret + #D6D6D6 + foreground + #DEDEDE + invisibles + #A5A5A552 + lineHighlight + #303030 + selection + #8383839C + + + + name + Comment + scope + comment + settings + + foreground + #87AE86 + + + + name + preprocessor + scope + meta.preprocessor, punctuation.definition.preprocessor + settings + + foreground + #E8BC92 + + + + name + phpdoc + scope + keyword.other.phpdoc + settings + + foreground + #568E4D + + + + name + comment punctuation (/*, #, //) + scope + punctuation.definition.comment, punctuation.whitespace.comment + settings + + foreground + #A0CFA1 + + + + name + embedded ruby in string delimiters + scope + punctuation.section.embedded + settings + + foreground + #898989 + + + + name + embedded ruby in string + scope + source.ruby.embedded + settings + + foreground + #CC9495 + + + + name + Directive + scope + keyword.other.directive + settings + + fontStyle + bold + foreground + #DEDEDE + + + + name + Line-number directives + scope + keyword.other.directive.line-number + settings + + fontStyle + underline + + + + name + Characters + scope + constant.character + settings + + foreground + #FF8080 + + + + name + String + scope + string, string.unquoted + settings + + foreground + #D68686 + + + + name + Heredoc + scope + string.unquoted.heredoc + settings + + foreground + #D6D6D6 + + + + name + Number + scope + support.constant.numeric, constant.numeric + settings + + foreground + #87D6D5 + + + + name + Built-in constant + scope + constant, support.constant + settings + + fontStyle + bold + foreground + #D6D6AE + + + + name + User-defined constant + scope + constant.character, constant.other + settings + + foreground + #CC9495 + + + + name + Other constant + scope + variable.other.constant + settings + + foreground + #D6D6AE + + + + name + Language Keyword + scope + keyword, keyword.control , meta.selector.css , entity.other.attribute-name + settings + + foreground + #FED6AF + + + + name + Instance Variable + scope + variable.other.readwrite.instance + settings + + foreground + #FED6AF + + + + name + Module Keyword + scope + entity.name.module,support.other.module + settings + + fontStyle + bold + foreground + #FF8000 + + + + name + Operators + scope + keyword.operator + settings + + foreground + #ECECEC + + + + name + Floating-point infix operators + scope + source.ocaml keyword.operator.symbol.infix.floating-point + settings + + fontStyle + underline + + + + name + Floating-point prefix operators + scope + source.ocaml keyword.operator.symbol.prefix.floating-point + settings + + fontStyle + underline + + + + name + Storage Types + scope + storage.type , storage.modifier , support.type + settings + + foreground + #FFFB9D + + + + name + Variant Types + scope + entity.name.class.variant + settings + + foreground + #4080A0 + + + + name + Storage + scope + storage + settings + + + + name + Type name + scope + entity.name.type , entity.other + settings + + foreground + #D6D6D6 + + + + name + Inherited class + scope + entity.other.inherited-class + settings + + foreground + #D78D1B + + + + name + Type name + scope + storage.type.user-defined , meta.property-list + settings + + foreground + #FFE000 + + + + name + Class type name + scope + entity.name.type , entity.name.type.class , entity.other.attribute-name.class.css , support.class + settings + + foreground + #F4A020 + + + + name + Function argument + scope + variable.parameter + settings + + + + + name + Invalid + scope + invalid + settings + + fontStyle + bold italic underline + foreground + #FFCCEE + + + + name + html attribute + scope + entity.other.attribute-name.html + settings + + fontStyle + bold + foreground + #D6D7AF + + + + name + html entity + scope + entity.name.tag + settings + + foreground + #D6D7AF + + + + name + <?php + scope + punctuation.section.embedded.begin.php,punctuation.section.embedded.end.php + settings + + foreground + #898989 + + + + name + php function + scope + support.function.construct + settings + + foreground + #FED6AF + + + + name + $variable prefix + scope + punctuation.definition.variable + settings + + foreground + #FED6AF + + + + name + function/method + scope + support.function,meta.function-name,entity.name.function + settings + + foreground + #FFFD87 + + + + name + built-in function + scope + support.function + settings + + foreground + #C7BA18 + + + + name + braces + scope + meta.brace + settings + + foreground + #78CECC80 + + + + name + string begin + scope + punctuation.definition.string.begin,punctuation.definition.string.end + settings + + foreground + #D6D6D680 + + + + name + html tag begin/end + scope + punctuation.definition.tag.begin.html,punctuation.definition.tag.end.html,meta.tag.structure.any.html + settings + + fontStyle + bold + foreground + #FED5AE94 + + + + name + yaml entity + scope + entity.name.tag.yaml + settings + + fontStyle + bold + foreground + #FED6AF + + + + name + unquoted yaml string + scope + punctuation.definition.entry + settings + + foreground + #D6D6D6 + + + + name + SQL + scope + keyword.other.DML.sql, keyword.other.data-integrity.sql + settings + + fontStyle + bold + foreground + #B7B7B7 + + + + name + other SQL + scope + source.sql, constant.other.database-name.sql, constant.other.table-name.sql, keyword.operator.star + settings + + fontStyle + bold + foreground + #95BFF3 + + + + name + diff + scope + source.diff + settings + + background + #393939 + foreground + #FFFFFF + + + + name + diff.toc + scope + source.diff meta.diff.comment, source.diff meta.toc-list.comment.diff + settings + + background + #9F9D15 + foreground + #FFFFFF + + + + name + diff from-file + scope + meta.diff.header.from-file + settings + + background + #393939 + fontStyle + bold + foreground + #CA7172 + + + + name + diff to-file + scope + meta.diff.header.to-file + settings + + background + #393939 + fontStyle + bold + foreground + #60B38A + + + + name + diff range + scope + meta.diff.range.unified + settings + + background + #393939 + foreground + #8CD0D3 + + + + name + diff inserted + scope + markup.inserted.diff + settings + + background + #393939 + foreground + #60B38A + + + + name + diff deleted + scope + markup.deleted.diff + settings + + background + #393939 + foreground + #CA7172 + + + + name + regex + scope + string.regexp + settings + + foreground + #C76F41 + + + + name + regex - repitition + scope + string.regexp.arbitrary-repitition + settings + + foreground + #9E6A5F + + + + name + regex - repitition {} + scope + punctuation.definition.arbitrary-repitition + settings + + foreground + #FFFFFF5E + + + + name + regex - character class + scope + string.regexp.character-class + settings + + foreground + #CB8E81 + + + + name + regex - character class [] + scope + punctuation.definition.character-class + settings + + foreground + #FFFFFF5E + + + + name + markdown inline code + scope + markup.raw.inline.markdown + settings + + foreground + #FED6AF + + + + name + markdown heading + scope + markup.heading.markdown,punctuation.definition.heading + settings + + fontStyle + bold + foreground + #FFFFFF + + + + name + markdown list + scope + markup.list + settings + + foreground + #DEDEDE + + + + name + SublimeLinter Warning + scope + sublimelinter.mark.warning + settings + + foreground + #DDB700 + + + name + SublimeLinter Gutter Mark + scope + sublimelinter.gutter-mark + settings + + foreground + #FFFFFF + + + name + SublimeLinter Error + scope + sublimelinter.mark.error + settings + + foreground + #D02000 + + + uuid + A34A7407-68B9-48E5-883E-E551F7561026 + + \ No newline at end of file diff --git a/src/config.rs b/src/config.rs index 94244b2..2a1d0ff 100644 --- a/src/config.rs +++ b/src/config.rs @@ -19,54 +19,52 @@ fn parse_str_color(s: &str) -> Result, Error> { #[structopt(name = "silicon", rename_all = "kebab")] pub struct Config { /// The syntax highlight theme. It can be a theme name or path to a .tmTheme file. - #[structopt(long, default_value = "base16-eighties.dark")] - theme: String, + #[structopt(long, default_value = "Monokai Extended")] + pub theme: String, /// The base font. #[structopt(long)] - font: Option, + pub font: Option, /// Size of the base font. #[structopt(long, value_name = "size", default_value = "27.0")] - font_size: f32, + pub font_size: f32, /// The CJK font. #[structopt(long, value_name = "font")] - cjk_font: Option, + pub cjk_font: Option, /// Size of the CJK font. #[structopt(long, value_name = "size", default_value = "27.0")] - cjk_size: f32, + pub cjk_size: f32, /// Pad between lines #[structopt(long, default_value = "2")] - line_pad: u32, + pub line_pad: u32, /// List all themes. #[structopt(long)] pub list_themes: bool, - // Build theme cache. - // #[structopt(long)] - // build_cache: bool, /// Read input from clipboard. #[structopt(long)] - from_clipboard: bool, + pub from_clipboard: bool, // Copy the output image to clipboard. - // #[structopt(short = "c", long)] - // to_clipboard: bool, + #[structopt(short = "c", long)] + pub to_clipboard: bool, + /// Write output image to specific location instead of cwd. #[structopt(short = "o", long, value_name = "path")] pub output: Option, /// Hide the window controls. #[structopt(long)] - no_window_controls: bool, + pub no_window_controls: bool, /// Hide the line number. #[structopt(long)] - no_line_number: bool, + pub no_line_number: bool, /// Background color of the image #[structopt( @@ -75,7 +73,7 @@ pub struct Config { default_value = "#abb8c3", parse(try_from_str = "parse_str_color") )] - background: Rgba, + pub background: Rgba, /// Color of shadow #[structopt( @@ -84,38 +82,39 @@ pub struct Config { default_value = "#555555", parse(try_from_str = "parse_str_color") )] - shadow_color: Rgba, + pub shadow_color: Rgba, /// Blur radius of the shadow #[structopt(long, value_name = "radius", default_value = "10.0")] - shadow_blur_radius: f32, + pub shadow_blur_radius: f32, /// Pad horiz #[structopt(long, default_value = "80")] - pad_horiz: u32, + pub pad_horiz: u32, /// Pad vert #[structopt(long, default_value = "100")] - pad_vert: u32, + pub pad_vert: u32, /// Shadow's offset in Y axis #[structopt(long, value_name = "offset", default_value = "0")] - shadow_offset_y: i32, + pub shadow_offset_y: i32, /// Shadow's offset in X axis #[structopt(long, value_name = "offset", default_value = "0")] - shadow_offset_x: i32, + pub shadow_offset_x: i32, /// The language for syntax highlighting. You can use full name ("Rust") or file extension ("rs"). #[structopt(short = "l", long)] - language: Option, + pub language: Option, // Draw a custom text on the bottom right corner // #[structopt(long)] // watermark: Option, + /// File to read. If not set, stdin will be use. #[structopt(value_name = "FILE", parse(from_os_str))] - file: Option, + pub file: Option, } impl Config { diff --git a/src/main.rs b/src/main.rs index bf71ee8..804e57b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,7 @@ extern crate failure; use crate::config::Config; -use crate::utils::{add_window_controls, round_corner}; +use crate::utils::{add_window_controls, round_corner, dump_image_to_clipboard}; use failure::Error; use std::io::stdout; use structopt::StructOpt; @@ -53,13 +53,17 @@ fn run() -> Result<(), Error> { let image = config.get_shadow_adder().apply_to(&image); - if let Some(path) = &config.output { - image - .save(path) - .map_err(|e| format_err!("Failed to save image to {}: {}", path.display(), e))?; + if config.to_clipboard { + dump_image_to_clipboard(&image)?; } else { - let mut stdout = stdout(); - image.write_to(&mut stdout, ImageFormat::PNG)?; + if let Some(path) = &config.output { + image + .save(path) + .map_err(|e| format_err!("Failed to save image to {}: {}", path.display(), e))?; + } else { + let mut stdout = stdout(); + image.write_to(&mut stdout, ImageFormat::PNG)?; + } } Ok(()) diff --git a/src/utils.rs b/src/utils.rs index df7d2ca..0df6326 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,8 +1,10 @@ use image::imageops::{blur, crop}; -use image::Pixel; +use image::{Pixel, ImageOutputFormat}; use image::{DynamicImage, GenericImage, GenericImageView, Rgba, RgbaImage}; use imageproc::drawing::{draw_filled_rect_mut, draw_line_segment_mut}; use imageproc::rect::Rect; +use failure::Error; +use std::process::Command; pub trait ToRgba { type Target; @@ -244,3 +246,19 @@ where } } } + +#[cfg(target_os = "linux")] +pub fn dump_image_to_clipboard(image: &DynamicImage) -> Result<(), Error> { + let mut temp = tempfile::NamedTempFile::new()?; + image.write_to(&mut temp, ImageOutputFormat::PNG)?; + Command::new("xclip") + .args(&["-sel", "clip", "-t", "image/png", temp.path().to_str().unwrap()]) + .status() + .map_err(|e| format_err!("Failed to copy image to clipboard: {}", e))?; + Ok(()) +} + +#[cfg(not(target_os = "linux"))] +pub fn dump_image_to_clipboard(image: &DynamicImage) -> Result<(), Error> { + format_err!("This feature hasn't been implemented in your system") +} \ No newline at end of file