add new sublime packages
This commit is contained in:
parent
d0a2c7caca
commit
39206e18ca
140 changed files with 15353 additions and 0 deletions
4
sublime/Packages/AAAPackageDev/.gitignore
vendored
Normal file
4
sublime/Packages/AAAPackageDev/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
*.pyc
|
||||||
|
*.cache
|
||||||
|
*.sublime-project
|
||||||
|
*.sublime-workspace
|
||||||
16
sublime/Packages/AAAPackageDev/.hgignore
Normal file
16
sublime/Packages/AAAPackageDev/.hgignore
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
syntax: glob
|
||||||
|
|
||||||
|
*.pyc
|
||||||
|
_*.txt
|
||||||
|
*.cache
|
||||||
|
*.sublime-project
|
||||||
|
*.sublime-workspace
|
||||||
|
sample-grammar.js
|
||||||
|
Manifest
|
||||||
|
MANIFEST
|
||||||
|
|
||||||
|
dist/
|
||||||
|
build/
|
||||||
|
data/
|
||||||
|
Doc/
|
||||||
|
_ref/
|
||||||
9
sublime/Packages/AAAPackageDev/AAA.py
Normal file
9
sublime/Packages/AAAPackageDev/AAA.py
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
import sublime
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
# Makes sublime_lib package available for all packages.
|
||||||
|
if not os.path.join(sublime.packages_path(), "AAAPackageDev/Lib") in sys.path:
|
||||||
|
sys.path.append(os.path.join(sublime.packages_path(), "AAAPackageDev/Lib"))
|
||||||
|
print "[AAAPackageDev] Added sublime_lib to sys.path."
|
||||||
1
sublime/Packages/AAAPackageDev/LICENSE.txt
Normal file
1
sublime/Packages/AAAPackageDev/LICENSE.txt
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
The license under which this package is released.
|
||||||
63
sublime/Packages/AAAPackageDev/Lib/sublime_lib/constants.py
Normal file
63
sublime/Packages/AAAPackageDev/Lib/sublime_lib/constants.py
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
KEY_UP = "up"
|
||||||
|
KEY_DOWN = "down"
|
||||||
|
KEY_RIGHT = "right"
|
||||||
|
KEY_LEFT = "left"
|
||||||
|
KEY_INSERT = "insert"
|
||||||
|
KEY_HOME = "home"
|
||||||
|
KEY_END = "end"
|
||||||
|
KEY_PAGEUP = "pageup"
|
||||||
|
KEY_PAGEDOWN = "pagedown"
|
||||||
|
KEY_BACKSPACE = "backspace"
|
||||||
|
KEY_DELETE = "delete"
|
||||||
|
KEY_TAB = "tab"
|
||||||
|
KEY_ENTER = "enter"
|
||||||
|
KEY_PAUSE = "pause"
|
||||||
|
KEY_ESCAPE = "escape"
|
||||||
|
KEY_SPACE = "space"
|
||||||
|
KEY_KEYPAD0 = "keypad0"
|
||||||
|
KEY_KEYPAD1 = "keypad1"
|
||||||
|
KEY_KEYPAD2 = "keypad2"
|
||||||
|
KEY_KEYPAD3 = "keypad3"
|
||||||
|
KEY_KEYPAD4 = "keypad4"
|
||||||
|
KEY_KEYPAD5 = "keypad5"
|
||||||
|
KEY_KEYPAD6 = "keypad6"
|
||||||
|
KEY_KEYPAD7 = "keypad7"
|
||||||
|
KEY_KEYPAD8 = "keypad8"
|
||||||
|
KEY_KEYPAD9 = "keypad9"
|
||||||
|
KEY_KEYPAD_PERIOD = "keypad_period"
|
||||||
|
KEY_KEYPAD_DIVIDE = "keypad_divide"
|
||||||
|
KEY_KEYPAD_MULTIPLY = "keypad_multiply"
|
||||||
|
KEY_KEYPAD_MINUS = "keypad_minus"
|
||||||
|
KEY_KEYPAD_PLUS = "keypad_plus"
|
||||||
|
KEY_KEYPAD_ENTER = "keypad_enter"
|
||||||
|
KEY_CLEAR = "clear"
|
||||||
|
KEY_F1 = "f1"
|
||||||
|
KEY_F2 = "f2"
|
||||||
|
KEY_F3 = "f3"
|
||||||
|
KEY_F4 = "f4"
|
||||||
|
KEY_F5 = "f5"
|
||||||
|
KEY_F6 = "f6"
|
||||||
|
KEY_F7 = "f7"
|
||||||
|
KEY_F8 = "f8"
|
||||||
|
KEY_F9 = "f9"
|
||||||
|
KEY_F10 = "f10"
|
||||||
|
KEY_F11 = "f11"
|
||||||
|
KEY_F12 = "f12"
|
||||||
|
KEY_F13 = "f13"
|
||||||
|
KEY_F14 = "f14"
|
||||||
|
KEY_F15 = "f15"
|
||||||
|
KEY_F16 = "f16"
|
||||||
|
KEY_F17 = "f17"
|
||||||
|
KEY_F18 = "f18"
|
||||||
|
KEY_F19 = "f19"
|
||||||
|
KEY_F20 = "f20"
|
||||||
|
KEY_SYSREQ = "sysreq"
|
||||||
|
KEY_BREAK = "break"
|
||||||
|
KEY_CONTEXT_MENU = "context_menu"
|
||||||
|
KEY_BROWSER_BACK = "browser_back"
|
||||||
|
KEY_BROWSER_FORWARD = "browser_forward"
|
||||||
|
KEY_BROWSER_REFRESH = "browser_refresh"
|
||||||
|
KEY_BROWSER_STOP = "browser_stop"
|
||||||
|
KEY_BROWSER_SEARCH = "browser_search"
|
||||||
|
KEY_BROWSER_FAVORITES = "browser_favorites"
|
||||||
|
KEY_BROWSER_HOME = "browser_home"
|
||||||
25
sublime/Packages/AAAPackageDev/Lib/sublime_lib/path.py
Normal file
25
sublime/Packages/AAAPackageDev/Lib/sublime_lib/path.py
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
import sublime
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
FTYPE_EXT_KEYMAP = ".sublime-keymap"
|
||||||
|
FTYPE_EXT_COMPLETIONS = ".sublime-completions"
|
||||||
|
FTYPE_EXT_SNIPPET = ".sublime-snippet"
|
||||||
|
FTYPE_EXT_BUILD = ".sublime-build"
|
||||||
|
FTYPE_EXT_SETTINGS = ".sublime-settings"
|
||||||
|
FTYPE_EXT_TMPREFERENCES = ".tmPreferences"
|
||||||
|
FTYPE_EXT_TMLANGUAGE = ".tmLanguage"
|
||||||
|
|
||||||
|
|
||||||
|
def root_at_packages(*leafs):
|
||||||
|
"""Combines leafs with path to Sublime's Packages folder.
|
||||||
|
"""
|
||||||
|
return os.path.join(sublime.packages_path(), *leafs)
|
||||||
|
|
||||||
|
|
||||||
|
def root_at_data(*leafs):
|
||||||
|
"""Combines leafs with Sublime's ``Data`` folder.
|
||||||
|
"""
|
||||||
|
data = os.path.join(os.path.split(sublime.packages_path())[0])
|
||||||
|
return os.path.join(data, *leafs)
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
from ._view import *
|
||||||
126
sublime/Packages/AAAPackageDev/Lib/sublime_lib/view/_view.py
Normal file
126
sublime/Packages/AAAPackageDev/Lib/sublime_lib/view/_view.py
Normal file
|
|
@ -0,0 +1,126 @@
|
||||||
|
import contextlib
|
||||||
|
from sublime import Region
|
||||||
|
|
||||||
|
|
||||||
|
def append(view, text):
|
||||||
|
"""Appends text to view."""
|
||||||
|
with in_one_edit(view) as edit:
|
||||||
|
view.insert(edit, view.size(), text)
|
||||||
|
|
||||||
|
|
||||||
|
@contextlib.contextmanager
|
||||||
|
def in_one_edit(view):
|
||||||
|
"""Context manager to group edits in a view.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
...
|
||||||
|
with in_one_edit(view):
|
||||||
|
...
|
||||||
|
...
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
edit = view.begin_edit()
|
||||||
|
yield edit
|
||||||
|
finally:
|
||||||
|
view.end_edit(edit)
|
||||||
|
|
||||||
|
|
||||||
|
def has_sels(view):
|
||||||
|
"""Returns ``True`` if ``view`` has one selection or more.``
|
||||||
|
"""
|
||||||
|
return len(view.sel()) > 0
|
||||||
|
|
||||||
|
|
||||||
|
def has_file_ext(view, ext):
|
||||||
|
"""Returns ``True`` if view has file extension ``ext``.
|
||||||
|
``ext`` may be specified with or without leading ``.``.
|
||||||
|
"""
|
||||||
|
if not view.file_name() or not ext.strip().replace('.', ''):
|
||||||
|
return False
|
||||||
|
|
||||||
|
if not ext.startswith('.'):
|
||||||
|
ext = '.' + ext
|
||||||
|
|
||||||
|
return view.file_name().endswith(ext)
|
||||||
|
|
||||||
|
|
||||||
|
def rowcount(view):
|
||||||
|
"""Returns the number of rows in ``view``.
|
||||||
|
"""
|
||||||
|
return view.rowcol(view.size())[0] + 1
|
||||||
|
|
||||||
|
|
||||||
|
def rowwidth(view, row):
|
||||||
|
"""Returns the number of characters of ``row`` in ``view``.
|
||||||
|
"""
|
||||||
|
return view.rowcol(view.line(view.text_point(row, 0)).end())[1]
|
||||||
|
|
||||||
|
|
||||||
|
def relative_point(view, x=0, y=0, p=None):
|
||||||
|
"""Returns a point (int) to the given coordinates.
|
||||||
|
|
||||||
|
Supports relative (negative) parameters and checks if they are in the
|
||||||
|
bounds (other than ``View.text_point()``).
|
||||||
|
|
||||||
|
If p (indexable -> ``p[0]``, ``len(p) == 2``; preferrably a tuple) is
|
||||||
|
specified, x and y parameters are overridden.
|
||||||
|
"""
|
||||||
|
if p is not None:
|
||||||
|
if len(p) != 2:
|
||||||
|
raise TypeError("Coordinates have 2 dimensions, not %d" % len(p))
|
||||||
|
(x, y) = p
|
||||||
|
row, col = x, y
|
||||||
|
|
||||||
|
# shortcut
|
||||||
|
if x == -1 and y == -1:
|
||||||
|
return view.size()
|
||||||
|
|
||||||
|
# calc absolute coords and check if coords are in the bounds
|
||||||
|
rowc = rowcount(view)
|
||||||
|
if x < 0:
|
||||||
|
row = max(rowc + x, 0)
|
||||||
|
else:
|
||||||
|
row = min(row, rowc)
|
||||||
|
|
||||||
|
roww = rowwidth(view, row)
|
||||||
|
if y < 0:
|
||||||
|
col = max(roww + y, 0)
|
||||||
|
else:
|
||||||
|
col = min(col, roww)
|
||||||
|
|
||||||
|
return view.text_point(row, col)
|
||||||
|
|
||||||
|
|
||||||
|
def coorded_region(view, reg1=None, reg2=None):
|
||||||
|
"""Returns a region of two coordinate pairs parsed by ``relative_point(view, p=reg1)``.
|
||||||
|
|
||||||
|
The pairs are supporsed to be indexable and have a length of 2.
|
||||||
|
Tuples are preferred.
|
||||||
|
|
||||||
|
Defaults to the whole buffer (``reg1=(0, 0), reg2=(-1, -1)``).
|
||||||
|
"""
|
||||||
|
reg1 = reg1 or (0, 0)
|
||||||
|
reg2 = reg2 or (-1, -1)
|
||||||
|
|
||||||
|
p1 = relative_point(view, p=reg1)
|
||||||
|
p2 = relative_point(view, p=reg2)
|
||||||
|
return Region(p1, p2)
|
||||||
|
|
||||||
|
|
||||||
|
def coorded_substr(view, reg1=None, reg2=None):
|
||||||
|
"""Returns the string of two coordinate pairs parsed by ``relative_point(view, p=reg1)``.
|
||||||
|
|
||||||
|
The pairs are supporsed to be indexable and have a length of 2.
|
||||||
|
Tuples are preferred.
|
||||||
|
|
||||||
|
Defaults to the whole buffer.
|
||||||
|
"""
|
||||||
|
return view.substr(coorded_region(view, reg1, reg2))
|
||||||
|
|
||||||
|
|
||||||
|
def get_text(view):
|
||||||
|
"""Returns the whole string of a buffer.
|
||||||
|
|
||||||
|
Alias for ``coorded_substr(view)``.
|
||||||
|
"""
|
||||||
|
return coorded_substr(view)
|
||||||
30
sublime/Packages/AAAPackageDev/Main.sublime-menu
Normal file
30
sublime/Packages/AAAPackageDev/Main.sublime-menu
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"id": "tools",
|
||||||
|
"children":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"id": "packages",
|
||||||
|
"caption": "Packages",
|
||||||
|
"children":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"caption": "Package Development",
|
||||||
|
"children":
|
||||||
|
[
|
||||||
|
{ "caption": "New Package…", "command": "new_package" },
|
||||||
|
{ "caption": "Delete Package…", "command": "delete_package" },
|
||||||
|
{ "caption": "-" },
|
||||||
|
{ "caption": "New Syntax Definition", "command": "new_syntax_def" },
|
||||||
|
{ "caption": "New Syntax Definition from Buffer", "command": "new_syntax_def_from_buffer" },
|
||||||
|
{ "caption": "-" },
|
||||||
|
{ "caption": "New Raw Snippet…", "command": "new_raw_snippet" },
|
||||||
|
{ "caption": "New Raw Snippet from Snippet…", "command": "new_raw_snippet_from_snippet" },
|
||||||
|
{ "caption": "Generate Snippet from Raw Snippet", "command": "generate_snippet_from_raw_snippet" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
190
sublime/Packages/AAAPackageDev/README.rst
Normal file
190
sublime/Packages/AAAPackageDev/README.rst
Normal file
|
|
@ -0,0 +1,190 @@
|
||||||
|
=============
|
||||||
|
AAAPackageDev
|
||||||
|
=============
|
||||||
|
|
||||||
|
status: beta
|
||||||
|
|
||||||
|
Overview
|
||||||
|
========
|
||||||
|
|
||||||
|
AAAPackageDev helps create and edit snippets, completions files, build systems
|
||||||
|
and other Sublime Text extensions.
|
||||||
|
|
||||||
|
The general workflow looks like this:
|
||||||
|
|
||||||
|
- run ``new_*`` command (``new_raw_snippet``, ``new_completions``, ``new_syntax_def``...)
|
||||||
|
- edit file (with specific snippets, completions, higlighting, build systems...)
|
||||||
|
- save file
|
||||||
|
|
||||||
|
AAAPackageDev ``new_*`` commands are typically accessible through the *Command
|
||||||
|
Palette* (``Ctrl+Shift+P``).
|
||||||
|
|
||||||
|
|
||||||
|
Getting Started
|
||||||
|
===============
|
||||||
|
|
||||||
|
#. Download and install `AAAPackageDev`_. (See `installation instructions`_ for ``.sublime-package`` files.)
|
||||||
|
#. Access commands from **Tools | Packages | Package Development** or the *Command Palette* (``Ctrl+Shift+P``).
|
||||||
|
|
||||||
|
.. _AAAPackageDev: https://bitbucket.org/guillermooo/aaapackagedev/downloads/AAAPackageDev.sublime-package
|
||||||
|
.. _installation instructions: http://sublimetext.info/docs/en/extensibility/packages.html#installation-of-packages
|
||||||
|
|
||||||
|
|
||||||
|
Syntax Definition Development
|
||||||
|
=============================
|
||||||
|
|
||||||
|
In AAAPackageDev, syntax definitions are written in JSON. Because Sublime Text
|
||||||
|
uses ``.tmLanguage`` files, though, they need to be converted before use. The
|
||||||
|
conversion is done through the included build system ``JSON to Property List``.
|
||||||
|
|
||||||
|
Creating a New Syntax Definition
|
||||||
|
********************************
|
||||||
|
|
||||||
|
#. Create new template (through **Tools | Packages | Package Development**) or the *Command Palette*
|
||||||
|
#. Select ``JSON to Property List`` build system from **Tools | Build System** or leave as ``Automatic``
|
||||||
|
#. Press ``F7``
|
||||||
|
|
||||||
|
|
||||||
|
Other included resources for syntax definition development:
|
||||||
|
|
||||||
|
* Snippets
|
||||||
|
|
||||||
|
|
||||||
|
Package Development
|
||||||
|
===================
|
||||||
|
|
||||||
|
Resources for package development are in a very early stage.
|
||||||
|
|
||||||
|
Commands
|
||||||
|
********
|
||||||
|
|
||||||
|
``new_package``
|
||||||
|
Window command. Prompts for a name and creates a new package skeleton in ``Packages``.
|
||||||
|
|
||||||
|
``delete_package``
|
||||||
|
Window command. Opens file browser at ``Packages``.
|
||||||
|
|
||||||
|
|
||||||
|
.. Completions
|
||||||
|
.. -----------
|
||||||
|
..
|
||||||
|
.. * sublime text plugin dev (off by default)
|
||||||
|
.. Will clutter your completions list in any kind of python dev.
|
||||||
|
.. To turn on, change scope selector to ``source.python``.
|
||||||
|
|
||||||
|
|
||||||
|
Build System Development
|
||||||
|
========================
|
||||||
|
|
||||||
|
* Syntax definition for ``.build-system`` files.
|
||||||
|
|
||||||
|
|
||||||
|
Key Map Development
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Syntax definition for ``.sublime-keymap`` files.
|
||||||
|
* Completions
|
||||||
|
* Snippets
|
||||||
|
|
||||||
|
|
||||||
|
Snippet Development
|
||||||
|
===================
|
||||||
|
|
||||||
|
AAAPackageDev provides a means to edit snippets using snippets. These snippets
|
||||||
|
are called *raw snippets*. You can use snippets and snippet-like syntax in many
|
||||||
|
files, but if you want to create ``.sublime-snippet`` files, you need to convert
|
||||||
|
raw snippets first. This converion is done with a command.
|
||||||
|
|
||||||
|
Inside ``AAAPackageDev/Support`` you will find a ``.sublime-keymap`` file.
|
||||||
|
The key bindings in it are included for reference. If you want them to work,
|
||||||
|
you need to copy the contents over to your personal ``.sublime-keymap`` file
|
||||||
|
under ``Packages/User``.
|
||||||
|
|
||||||
|
Creating Snippets
|
||||||
|
*****************
|
||||||
|
|
||||||
|
#. Create new raw snippet with included commands (**Tools | Packages | Package Development** or *Command Palette*)
|
||||||
|
#. Edit snippet
|
||||||
|
#. If needed, convert to ``.sublime-snippet`` with included command
|
||||||
|
|
||||||
|
You can use raw snippets directly in some files, like ``.sublime-completions`` files.
|
||||||
|
|
||||||
|
|
||||||
|
Completions Development
|
||||||
|
=======================
|
||||||
|
|
||||||
|
* Syntax definition for ``.sublime-completions`` files
|
||||||
|
* Snippets
|
||||||
|
|
||||||
|
You can use raw snippets directly in the ``contents`` element of a trigger-based
|
||||||
|
completion.
|
||||||
|
|
||||||
|
|
||||||
|
Settings File Development
|
||||||
|
=========================
|
||||||
|
|
||||||
|
* Syntax definition for ``.sublime-settings`` files
|
||||||
|
* Snippets
|
||||||
|
|
||||||
|
|
||||||
|
JSON and Property List Conversion
|
||||||
|
=================================
|
||||||
|
|
||||||
|
If you need to parse a ``.plist`` into a ``.json`` file or vice versa AAAPackageDev
|
||||||
|
can also be of help.
|
||||||
|
|
||||||
|
Commands
|
||||||
|
********
|
||||||
|
|
||||||
|
``json_to_plist`` (Palette: ``JSON to Property List``)
|
||||||
|
This command has already been mentioned in the Syntax Definition section, but it
|
||||||
|
is not stated that this command in fact works for almost any JSON file you can imagine.
|
||||||
|
|
||||||
|
It considers the current file's filename and adjusts the target filename accordingly.
|
||||||
|
|
||||||
|
* ``I am json.json`` will be parsed into ``I am json.plist``.
|
||||||
|
* ``I am json.JSON-propertyList`` will be parsed into ``I am json.propertyList``.
|
||||||
|
|
||||||
|
``plist_to_json`` (Palette: ``Property List to JSON``)
|
||||||
|
This command is just the reverse of the above. Considers the current file's filename
|
||||||
|
similarly and adjusts the target filename. However, if your file's extension is not
|
||||||
|
``.plist`` you need the doctype ``<!DOCTYPE plist`` at the beginning in one of the
|
||||||
|
first two lines in order to use this command, otherwise it will assume that you don't
|
||||||
|
have a Property List open.
|
||||||
|
|
||||||
|
Please note:
|
||||||
|
Non-native JSON data types (such as <date> or <data>) result in unpredictable
|
||||||
|
behavior. Floats types (<float> or <real>) tend to lose precision when being cast into
|
||||||
|
Python data types.
|
||||||
|
|
||||||
|
* ``I am json.plist`` will be parsed into ``I am json.json``.
|
||||||
|
* ``I am json.propertyList`` will be parsed into ``I am json.JSON-propertyList`` *only
|
||||||
|
if the doctype* ``<!DOCTYPE plist`` *is specified*.
|
||||||
|
|
||||||
|
|
||||||
|
About Snippets in AAAPackageDev
|
||||||
|
===============================
|
||||||
|
|
||||||
|
The ``AAAPackageDev/Snippets`` folder contains many snippets for all kinds of
|
||||||
|
development mentioned above. These snippets follow memorable rules to make their
|
||||||
|
use easy.
|
||||||
|
|
||||||
|
The snippets used more often have short tab triggers like ``f`` (*field*),
|
||||||
|
``c`` (*completion*), ``k`` (*key binding*), etc. In cases where increasingly
|
||||||
|
complex items of a similar kind might exist (numbered fields, fields with place
|
||||||
|
holders and fields with substitutions in the case of snippets), their tab triggers
|
||||||
|
will consist in a repeated character, like ``f``, ``ff`` and ``fff``.
|
||||||
|
|
||||||
|
As a rule of thumb, the more complex the snippet, the longer its tab trigger.
|
||||||
|
|
||||||
|
Also, ``i`` (for *item*) is often a generic synonym for the most common snippet
|
||||||
|
in a type of file. In such cases, ``ii`` and even longer tab triggers might work
|
||||||
|
too for consistency.
|
||||||
|
|
||||||
|
|
||||||
|
Sublime Library
|
||||||
|
===============
|
||||||
|
|
||||||
|
AAAPackageDev includes ``sublime_lib``, a Python package with utilities for
|
||||||
|
plugin developers. Once AAAPackageDev is installed, ``sublime_lib`` will be
|
||||||
|
importable from any plugin residing in ``Packages``.
|
||||||
5
sublime/Packages/AAAPackageDev/RELEASE.txt
Normal file
5
sublime/Packages/AAAPackageDev/RELEASE.txt
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
0.5
|
||||||
|
- Escaped regexp syntax def. (For regexes in JSON files.)
|
||||||
|
- Improvements to syntax defs for .sublime-keymap and .sublime-build.
|
||||||
|
- .sublime-build files will load their specific syntax automatically.
|
||||||
|
- Improved documentation.
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"scope": "source.sublimecommands",
|
||||||
|
|
||||||
|
"completions": [
|
||||||
|
{ "trigger": "c", "contents": "{ \"caption\": \"$1\", \"command\": \"$2\" }" },
|
||||||
|
{ "trigger": "i", "contents": "{ \"caption\": \"$1\", \"command\": \"$2\" }" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"scope": "source.sublimecompletions",
|
||||||
|
|
||||||
|
"completions": [
|
||||||
|
{ "trigger": "c", "contents": "{ \"trigger\": \"$1\", \"contents\": \"$2\" }$0" },
|
||||||
|
{ "trigger": "i", "contents": "{ \"triggers\": \"$1\", \"contents\": \"$2\" }$0" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
<snippet>
|
||||||
|
<content><![CDATA["args": {
|
||||||
|
"$1": "$2"$0
|
||||||
|
}]]></content>
|
||||||
|
<scope>source.sublimekeymap</scope>
|
||||||
|
<tabTrigger>args</tabTrigger>
|
||||||
|
</snippet>
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<snippet>
|
||||||
|
<content><![CDATA[{ "key": "$1", "operator": "$2", "operand": "$3" }$0]]></content>
|
||||||
|
<scope>source.sublimekeymap</scope>
|
||||||
|
<tabTrigger>c</tabTrigger>
|
||||||
|
</snippet>
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
<snippet>
|
||||||
|
<content><![CDATA["context":
|
||||||
|
[
|
||||||
|
{ "key": "$1", "operator": "$2", "operand": "$3" }$0
|
||||||
|
]]]></content>
|
||||||
|
<scope>source.sublimekeymap</scope>
|
||||||
|
<tabTrigger>ctx</tabTrigger>
|
||||||
|
</snippet>
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
<snippet>
|
||||||
|
<content><![CDATA[{
|
||||||
|
"keys": ["${1:ctrl+shift+h}"],
|
||||||
|
"command": "${2:foo_bar}"$0
|
||||||
|
}]]></content>
|
||||||
|
<scope>source.sublimekeymap</scope>
|
||||||
|
<tabTrigger>k</tabTrigger>
|
||||||
|
</snippet>
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"scope": "source.sublime-settings",
|
||||||
|
|
||||||
|
"completions": [
|
||||||
|
{ "trigger": "s", "contents": "\"$1\":$0" },
|
||||||
|
{ "trigger": "i", "contents": "\"$1\":$0" },
|
||||||
|
|
||||||
|
{ "trigger": "ss", "contents": "\"$1\": {$0}" },
|
||||||
|
{ "trigger": "ii", "contents": "\"$1\": {$0}" },
|
||||||
|
|
||||||
|
{ "trigger": "arr", "contents": "[$0]" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"scope": "source.sublimesnippetraw",
|
||||||
|
|
||||||
|
"completions": [
|
||||||
|
{ "trigger": "f", "contents": "\\$${1:field_name}" },
|
||||||
|
{ "trigger": "i", "contents": "\\$${1:field_name}" },
|
||||||
|
|
||||||
|
{ "trigger": "ff", "contents": "\\${${1:1}:${2:some_text}}" },
|
||||||
|
{ "trigger": "ii", "contents": "\\${${1:1}:${2:some_text}}" },
|
||||||
|
|
||||||
|
{ "trigger": "fff", "contents": "\\${${1:1}/${2:search_text}/${3:replacement_text}/$4}$0" },
|
||||||
|
{ "trigger": "iii", "contents": "\\${${1:1}/${2:search_text}/${3:replacement_text}/$4}$0" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
<snippet>
|
||||||
|
<content><![CDATA["${1:name}": {
|
||||||
|
$0
|
||||||
|
}
|
||||||
|
]]></content>
|
||||||
|
<tabTrigger>repoit</tabTrigger>
|
||||||
|
<scope>source.json-tmlanguage</scope>
|
||||||
|
</snippet>
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
<snippet>
|
||||||
|
<content><![CDATA["beginCaptures": {
|
||||||
|
"${1:0}": { "name": "${2:definition.string.quoted.double.untitled}" }
|
||||||
|
}$0]]></content>
|
||||||
|
<tabTrigger>bcaptures</tabTrigger>
|
||||||
|
<scope>source.json-tmlanguage</scope>
|
||||||
|
</snippet>
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
<snippet>
|
||||||
|
<content><![CDATA[{ "name": "${1:string.quoted.double.untitled}",
|
||||||
|
"begin": "$2",
|
||||||
|
"end": "$3"
|
||||||
|
}
|
||||||
|
]]></content>
|
||||||
|
<tabTrigger>begin</tabTrigger>
|
||||||
|
<scope>source.json-tmlanguage</scope>
|
||||||
|
</snippet>
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<snippet>
|
||||||
|
<content><![CDATA["${1:0}": { "name": "${2:definition.string.quoted.double.untitled}" }$0]]></content>
|
||||||
|
<tabTrigger>capture</tabTrigger>
|
||||||
|
<scope>source.json-tmlanguage</scope>
|
||||||
|
</snippet>
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
<snippet>
|
||||||
|
<content><![CDATA["captures": {
|
||||||
|
"${1:0}": { "name": "${2:definition.string.quoted.double.untitled}" }
|
||||||
|
}$0]]></content>
|
||||||
|
<tabTrigger>captures</tabTrigger>
|
||||||
|
<scope>source.json-tmlanguage</scope>
|
||||||
|
</snippet>
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<snippet>
|
||||||
|
<content><![CDATA["comment": "${2:this is a comment}"]]></content>
|
||||||
|
<tabTrigger>comment</tabTrigger>
|
||||||
|
<scope>source.json-tmlaguage</scope>
|
||||||
|
</snippet>
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
<snippet>
|
||||||
|
<content><![CDATA["endCaptures": {
|
||||||
|
"${1:0}": { "name": "${2:definition.string.quoted.double.untitled}" }
|
||||||
|
}$0]]></content>
|
||||||
|
<tabTrigger>ecaptures</tabTrigger>
|
||||||
|
<scope>source.json-tmlanguage</scope>
|
||||||
|
</snippet>
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<snippet>
|
||||||
|
<content><![CDATA["fileTypes": [${1:"f1"}]$0]]></content>
|
||||||
|
<tabTrigger>ftypes</tabTrigger>
|
||||||
|
<scope>source.json-tmlanguage</scope>
|
||||||
|
</snippet>
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<snippet>
|
||||||
|
<content><![CDATA[{ "include": "${1:#someElement}" }$0]]></content>
|
||||||
|
<tabTrigger>include</tabTrigger>
|
||||||
|
<scope>source.json-tmlanguage</scope>
|
||||||
|
</snippet>
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<snippet>
|
||||||
|
<content><![CDATA["${1:name}": "${2:value}"]]></content>
|
||||||
|
<tabTrigger>key</tabTrigger>
|
||||||
|
<scope>source.json-tmlanguage</scope>
|
||||||
|
</snippet>
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
<snippet>
|
||||||
|
<content><![CDATA[{ "name": "${1:keyword.control.untitled}",
|
||||||
|
"match": "${2:\\b(if|while|for|return)\\b}"
|
||||||
|
}${3:,}]]></content>
|
||||||
|
<tabTrigger>match</tabTrigger>
|
||||||
|
<scope>source.json-tmlanguage</scope>
|
||||||
|
</snippet>
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
<snippet>
|
||||||
|
<content><![CDATA["patterns": [$0
|
||||||
|
]]]></content>
|
||||||
|
<tabTrigger>patterns</tabTrigger>
|
||||||
|
<scope>source.json-tmlanguage</scope>
|
||||||
|
</snippet>
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<snippet>
|
||||||
|
<content><![CDATA["repository": {$0}]]></content>
|
||||||
|
<tabTrigger>repo</tabTrigger>
|
||||||
|
<scope>source.json-tmlanguage</scope>
|
||||||
|
</snippet>
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
[
|
||||||
|
{ "caption": "z:AAAPackageDev: New Raw Snippet", "command": "new_raw_snippet" },
|
||||||
|
{ "caption": "z:AAAPackageDev: New Raw Snippet from Snippet", "command": "new_raw_snippet_from_snippet" },
|
||||||
|
{ "caption": "z:AAAPackageDev: Generate Snippet from Raw Snippet", "command": "generate_snippet_from_raw_snippet" },
|
||||||
|
|
||||||
|
{ "caption": "z:AAAPackageDev: New Syntax Definition", "command": "new_syntax_def" },
|
||||||
|
{ "caption": "z:AAAPackageDev: New Syntax Definition from Buffer", "command": "new_syntax_def_from_buffer" },
|
||||||
|
|
||||||
|
{ "caption": "z:AAAPackageDev: JSON to Property List", "command": "json_to_plist" },
|
||||||
|
{ "caption": "z:AAAPackageDev: Property List to JSON", "command": "plist_to_json" },
|
||||||
|
|
||||||
|
{ "caption": "z:AAAPackageDev: New Settings File", "command": "new_settings" },
|
||||||
|
|
||||||
|
{ "caption": "z:AAAPackageDev: New Completions File", "command": "new_completions" },
|
||||||
|
|
||||||
|
{ "caption": "z:AAAPackageDev: New Commands File", "command": "new_commands_file" },
|
||||||
|
|
||||||
|
{ "caption": "z:AAAPackageDev: New Build System", "command": "new_build_system2" },
|
||||||
|
|
||||||
|
{ "caption": "z:AAAPackageDev: New Plugin", "command": "new_plugin" },
|
||||||
|
|
||||||
|
{ "caption": "z:AAAPackageDev: New Package", "command": "new_package" },
|
||||||
|
{ "caption": "z:AAAPackageDev: Delete Package", "command": "delete_package" }
|
||||||
|
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,138 @@
|
||||||
|
{
|
||||||
|
"scope": "source.off",
|
||||||
|
|
||||||
|
"completions": [
|
||||||
|
|
||||||
|
{ "trigger": "sublime", "contents": "sublime" },
|
||||||
|
{ "trigger": "sublime_plugin", "contents": "sublime_plugin" },
|
||||||
|
|
||||||
|
|
||||||
|
{"trigger": "set_timeout", "contents": "set_timeout(${1:callback}, ${2:delay})" },
|
||||||
|
{"trigger": "status_message", "contents": "status_message(${1:string})" },
|
||||||
|
{"trigger": "error_message", "contents": "error_message(${1:string})" },
|
||||||
|
{"trigger": "load_settings", "contents": "load_settings(${1:base_name})" },
|
||||||
|
{"trigger": "save_settings", "contents": "save_settings(${1:base_name})" },
|
||||||
|
{"trigger": "windows", "contents": "windows()" },
|
||||||
|
{"trigger": "active_window", "contents": "active_window()" },
|
||||||
|
{"trigger": "packages_path", "contents": "packages_path()" },
|
||||||
|
{"trigger": "installed_packages_path", "contents": "installed_packages_path()" },
|
||||||
|
{"trigger": "get_clipboard", "contents": "get_clipboard()" },
|
||||||
|
{"trigger": "set_clipboard", "contents": "set_clipboard(${1:string})" },
|
||||||
|
{"trigger": "log_commands", "contents": "log_commands(${1:flag})" },
|
||||||
|
|
||||||
|
|
||||||
|
{ "trigger": "id", "contents": "id()" },
|
||||||
|
{ "trigger": "buffer_id", "contents": "buffer_id()" },
|
||||||
|
{ "trigger": "file_name", "contents": "file_name()" },
|
||||||
|
{ "trigger": "name", "contents": "name()" },
|
||||||
|
{ "trigger": "set_name", "contents": "set_name(${1:name})" },
|
||||||
|
{ "trigger": "is_loading", "contents": "is_loading()" },
|
||||||
|
{ "trigger": "is_dirty", "contents": "is_dirty()" },
|
||||||
|
{ "trigger": "is_read_only", "contents": "is_read_only()" },
|
||||||
|
{ "trigger": "set_read_only", "contents": "set_read_only(${1:value})" },
|
||||||
|
{ "trigger": "is_scratch", "contents": "is_scratch()" },
|
||||||
|
{ "trigger": "set_scratch", "contents": "set_scratch(${1:value})" },
|
||||||
|
{ "trigger": "settings", "contents": "settings()" },
|
||||||
|
{ "trigger": "window", "contents": "window()" },
|
||||||
|
{ "trigger": "run_command", "contents": "run_command(${1:string}, ${2:<args>})" },
|
||||||
|
{ "trigger": "size", "contents": "size()" },
|
||||||
|
{ "trigger": "substr", "contents": "substr(${1:region or point})" },
|
||||||
|
{ "trigger": "begin_edit", "contents": "begin_edit(${1:<command>}, ${2:<args>})" },
|
||||||
|
{ "trigger": "end_edit", "contents": "end_edit(${1:edit})" },
|
||||||
|
{ "trigger": "insert", "contents": "insert(${1:edit}, ${2:point}, ${3:string})" },
|
||||||
|
{ "trigger": "erase", "contents": "erase(${1:edit}, ${2:region})" },
|
||||||
|
{ "trigger": "replace", "contents": "replace(${1:edit}, ${2:region}, ${3:string})" },
|
||||||
|
{ "trigger": "sel", "contents": "sel()" },
|
||||||
|
{ "trigger": "line", "contents": "line(${1:point or region})" },
|
||||||
|
{ "trigger": "full_line", "contents": "full_line(${1:point or region})" },
|
||||||
|
{ "trigger": "lines", "contents": "lines(${1:region})" },
|
||||||
|
{ "trigger": "split_by_newlines", "contents": "split_by_newlines(${1:region})" },
|
||||||
|
{ "trigger": "word", "contents": "word(${1:point or region})" },
|
||||||
|
{ "trigger": "find", "contents": "find(${1:pattern}, ${2:fromPosition}, ${3:<flags>})" },
|
||||||
|
{ "trigger": "find_all", "contents": "find_all(${1:pattern}, ${2:<flags>}, ${3:<format>}, ${4:<extractions>})" },
|
||||||
|
{ "trigger": "rowcol", "contents": "rowcol(${1:point})" },
|
||||||
|
{ "trigger": "text_point", "contents": "text_point(${1:row}, ${2:col})" },
|
||||||
|
{ "trigger": "set_syntax_file", "contents": "set_syntax_file(${1:syntax_file})" },
|
||||||
|
{ "trigger": "extract_scope", "contents": "extract_scope(${1:point})" },
|
||||||
|
{ "trigger": "scope_name", "contents": "scope_name(${1:point})" },
|
||||||
|
{ "trigger": "match_selector", "contents": "match_selector(${1:point}, ${2:selector})" },
|
||||||
|
{ "trigger": "show", "contents": "show(${1:point or region or region_set}, ${2:<show_surrounds>})" },
|
||||||
|
{ "trigger": "show_at_center", "contents": "show_at_center(${1:point or region})" },
|
||||||
|
{ "trigger": "visible_region", "contents": "visible_region()" },
|
||||||
|
{ "trigger": "add_regions", "contents": "add_regions(${1:key}, [${2:regions}], ${3:scope}, ${4:<icon>}, ${5:<flags>})" },
|
||||||
|
{ "trigger": "DRAW_EMPTY", "contents": "DRAW_EMPTY" },
|
||||||
|
{ "trigger": "HIDE_ON_MINIMAP", "contents": "HIDE_ON_MINIMAP" },
|
||||||
|
{ "trigger": "DRAW_EMPTY_AS_OVERWRITE", "contents": "DRAW_EMPTY_AS_OVERWRITE" },
|
||||||
|
{ "trigger": "DRAW_OUTLINED", "contents": "DRAW_OUTLINED" },
|
||||||
|
{ "trigger": "PERSISTENT", "contents": "PERSISTENT" },
|
||||||
|
{ "trigger": "HIDDEN", "contents": "HIDDEN" },
|
||||||
|
{ "trigger": "get_regions", "contents": "get_regions(${1:key})" },
|
||||||
|
{ "trigger": "erase_regions", "contents": "erase_regions(${1:key})" },
|
||||||
|
{ "trigger": "set_status", "contents": "set_status(${1:key}, ${2:value})" },
|
||||||
|
{ "trigger": "get_status", "contents": "get_status(${1:key})" },
|
||||||
|
{ "trigger": "erase_status", "contents": "erase_status(${1:key})" },
|
||||||
|
|
||||||
|
|
||||||
|
{ "trigger": "clear", "contents": "clear()" },
|
||||||
|
{ "trigger": "add", "contents": "add(${1:region})" },
|
||||||
|
{ "trigger": "add_all", "contents": "add_all(${1:region_set})" },
|
||||||
|
{ "trigger": "subtract", "contents": "subtract(${1:region})" },
|
||||||
|
{ "trigger": "contains", "contents": "contains(${1:region})" },
|
||||||
|
|
||||||
|
|
||||||
|
{ "trigger": "Region", "contents": "Region(${1:a}, ${2:b})" },
|
||||||
|
|
||||||
|
|
||||||
|
{ "trigger": "begin", "contents": "begin()" },
|
||||||
|
{ "trigger": "end", "contents": "end()" },
|
||||||
|
{ "trigger": "size", "contents": "size()" },
|
||||||
|
{ "trigger": "empty", "contents": "empty()" },
|
||||||
|
{ "trigger": "cover", "contents": "cover(${1:region})" },
|
||||||
|
{ "trigger": "intersection", "contents": "intersection(${1:region})" },
|
||||||
|
{ "trigger": "intersects", "contents": "intersects(${1:region})" },
|
||||||
|
{ "trigger": "contains", "contents": "contains(${1:region})" },
|
||||||
|
{ "trigger": "contains", "contents": "contains(${1:point})" },
|
||||||
|
|
||||||
|
|
||||||
|
{ "trigger": "id", "contents": "id()" },
|
||||||
|
{ "trigger": "new_file", "contents": "new_file()" },
|
||||||
|
{ "trigger": "open_file", "contents": "open_file(file_name, <flags>)" },
|
||||||
|
{ "trigger": "ENCODED_POSITION", "contents": "ENCODED_POSITION" },
|
||||||
|
{ "trigger": "TRANSIENT", "contents": "TRANSIENT" },
|
||||||
|
{ "trigger": "active_view", "contents": "active_view()" },
|
||||||
|
{ "trigger": "run_command", "contents": "run_command(string, <args>)" },
|
||||||
|
{ "trigger": "show_input_panel", "contents": "show_input_panel(caption, initial_text, on_done, on_change, on_cancel)" },
|
||||||
|
{ "trigger": "get_output_panel", "contents": "get_output_panel(name)" },
|
||||||
|
|
||||||
|
|
||||||
|
{ "trigger": "get", "contents": "get(name)" },
|
||||||
|
{ "trigger": "get", "contents": "get(name, default)" },
|
||||||
|
{ "trigger": "set", "contents": "set(name, value)" },
|
||||||
|
{ "trigger": "erase", "contents": "erase(name)" },
|
||||||
|
{ "trigger": "has", "contents": "has(name)" },
|
||||||
|
|
||||||
|
|
||||||
|
{ "trigger": "on_new", "contents": "on_new(view)" },
|
||||||
|
{ "trigger": "on_load", "contents": "on_load(view)" },
|
||||||
|
{ "trigger": "on_close", "contents": "on_close(view)" },
|
||||||
|
{ "trigger": "on_pre_save", "contents": "on_pre_save(view)" },
|
||||||
|
{ "trigger": "on_post_save", "contents": "on_post_save(view)" },
|
||||||
|
{ "trigger": "on_modified", "contents": "on_modified(view)" },
|
||||||
|
{ "trigger": "on_selection_modified", "contents": "on_selection_modified(view)" },
|
||||||
|
{ "trigger": "on_activated", "contents": "on_activated(view)" },
|
||||||
|
{ "trigger": "on_deactivated", "contents": "on_deactivated(view)" },
|
||||||
|
{ "trigger": "on_query_context", "contents": "on_query_context(view, key, operator, operand, match_all)" },
|
||||||
|
"OP_EQUAL",
|
||||||
|
"OP_NOT_EQUAL",
|
||||||
|
"OP_REGEX_MATCH",
|
||||||
|
"OP_NOT_REGEX_MATCH",
|
||||||
|
"OP_REGEX_CONTAINS",
|
||||||
|
"OP_NOT_REGEX_CONTAINS",
|
||||||
|
|
||||||
|
{ "trigger": "run", "contents": "run(<args>)" },
|
||||||
|
{ "trigger": "is_enabled", "contents": "is_enabled(<args>)" },
|
||||||
|
|
||||||
|
|
||||||
|
{ "trigger": "run", "contents": "run(edit, <args>)" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Comments</string>
|
||||||
|
<key>scope</key>
|
||||||
|
<string>source.sublime-settings</string>
|
||||||
|
<key>settings</key>
|
||||||
|
<dict>
|
||||||
|
<key>shellVariables</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>TM_COMMENT_START</string>
|
||||||
|
<key>value</key>
|
||||||
|
<string>// </string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>TM_COMMENT_START_2</string>
|
||||||
|
<key>value</key>
|
||||||
|
<string>/*</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>TM_COMMENT_END_2</string>
|
||||||
|
<key>value</key>
|
||||||
|
<string>*/</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>uuid</key>
|
||||||
|
<string>A67A8BD9-A951-406F-9175-018DD4B52FD1</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"keys": ["ctrl+s"], "command": "generate_snippet_from_raw_snippet",
|
||||||
|
"context":
|
||||||
|
[
|
||||||
|
{ "key": "selector", "operator": "equal", "operand": "source.sublimesnippetraw" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"keys": ["ctrl+shift+s"], "command": "copy_and_instert_raw_snippet",
|
||||||
|
"context":
|
||||||
|
[
|
||||||
|
{ "key": "selector", "operator": "equal", "operand": "source.sublimesnippetraw" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
{ "name": "JSON Generic Array",
|
||||||
|
|
||||||
|
"scopeName": "source.jsongenericarray",
|
||||||
|
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "#genericArray" }
|
||||||
|
],
|
||||||
|
|
||||||
|
"repository": {
|
||||||
|
|
||||||
|
"genericArray": {
|
||||||
|
"begin":"\\[",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "punctuation.definition.array.start.jsongenericarray"}
|
||||||
|
},
|
||||||
|
"end": "\\]",
|
||||||
|
"contentName": "meta.definition.array.jsongenericarray",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "source.jsongenericarrayelements" },
|
||||||
|
{ "include": "#genericArray" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"uuid": "8a5a7ee7-e39f-46ff-96ba-0691d65e946b"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>JSON Generic Array</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#genericArray</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>repository</key>
|
||||||
|
<dict>
|
||||||
|
<key>genericArray</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>\[</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.array.start.jsongenericarray</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>contentName</key>
|
||||||
|
<string>meta.definition.array.jsongenericarray</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>\]</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>source.jsongenericarrayelements</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#genericArray</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>scopeName</key>
|
||||||
|
<string>source.jsongenericarray</string>
|
||||||
|
<key>uuid</key>
|
||||||
|
<string>8a5a7ee7-e39f-46ff-96ba-0691d65e946b</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
{ "name": "JSON Generic Array Elements",
|
||||||
|
|
||||||
|
"scopeName": "source.jsongenericarrayelements",
|
||||||
|
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "#string" },
|
||||||
|
{ "include": "#numericConstants" },
|
||||||
|
{ "include": "#booleanConstants" }
|
||||||
|
],
|
||||||
|
|
||||||
|
"repository": {
|
||||||
|
|
||||||
|
"string": {
|
||||||
|
"begin":"\"",
|
||||||
|
"end": "\"",
|
||||||
|
"patterns": [
|
||||||
|
{ "match": "\\\\[\"tnr]",
|
||||||
|
"captures": {
|
||||||
|
"0": { "name": "constant.character.escape.jsongenericarrayelements" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ "include": "source.sublimesnippetraw" },
|
||||||
|
{ "name": "string.jsongenericarrayelements",
|
||||||
|
"match": ".+?"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
"numericConstants": {
|
||||||
|
"match": "\\d+(?:\\.\\d+)?",
|
||||||
|
"name": "constant.numeric.jsongenericarrayelements"
|
||||||
|
},
|
||||||
|
|
||||||
|
"booleanConstants": {
|
||||||
|
"match": "true|false",
|
||||||
|
"name": "constant.numeric.boolean.jsongenericarrayelements"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"uuid": "6c6128dc-0dcc-4a79-8adb-35bf12199d7f"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,76 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>JSON Generic Array Elements</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#string</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#numericConstants</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#booleanConstants</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>repository</key>
|
||||||
|
<dict>
|
||||||
|
<key>booleanConstants</key>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>true|false</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.numeric.boolean.jsongenericarrayelements</string>
|
||||||
|
</dict>
|
||||||
|
<key>numericConstants</key>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\d+(?:\.\d+)?</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.numeric.jsongenericarrayelements</string>
|
||||||
|
</dict>
|
||||||
|
<key>string</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>"</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>0</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.character.escape.jsongenericarrayelements</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\\["tnr]</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>source.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>.+?</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.jsongenericarrayelements</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>scopeName</key>
|
||||||
|
<string>source.jsongenericarrayelements</string>
|
||||||
|
<key>uuid</key>
|
||||||
|
<string>6c6128dc-0dcc-4a79-8adb-35bf12199d7f</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
{ "name": "Json Generic Object Elements",
|
||||||
|
"scopeName": "source.jsongenericobject",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "#key" },
|
||||||
|
{ "include": "#typeNumber" },
|
||||||
|
{ "include": "#typeBool" },
|
||||||
|
{ "include": "#typeString" },
|
||||||
|
{ "include": "#typeList" },
|
||||||
|
{ "include": "#typeObject" }
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"key": {
|
||||||
|
"match": "(\".+?\")\\s*(:)",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "string.generic.key.jsongenericobject" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"typeNumber": {
|
||||||
|
"match": "[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?",
|
||||||
|
"name": "constant.numeric.jsongenericobject"
|
||||||
|
},
|
||||||
|
"typeBool": {
|
||||||
|
"match": "\\b(?:true|false)\\b",
|
||||||
|
"name": "constant.numeric.jsongenericobject"
|
||||||
|
},
|
||||||
|
"typeString": {
|
||||||
|
"name": "string.quoted.double.jsongenericobject",
|
||||||
|
"begin": "\"",
|
||||||
|
"end": "\"",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "source.jsonstring" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"typeList": {
|
||||||
|
"name": "list.jsongenericobject",
|
||||||
|
"begin": "\\[",
|
||||||
|
"end": "]",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "$self" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"typeObject": {
|
||||||
|
"name": "object.jsongenericobject",
|
||||||
|
"begin": "\\{",
|
||||||
|
"end": "}",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "$self" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid": "4317eb4e-b7ae-496d-a689-7d8ea3711204"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,117 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Json Generic Object Elements</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#key</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#typeNumber</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#typeBool</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#typeString</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#typeList</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#typeObject</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>repository</key>
|
||||||
|
<dict>
|
||||||
|
<key>key</key>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.generic.key.jsongenericobject</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(".+?")\s*(:)</string>
|
||||||
|
</dict>
|
||||||
|
<key>typeBool</key>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\b(?:true|false)\b</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.numeric.jsongenericobject</string>
|
||||||
|
</dict>
|
||||||
|
<key>typeList</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>\[</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>]</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>list.jsongenericobject</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>$self</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>typeNumber</key>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.numeric.jsongenericobject</string>
|
||||||
|
</dict>
|
||||||
|
<key>typeObject</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>\{</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>}</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>object.jsongenericobject</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>$self</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>typeString</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>"</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.quoted.double.jsongenericobject</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>source.jsonstring</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>scopeName</key>
|
||||||
|
<string>source.jsongenericobject</string>
|
||||||
|
<key>uuid</key>
|
||||||
|
<string>4317eb4e-b7ae-496d-a689-7d8ea3711204</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
{ "name": "JSON String Content",
|
||||||
|
"scopeName": "source.jsonstring",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "#escapeSequence" },
|
||||||
|
{ "name": "string.double.quoted.jsonstring",
|
||||||
|
"match": ".+?"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"escapeSequence": {
|
||||||
|
"match": "\\\\(?:\"|/|\\\\|[bnfrt]|u[0-9a-fA-F]{4})",
|
||||||
|
"name": "entity.other.attribute-name.jsonstring"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid": "b94a984c-7a66-4c96-a828-dc8e7a6dafe7"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>JSON String Content</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#escapeSequence</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>.+?</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.double.quoted.jsonstring</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>repository</key>
|
||||||
|
<dict>
|
||||||
|
<key>escapeSequence</key>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\\(?:"|/|\\|[bnfrt]|u[0-9a-fA-F]{4})</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>entity.other.attribute-name.jsonstring</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>scopeName</key>
|
||||||
|
<string>source.jsonstring</string>
|
||||||
|
<key>uuid</key>
|
||||||
|
<string>b94a984c-7a66-4c96-a828-dc8e7a6dafe7</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"target": "json_to_plist",
|
||||||
|
"selector": "source.json, source.json-tmlanguage"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"scope": "context.operand.left.sublimekeymap",
|
||||||
|
|
||||||
|
"completions": [
|
||||||
|
"num_selections",
|
||||||
|
"auto_complete_visible",
|
||||||
|
"selection_empty",
|
||||||
|
"preceding_text",
|
||||||
|
"following_text",
|
||||||
|
"has_prev_field",
|
||||||
|
"has_next_field",
|
||||||
|
"panel_visible",
|
||||||
|
"overlay_visible",
|
||||||
|
"setting."
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"scope": "context.operator.name.sublimekeymap",
|
||||||
|
|
||||||
|
"completions": [
|
||||||
|
"true",
|
||||||
|
"false"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"scope": "context.operator.name.sublimekeymap",
|
||||||
|
|
||||||
|
"completions": [
|
||||||
|
"equal",
|
||||||
|
"not_equal",
|
||||||
|
"regex_match",
|
||||||
|
"not_regex_match",
|
||||||
|
"regex_contains",
|
||||||
|
"not_regex_contains"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,81 @@
|
||||||
|
{
|
||||||
|
"scope": "meta.array.key.sequence.sublimekeymap",
|
||||||
|
|
||||||
|
"completions": [
|
||||||
|
"super+",
|
||||||
|
"alt+",
|
||||||
|
"ctrl+",
|
||||||
|
"shift+",
|
||||||
|
"ctrl+shift+",
|
||||||
|
"alt+shift+",
|
||||||
|
"ctrl+alt+shift+",
|
||||||
|
"super+ctrl+",
|
||||||
|
"super+ctrl+shift+",
|
||||||
|
"super+shift+",
|
||||||
|
"super+alt+",
|
||||||
|
"super+alt+shift+",
|
||||||
|
"up",
|
||||||
|
"down",
|
||||||
|
"right",
|
||||||
|
"left",
|
||||||
|
"insert",
|
||||||
|
"home",
|
||||||
|
"end",
|
||||||
|
"pageup",
|
||||||
|
"pagedown",
|
||||||
|
"backspace",
|
||||||
|
"delete",
|
||||||
|
"tab",
|
||||||
|
"enter",
|
||||||
|
"pause",
|
||||||
|
"escape",
|
||||||
|
"space",
|
||||||
|
"keypad0",
|
||||||
|
"keypad1",
|
||||||
|
"keypad2",
|
||||||
|
"keypad3",
|
||||||
|
"keypad4",
|
||||||
|
"keypad5",
|
||||||
|
"keypad6",
|
||||||
|
"keypad7",
|
||||||
|
"keypad8",
|
||||||
|
"keypad9",
|
||||||
|
"keypad_period",
|
||||||
|
"keypad_divide",
|
||||||
|
"keypad_multiply",
|
||||||
|
"keypad_minus",
|
||||||
|
"keypad_plus",
|
||||||
|
"keypad_enter",
|
||||||
|
"clear",
|
||||||
|
"f1",
|
||||||
|
"f2",
|
||||||
|
"f3",
|
||||||
|
"f4",
|
||||||
|
"f5",
|
||||||
|
"f6",
|
||||||
|
"f7",
|
||||||
|
"f8",
|
||||||
|
"f9",
|
||||||
|
"f10",
|
||||||
|
"f11",
|
||||||
|
"f12",
|
||||||
|
"f13",
|
||||||
|
"f14",
|
||||||
|
"f15",
|
||||||
|
"f16",
|
||||||
|
"f17",
|
||||||
|
"f18",
|
||||||
|
"f19",
|
||||||
|
"f20",
|
||||||
|
"sysreq",
|
||||||
|
"break",
|
||||||
|
"context_menu",
|
||||||
|
"browser_back",
|
||||||
|
"browser_forward",
|
||||||
|
"browser_refresh",
|
||||||
|
"browser_stop",
|
||||||
|
"browser_search",
|
||||||
|
"browser_favorites",
|
||||||
|
"browser_home"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"target": "plist_to_json",
|
||||||
|
"selector": "text.xml"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,129 @@
|
||||||
|
{ "name": "Regular Expression (Escaped)",
|
||||||
|
|
||||||
|
"scopeName": "source.escapedregexp",
|
||||||
|
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "#classes" },
|
||||||
|
{ "include": "#anchorsWithBackslash" },
|
||||||
|
{ "include": "#allEscapes" },
|
||||||
|
{ "include": "#anchors" },
|
||||||
|
{ "include": "#quantifiers" },
|
||||||
|
{ "include": "#granularQuantifier" },
|
||||||
|
{ "include": "#operators" },
|
||||||
|
{ "include": "#sets" },
|
||||||
|
{ "include": "#groups" }
|
||||||
|
],
|
||||||
|
|
||||||
|
"repository": {
|
||||||
|
|
||||||
|
"allEscapes": {
|
||||||
|
"comment": "Order matters.",
|
||||||
|
"patterns" : [
|
||||||
|
{ "include": "#regexpEscapeSequences" },
|
||||||
|
{ "include": "#regexpEscapedBackslash" },
|
||||||
|
{ "include": "#jsonEscapeSequences" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
"regexpEscapeSequences": {
|
||||||
|
"match": "(?<!\\\\\\\\)\\\\\\\\(?:[]^+?*.(){}$\\[])",
|
||||||
|
"name": "constant.character.escape.sequence.regexp.escapedregexp",
|
||||||
|
"comment": "Escape next char if the slash isn't being escaped itself."
|
||||||
|
},
|
||||||
|
|
||||||
|
"regexpEscapedBackslash": {
|
||||||
|
"match": "\\\\\\\\",
|
||||||
|
"name": "constant.character.escape.sequence.regexp.escapedregexp"
|
||||||
|
},
|
||||||
|
|
||||||
|
"jsonEscapeSequences": {
|
||||||
|
"match": "\\\\[bfntr\"\/]",
|
||||||
|
"name": "entity.other.attribute-name.escape.sequence.json.escapedregexp"
|
||||||
|
},
|
||||||
|
|
||||||
|
"quantifiers": {
|
||||||
|
"match": "(\\+|\\*|\\?)(\\?)?",
|
||||||
|
"name": "keyword.other.quantifier.escapedregexp"
|
||||||
|
},
|
||||||
|
|
||||||
|
"granularQuantifier": {
|
||||||
|
"match": "(\\{)([0-9]+)(,)?([0-9]+)?(\\})",
|
||||||
|
"name": "meta.granular.quantifier.escapedregexp",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "keyword.other.punctuation.quantifier.start.escapedregexp" },
|
||||||
|
"2": { "name": "constant.numeric.escapedregexp" },
|
||||||
|
"3": { "name": "keyword.other.separator.escapedregexp" },
|
||||||
|
"4": { "name": "constant.numeric.escapedregexp" },
|
||||||
|
"5": { "name": "keyword.other.punctuation.quantifier.end.escapedregexp" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"classes": {
|
||||||
|
"match": "\\\\\\\\[dDsSwW]",
|
||||||
|
"name": "keyword.other.character-class.escapedregexp",
|
||||||
|
"comment": "XXX: Add unicode escapes \\x00 and escapes within comments."
|
||||||
|
},
|
||||||
|
|
||||||
|
"operators": {
|
||||||
|
"match": "[|.]",
|
||||||
|
"name": "keyword.other.operator.escapedregexp"
|
||||||
|
},
|
||||||
|
|
||||||
|
"sets": {
|
||||||
|
"begin": "(\\[)(\\^)?(\\])?",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "keyword.other.set.escapedregexp" },
|
||||||
|
"2": { "name": "keyword.other.set.operator.negate.escapedregexp" },
|
||||||
|
"3": { "name": "string.set.element.escapedregexp" }
|
||||||
|
},
|
||||||
|
"end": "]",
|
||||||
|
"endCaptures": {
|
||||||
|
"0": { "name": "keyword.other.set.escapedregexp" }
|
||||||
|
},
|
||||||
|
"patterns": [
|
||||||
|
{ "name": "support.function.set.range.escapedregexp",
|
||||||
|
"match": "[A-Za-z0-9](-)[A-Za-z0-9]",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "keyword.operator.other.set.range.separator.escapedregexp" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ "include": "#regexpEscapeSequences" },
|
||||||
|
{ "include": "#classes" },
|
||||||
|
{ "include": "#jsonEscapeSequences" },
|
||||||
|
{ "name": "string.set.element.escapedregexp",
|
||||||
|
"match": ".*?"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
"groups": {
|
||||||
|
"begin": "\\(",
|
||||||
|
"beginCaptures": {
|
||||||
|
"0": { "name": "string.regexp.group.escapedregexp" }
|
||||||
|
},
|
||||||
|
"endCaptures": {
|
||||||
|
"0": { "name": "string.regexp.group.escapedregexp" }
|
||||||
|
},
|
||||||
|
"end": "\\)",
|
||||||
|
"patterns": [
|
||||||
|
{ "name": "support.function.assertion.escapedregexp",
|
||||||
|
"match": "(\\?(?:[:=!>]|<[=!]))"
|
||||||
|
},
|
||||||
|
{ "include": "$self" }
|
||||||
|
],
|
||||||
|
"comment": "XXX: Implement named groups, options and yes/no groups."
|
||||||
|
},
|
||||||
|
|
||||||
|
"anchorsWithBackslash": {
|
||||||
|
"match": "(?:\\\\\\\\[AbBZ])",
|
||||||
|
"name": "entity.other.attribute-name.anchor.escapedregexp"
|
||||||
|
},
|
||||||
|
|
||||||
|
"anchors": {
|
||||||
|
"match": "[$^]",
|
||||||
|
"name": "entity.other.attribute-name.anchor.escapedregexp"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"uuid": "26c6799e-6824-4926-b2e5-87140300b97b"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,275 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Regular Expression (Escaped)</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#classes</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#anchorsWithBackslash</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#allEscapes</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#anchors</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#quantifiers</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#granularQuantifier</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#operators</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#sets</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#groups</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>repository</key>
|
||||||
|
<dict>
|
||||||
|
<key>allEscapes</key>
|
||||||
|
<dict>
|
||||||
|
<key>comment</key>
|
||||||
|
<string>Order matters.</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#regexpEscapeSequences</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#regexpEscapedBackslash</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#jsonEscapeSequences</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>anchors</key>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>[$^]</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>entity.other.attribute-name.anchor.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
<key>anchorsWithBackslash</key>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(?:\\\\[AbBZ])</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>entity.other.attribute-name.anchor.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
<key>classes</key>
|
||||||
|
<dict>
|
||||||
|
<key>comment</key>
|
||||||
|
<string>XXX: Add unicode escapes \x00 and escapes within comments.</string>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\\\\[dDsSwW]</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.character-class.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
<key>granularQuantifier</key>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.punctuation.quantifier.start.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.numeric.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
<key>3</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.separator.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
<key>4</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.numeric.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
<key>5</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.punctuation.quantifier.end.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(\{)([0-9]+)(,)?([0-9]+)?(\})</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.granular.quantifier.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
<key>groups</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>\(</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>0</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.regexp.group.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>comment</key>
|
||||||
|
<string>XXX: Implement named groups, options and yes/no groups.</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>\)</string>
|
||||||
|
<key>endCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>0</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.regexp.group.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(\?(?:[:=!>]|<[=!]))</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.assertion.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>$self</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>jsonEscapeSequences</key>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\\[bfntr"/]</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>entity.other.attribute-name.escape.sequence.json.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
<key>operators</key>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>[|.]</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.operator.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
<key>quantifiers</key>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(\+|\*|\?)(\?)?</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.quantifier.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
<key>regexpEscapeSequences</key>
|
||||||
|
<dict>
|
||||||
|
<key>comment</key>
|
||||||
|
<string>Escape next char if the slash isn't being escaped itself.</string>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(?<!\\\\)\\\\(?:[]^+?*.(){}$\[])</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.character.escape.sequence.regexp.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
<key>regexpEscapedBackslash</key>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\\\\</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.character.escape.sequence.regexp.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
<key>sets</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>(\[)(\^)?(\])?</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.set.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.set.operator.negate.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
<key>3</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.set.element.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>end</key>
|
||||||
|
<string>]</string>
|
||||||
|
<key>endCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>0</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.set.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.operator.other.set.range.separator.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>[A-Za-z0-9](-)[A-Za-z0-9]</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.set.range.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#regexpEscapeSequences</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#classes</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#jsonEscapeSequences</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>.*?</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.set.element.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>scopeName</key>
|
||||||
|
<string>source.escapedregexp</string>
|
||||||
|
<key>uuid</key>
|
||||||
|
<string>26c6799e-6824-4926-b2e5-87140300b97b</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
@ -0,0 +1,82 @@
|
||||||
|
{ "name": "Sublime Text Commands",
|
||||||
|
|
||||||
|
"scopeName": "source.sublimecommands",
|
||||||
|
|
||||||
|
"fileTypes": ["sublime-commands"],
|
||||||
|
|
||||||
|
"patterns": [
|
||||||
|
{ "begin": "(\\[)",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "punctuation.definition.collection.start.sublimecommands" }
|
||||||
|
},
|
||||||
|
"end": "(\\])",
|
||||||
|
"endCaptures": {
|
||||||
|
"1": { "name": "punctuation.definition.collection.end.sublimecommands" }
|
||||||
|
},
|
||||||
|
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "#command" },
|
||||||
|
{ "include": "#args" },
|
||||||
|
{ "match": "(?<!\\}),",
|
||||||
|
"name": "invalid.illegal.definition.sublimecommands"
|
||||||
|
},
|
||||||
|
{ "match": ",{2,}",
|
||||||
|
"name": "invalid.illegal.definition.sublimecommands"
|
||||||
|
},
|
||||||
|
{ "match": "[^,\t\\s]",
|
||||||
|
"name": "invalid.illegal.definition.sublimecommands"
|
||||||
|
},
|
||||||
|
{ "name": "invalid.illegal.definition.sublimecommands",
|
||||||
|
"match": ",(?>$\\s+\\])",
|
||||||
|
"comment": "XXX"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
"repository": {
|
||||||
|
|
||||||
|
"args": {
|
||||||
|
"begin": "\"(args)\"\\s*:",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "keyword.other.sublimecommands"}
|
||||||
|
},
|
||||||
|
"end": "(?<=\\})",
|
||||||
|
"name": "meta.definition.attached.command.arguments.sublimecommands",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "source.jsongenericarray"
|
||||||
|
},
|
||||||
|
{ "match": "\"([a-zA-Z0-9_]+)\"\\s*:",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "support.function.array.generic.key.sublimecommands" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ "include": "source.jsongenericarrayelements"
|
||||||
|
},
|
||||||
|
{ "match": "true|false|\\d+",
|
||||||
|
"name": "constant.numeric.sublimecommands"
|
||||||
|
},
|
||||||
|
|
||||||
|
{ "match": "\\{",
|
||||||
|
"name": "punctuation.definition.array.keybinding.key.sequence"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
"command": {
|
||||||
|
"begin": "\\{",
|
||||||
|
"end": "\\}",
|
||||||
|
"patterns": [
|
||||||
|
{ "match": "\"(command|caption)\":\\s*\"([^\"]+)\"",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "keyword.other.sublimecommands" },
|
||||||
|
"2": { "name": "string.attached.command.name.sublimecommands" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ "include": "#args" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"uuid": "f56e1baa-51fc-4791-a9d9-21301f2e3a01"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,164 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>fileTypes</key>
|
||||||
|
<array>
|
||||||
|
<string>sublime-commands</string>
|
||||||
|
</array>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Sublime Text Commands</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>(\[)</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.collection.start.sublimecommands</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>end</key>
|
||||||
|
<string>(\])</string>
|
||||||
|
<key>endCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.collection.end.sublimecommands</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#command</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#args</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(?<!\}),</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>invalid.illegal.definition.sublimecommands</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>,{2,}</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>invalid.illegal.definition.sublimecommands</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>[^, \s]</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>invalid.illegal.definition.sublimecommands</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>comment</key>
|
||||||
|
<string>XXX</string>
|
||||||
|
<key>match</key>
|
||||||
|
<string>,(?>$\s+\])</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>invalid.illegal.definition.sublimecommands</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>repository</key>
|
||||||
|
<dict>
|
||||||
|
<key>args</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"(args)"\s*:</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.sublimecommands</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>end</key>
|
||||||
|
<string>(?<=\})</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.definition.attached.command.arguments.sublimecommands</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>source.jsongenericarray</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.array.generic.key.sublimecommands</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"([a-zA-Z0-9_]+)"\s*:</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>source.jsongenericarrayelements</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>true|false|\d+</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.numeric.sublimecommands</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\{</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.array.keybinding.key.sequence</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>command</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>\{</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>\}</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.sublimecommands</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.attached.command.name.sublimecommands</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"(command|caption)":\s*"([^"]+)"</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#args</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>scopeName</key>
|
||||||
|
<string>source.sublimecommands</string>
|
||||||
|
<key>uuid</key>
|
||||||
|
<string>f56e1baa-51fc-4791-a9d9-21301f2e3a01</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
@ -0,0 +1,92 @@
|
||||||
|
{ "name": "Sublime Completions",
|
||||||
|
|
||||||
|
"scopeName": "source.sublimecompletions",
|
||||||
|
|
||||||
|
"fileTypes": ["sublime-completions"],
|
||||||
|
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "#completionsDict" }
|
||||||
|
],
|
||||||
|
|
||||||
|
"repository": {
|
||||||
|
|
||||||
|
"completionsDict": {
|
||||||
|
"begin": "\\{",
|
||||||
|
"end": "\\}",
|
||||||
|
"contentName": "meta.completions.dictionary.sublimecompletions",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "#scope" },
|
||||||
|
{ "include": "#completionsList" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
"scope": {
|
||||||
|
"match": "\"(scope)\"\\s*?:\\s*?\"([a-zA-Z0-9. ,-]+)\"",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "keyword.key.sublimecompletions" },
|
||||||
|
"2": { "name": "string.scope.selector.sublimecompletions" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"completionsList": {
|
||||||
|
"begin": "\"(completions)\"\\s*?:\\s*?",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1" : { "name": "keyword.key.sublimecompletions" }
|
||||||
|
},
|
||||||
|
"end": "(?<=\\])",
|
||||||
|
"contentName": "meta.completions.array.sublimecompletions",
|
||||||
|
"patterns": [
|
||||||
|
{ "match": "\\[" },
|
||||||
|
{ "include": "#triggerCompletion" },
|
||||||
|
{ "include": "#simpleCompletion" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
"simpleCompletion": {
|
||||||
|
"match": "\"([a-zA-Z0-9_.]+)\"",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "string.completion.simple.sublimecompletions" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"triggerCompletion": {
|
||||||
|
"begin": "\\{",
|
||||||
|
"end": "\\}",
|
||||||
|
"contentName": "meta.completion.trigger-based.sublimecompletions",
|
||||||
|
"patterns": [
|
||||||
|
{ "match": "\"(trigger)\"\\s*?:\\s*?\"([a-zA-Z0-9_.-]+)\"",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "support.function.key.sublimecompletions" },
|
||||||
|
"2": { "name": "string.trigger.name.sublimecompletions" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{ "begin": "\"(contents)\"\\s*?:\\s*?\"",
|
||||||
|
"end": "\"",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "support.function.key.sublimecompletions" }
|
||||||
|
},
|
||||||
|
"comment": "XXX: rules below are becoming a mess. escaped $ does not work at the moment after escaped backslashes.",
|
||||||
|
"patterns": [
|
||||||
|
{ "name": "constant.character.escape.sequence.snippet.sublimecompletions",
|
||||||
|
"match": "\\\\\\\\(?:\\$)"
|
||||||
|
},
|
||||||
|
{ "name": "entity.other.attribute-name.escape.sequence.json.sublimecompletions",
|
||||||
|
"match": "\\\\(?:[tvbarn\"\\\\])"
|
||||||
|
},
|
||||||
|
{ "name": "invalid.illegal.unescaped.characters.sublimecompletions",
|
||||||
|
"match": "\\$(?!\\{|[0-9A-Za-z])"
|
||||||
|
},
|
||||||
|
{ "include": "source.sublimesnippetraw" },
|
||||||
|
{ "name": "string.snippet.sublimecompletions",
|
||||||
|
"match": ".*?"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"contentName": "source.sublimesnippetraw"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"uuid": "3abbb928-3b6a-49b9-903f-150c021accb2"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"extensions": ["sublime-completions"]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,187 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>fileTypes</key>
|
||||||
|
<array>
|
||||||
|
<string>sublime-completions</string>
|
||||||
|
</array>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Sublime Completions</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#completionsDict</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>repository</key>
|
||||||
|
<dict>
|
||||||
|
<key>completionsDict</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>\{</string>
|
||||||
|
<key>contentName</key>
|
||||||
|
<string>meta.completions.dictionary.sublimecompletions</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>\}</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#scope</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#completionsList</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>completionsList</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"(completions)"\s*?:\s*?</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.key.sublimecompletions</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>contentName</key>
|
||||||
|
<string>meta.completions.array.sublimecompletions</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>(?<=\])</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\[</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#triggerCompletion</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#simpleCompletion</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>scope</key>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.key.sublimecompletions</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.scope.selector.sublimecompletions</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"(scope)"\s*?:\s*?"([a-zA-Z0-9. ,-]+)"</string>
|
||||||
|
</dict>
|
||||||
|
<key>simpleCompletion</key>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.completion.simple.sublimecompletions</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"([a-zA-Z0-9_.]+)"</string>
|
||||||
|
</dict>
|
||||||
|
<key>triggerCompletion</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>\{</string>
|
||||||
|
<key>contentName</key>
|
||||||
|
<string>meta.completion.trigger-based.sublimecompletions</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>\}</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.key.sublimecompletions</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.trigger.name.sublimecompletions</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"(trigger)"\s*?:\s*?"([a-zA-Z0-9_.-]+)"</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"(contents)"\s*?:\s*?"</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.key.sublimecompletions</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>comment</key>
|
||||||
|
<string>XXX: rules below are becoming a mess. escaped $ does not work at the moment after escaped backslashes.</string>
|
||||||
|
<key>contentName</key>
|
||||||
|
<string>source.sublimesnippetraw</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>"</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\\\\(?:\$)</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.character.escape.sequence.snippet.sublimecompletions</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\\(?:[tvbarn"\\])</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>entity.other.attribute-name.escape.sequence.json.sublimecompletions</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\$(?!\{|[0-9A-Za-z])</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>invalid.illegal.unescaped.characters.sublimecompletions</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>source.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>.*?</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.snippet.sublimecompletions</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>scopeName</key>
|
||||||
|
<string>source.sublimecompletions</string>
|
||||||
|
<key>uuid</key>
|
||||||
|
<string>3abbb928-3b6a-49b9-903f-150c021accb2</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
@ -0,0 +1,182 @@
|
||||||
|
{ "name": "Sublime Text Syntax Definition",
|
||||||
|
|
||||||
|
"scopeName": "source.json-tmlanguage",
|
||||||
|
|
||||||
|
"fileTypes": ["json-tmlanguage"],
|
||||||
|
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "#syntaxName" },
|
||||||
|
{ "include": "#scopeName" },
|
||||||
|
{ "include": "#name" },
|
||||||
|
{ "include": "#fileTypes" },
|
||||||
|
{ "include": "#patterns" },
|
||||||
|
{ "include": "#repo" },
|
||||||
|
{ "include": "#comment" },
|
||||||
|
{ "include": "#uuid" }
|
||||||
|
],
|
||||||
|
|
||||||
|
"repository": {
|
||||||
|
|
||||||
|
"match": {
|
||||||
|
"begin": "\"(match|begin|end)\"\\s*?:\\s*(\")",
|
||||||
|
"end": "(\")",
|
||||||
|
"name": "meta.definition.error.data.json-tmlanguage",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "source.escapedregexp" }
|
||||||
|
],
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "keyword.other.control.json-tmlanguage"},
|
||||||
|
"2": { "name": "punctuation.definition.regex.start.json-tmlanguage" }
|
||||||
|
},
|
||||||
|
"endCaptures": {
|
||||||
|
"1": { "name": "punctuation.definition.regex.end.json-tmlanguage" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"include": {
|
||||||
|
"match": "\"(include)\"\\s*?:\\s*?\"(?:(#)([a-zA-Z0-9_-]+)|(\\$)(self)|([A-Za-z0-9.]+))\"",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "keyword.other.control.json-tmlanguage" },
|
||||||
|
"2": { "name": "keyword.other.variable.mark.json-tmlanguage" },
|
||||||
|
"3": { "name": "string.repository.item.identifier.json-tmlanguage" },
|
||||||
|
"4": { "name": "keyword.other.variable.mark.json-tmlanguage" },
|
||||||
|
"5": { "name": "support.function.other.variable.mark.json-tmlanguage" },
|
||||||
|
"6": { "name": "string.repository.item.identifier.json-tmlanguage" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"patterns": {
|
||||||
|
"begin": "\"(patterns)\"\\s*?:\\s*?\\[",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "keyword.other.control.json-tmlanguage" }
|
||||||
|
},
|
||||||
|
"end": "\\]",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "#patternsItem" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
"patternsItem": {
|
||||||
|
"begin": "\\{",
|
||||||
|
"end": "\\}",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "#name" },
|
||||||
|
{ "include": "#match" },
|
||||||
|
{ "include": "#include" },
|
||||||
|
{ "include": "#patterns" },
|
||||||
|
{ "include": "#captures" },
|
||||||
|
{ "include": "#comment" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
"fileTypes": {
|
||||||
|
"begin": "\"(fileTypes)\"\\s*?:\\s*?\\[",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "keyword.other.control.json-tmlanguage" }
|
||||||
|
},
|
||||||
|
"end": "\\]",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "source.jsongenericarrayelements" }
|
||||||
|
|
||||||
|
],
|
||||||
|
"contentName": "meta.json.generic.array.json.tmlanguage"
|
||||||
|
},
|
||||||
|
|
||||||
|
"name": {
|
||||||
|
"match": "\"((?:content)?[nN]ame)\"\\s*?:\\s*?\"(.+?)\"",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "keyword.other.control.json-tmlanguage" },
|
||||||
|
"2": { "name": "string.meta.data.json-tmlanguage" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"syntaxName": {
|
||||||
|
"match": "\"(name)\"\\s*?:\\s*?\"(.+?)\"",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "keyword.other.control.json-tmlanguage" },
|
||||||
|
"2": { "name": "string.meta.sytax.name.json-tmlanguage" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"scopeName": {
|
||||||
|
"match": "\"(scopeName)\"\\s*?:\\s*?\"(.+?)\"",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "keyword.other.control.json-tmlanguage" },
|
||||||
|
"2": { "name": "string.meta.scope.name.json-tmlanguage" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"comment": {
|
||||||
|
"match": "\"(comment)\"\\s*?:\\s*?\"(.+?)\"",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "keyword.other.control.json-tmlanguage" },
|
||||||
|
"2": { "name": "comment.json-tmlanguage" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"uuid": {
|
||||||
|
"match": "\"(uuid)\"\\s*?:\\s*?\"([a-z0-9]+)-([a-z0-9]+)-([a-z0-9]+)-([a-z0-9]+)-([a-z0-9]+)\"",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "keyword.other.control.json-tmlanguage" },
|
||||||
|
"2": { "name": "constant.numeric.json-tmlanguage" },
|
||||||
|
"3": { "name": "constant.numeric.json-tmlanguage" },
|
||||||
|
"4": { "name": "constant.numeric.json-tmlanguage" },
|
||||||
|
"5": { "name": "constant.numeric.json-tmlanguage" },
|
||||||
|
"6": { "name": "constant.numeric.json-tmlanguage" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"repo": {
|
||||||
|
"begin": "\"(repository)\"\\s*?:\\s*?\\{",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "keyword.other.control.json-tmlanguage" }
|
||||||
|
},
|
||||||
|
"end": "\\}",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "#repositoryItem" }
|
||||||
|
],
|
||||||
|
"contentName": "meta.repository.json-tmlanguage"
|
||||||
|
},
|
||||||
|
|
||||||
|
"repositoryItem": {
|
||||||
|
"begin": "\"([a-zA-Z0-9_-]+)\"\\s*?:\\s*?\\{",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "entity.other.attribute-name.json-tmlanguage" }
|
||||||
|
},
|
||||||
|
"end": "\\}",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "#match" },
|
||||||
|
{ "include": "#name" },
|
||||||
|
{ "include": "#patterns" },
|
||||||
|
{ "include": "#captures" },
|
||||||
|
{ "include": "#comment" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
"captures": {
|
||||||
|
"begin": "\"((?:begin|end)?[cC]aptures)\"\\s*?:\\s*?\\{",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "keyword.other.control.json-tmlanguage" }
|
||||||
|
},
|
||||||
|
"end": "\\}",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "#captureItem" }
|
||||||
|
],
|
||||||
|
"contentName": "meta.captures.json-tmlanguage"
|
||||||
|
},
|
||||||
|
|
||||||
|
"captureItem": {
|
||||||
|
"begin": "\"(\\d+)\"\\s+*?:\\s*?\\{",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "constant.numeric.capture.name.json-tmlanguage" }
|
||||||
|
},
|
||||||
|
"end": "\\}",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "#name" }
|
||||||
|
],
|
||||||
|
"contentName": "meta.capture.json-tmlanguage"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"uuid": "8c7e3a99-1780-4b72-9ce5-585949c0563e"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,429 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>fileTypes</key>
|
||||||
|
<array>
|
||||||
|
<string>json-tmlanguage</string>
|
||||||
|
</array>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Sublime Text Syntax Definition</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#syntaxName</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#scopeName</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#name</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#fileTypes</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#patterns</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#repo</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#comment</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#uuid</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>repository</key>
|
||||||
|
<dict>
|
||||||
|
<key>captureItem</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"(\d+)"\s+*?:\s*?\{</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.numeric.capture.name.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>contentName</key>
|
||||||
|
<string>meta.capture.json-tmlanguage</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>\}</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#name</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"((?:begin|end)?[cC]aptures)"\s*?:\s*?\{</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.control.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>contentName</key>
|
||||||
|
<string>meta.captures.json-tmlanguage</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>\}</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#captureItem</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>comment</key>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.control.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>comment.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"(comment)"\s*?:\s*?"(.+?)"</string>
|
||||||
|
</dict>
|
||||||
|
<key>fileTypes</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"(fileTypes)"\s*?:\s*?\[</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.control.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>contentName</key>
|
||||||
|
<string>meta.json.generic.array.json.tmlanguage</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>\]</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>source.jsongenericarrayelements</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>include</key>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.control.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.variable.mark.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
<key>3</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.repository.item.identifier.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
<key>4</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.variable.mark.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
<key>5</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.other.variable.mark.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
<key>6</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.repository.item.identifier.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"(include)"\s*?:\s*?"(?:(#)([a-zA-Z0-9_-]+)|(\$)(self)|([A-Za-z0-9.]+))"</string>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"(match|begin|end)"\s*?:\s*(")</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.control.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.regex.start.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>end</key>
|
||||||
|
<string>(")</string>
|
||||||
|
<key>endCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.regex.end.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.definition.error.data.json-tmlanguage</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>source.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>name</key>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.control.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.meta.data.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"((?:content)?[nN]ame)"\s*?:\s*?"(.+?)"</string>
|
||||||
|
</dict>
|
||||||
|
<key>patterns</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"(patterns)"\s*?:\s*?\[</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.control.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>end</key>
|
||||||
|
<string>\]</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#patternsItem</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>patternsItem</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>\{</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>\}</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#name</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#match</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#include</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#patterns</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#captures</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#comment</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>repo</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"(repository)"\s*?:\s*?\{</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.control.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>contentName</key>
|
||||||
|
<string>meta.repository.json-tmlanguage</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>\}</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#repositoryItem</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>repositoryItem</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"([a-zA-Z0-9_-]+)"\s*?:\s*?\{</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>entity.other.attribute-name.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>end</key>
|
||||||
|
<string>\}</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#match</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#name</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#patterns</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#captures</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#comment</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>scopeName</key>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.control.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.meta.scope.name.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"(scopeName)"\s*?:\s*?"(.+?)"</string>
|
||||||
|
</dict>
|
||||||
|
<key>syntaxName</key>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.control.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.meta.sytax.name.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"(name)"\s*?:\s*?"(.+?)"</string>
|
||||||
|
</dict>
|
||||||
|
<key>uuid</key>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.control.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.numeric.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
<key>3</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.numeric.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
<key>4</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.numeric.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
<key>5</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.numeric.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
<key>6</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.numeric.json-tmlanguage</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"(uuid)"\s*?:\s*?"([a-z0-9]+)-([a-z0-9]+)-([a-z0-9]+)-([a-z0-9]+)-([a-z0-9]+)"</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>scopeName</key>
|
||||||
|
<string>source.json-tmlanguage</string>
|
||||||
|
<key>uuid</key>
|
||||||
|
<string>8c7e3a99-1780-4b72-9ce5-585949c0563e</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
@ -0,0 +1,118 @@
|
||||||
|
{ "name": "Sublime Text Key Map",
|
||||||
|
"scopeName": "source.sublimekeymap",
|
||||||
|
"fileTypes": ["sublime-keymap"],
|
||||||
|
"patterns": [
|
||||||
|
|
||||||
|
{ "include": "#multiLineComment" },
|
||||||
|
{ "include": "#lineComment" },
|
||||||
|
|
||||||
|
{ "begin": "(^\\[$)",
|
||||||
|
"end": "(^\\]$)",
|
||||||
|
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "#multiLineComment" },
|
||||||
|
{ "include": "#lineComment" },
|
||||||
|
{ "include": "#keys" },
|
||||||
|
{ "include": "#mainKeys" },
|
||||||
|
{ "include": "#supportKeys" },
|
||||||
|
{ "include": "#string" },
|
||||||
|
{ "include": "#numericPrimitives" }
|
||||||
|
],
|
||||||
|
"contentName": "meta.keybinding.collection.sublimekeymap"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"keys": {
|
||||||
|
"begin": "\"(keys)\": \\[",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "keyword.other.sublimekeymap"}
|
||||||
|
},
|
||||||
|
"end": "\\],",
|
||||||
|
"patterns": [
|
||||||
|
{ "begin": "(\")",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "punctuation.keybinding.definition.key.sequence.start.sublimekeymap" }
|
||||||
|
},
|
||||||
|
"end": "(?<!\\\\)(\")",
|
||||||
|
"endCaptures": {
|
||||||
|
"1": { "name": "punctuation.keybinding.definition.key.sequence.end.sublime.sublimekeymap" }
|
||||||
|
},
|
||||||
|
"patterns": [
|
||||||
|
{ "match": "(?<!shift|ctrl|alt|super|\\+)\\+",
|
||||||
|
"name": "invalid.illegal.key.sequence.sublimekeymap"
|
||||||
|
},
|
||||||
|
{ "match": "(shift|ctrl|alt|super)(\\+)",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "support.function.modifier.key.sublimekeymap" },
|
||||||
|
"2": { "name": "keyword.modifier.key.connector.sublimekeymap" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ "match": "f(?:[2-9]\\d+|\\d{3,})",
|
||||||
|
"name": "invalid.illegal.key.sublimekeymap"
|
||||||
|
},
|
||||||
|
{ "match": "\\b(?:up|down|right|left|insert|home|end|pageup|pagedown|backspace|delete|tab|enter|pause|escape|space|keypad[0-9]|keypad_(?:period|divide|multiply|minus|plus|enter)|clear|sysreq|break|context_menu|browser_(?:back|forward|refresh|stop|search|favorites|home)|forward_slash|backquote|plus|equals|minus|f(20|1[0-9]|[1-9]))\\b",
|
||||||
|
"name": "entity.other.attribute-name.key.named.sublimekeymap"
|
||||||
|
},
|
||||||
|
{ "match": "[A-Za-z0-9,;.:_=+-]{2,}",
|
||||||
|
"name": "invalid.illegal.key.sublimekeymap"
|
||||||
|
},
|
||||||
|
{ "name": "keyword.control.other.sublimekeymap",
|
||||||
|
"match": "<(character)>",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "entity.other.attribute-name.key.captured.sublimekeymap" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ "match": ".{1}",
|
||||||
|
"comment": "XXX What's invalid for key names?",
|
||||||
|
"name": "string.key.literal.sublimekeymap"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"contentName": "meta.key.sequence.sublimekeymap"
|
||||||
|
},
|
||||||
|
{ "name": "invalid.illegal.key.sequence.sublimekeymap",
|
||||||
|
"match": "[^\\s,]"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"mainKeys": {
|
||||||
|
"match": "\"(command|args|context|key)\":",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "keyword.other.sublimekeymap" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"supportKeys": {
|
||||||
|
"match": "\"([A-z]+?)\":",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "support.function.sublimekeymap" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"string": {
|
||||||
|
"begin" : "\"",
|
||||||
|
"end": "(?<!\\\\)\"",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "source.sublimesnippetraw" }
|
||||||
|
],
|
||||||
|
"contentName": "string.double.quote.sublimekeymap"
|
||||||
|
},
|
||||||
|
"lineComment": {
|
||||||
|
"match": "//.*?$",
|
||||||
|
"name": "comment.single.line.sublimekeymap"
|
||||||
|
},
|
||||||
|
"multiLineComment": {
|
||||||
|
"begin": "/\\*",
|
||||||
|
"end": "\\*/",
|
||||||
|
"name": "comment.single.line.sublimekeymap"
|
||||||
|
},
|
||||||
|
"numericPrimitives": {
|
||||||
|
"patterns": [
|
||||||
|
{ "name": "constant.numeric.boolean.sublimekeymap",
|
||||||
|
"match": "\\b(?:true|false)\\b"
|
||||||
|
},
|
||||||
|
{ "name": "constant.numeric.sublimekeymap",
|
||||||
|
"match": "\\d+(?:\\.\\d+)?"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid": "f56e1baa-51fc-4791-a9d9-21301f2e3a01"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"extensions": ["sublime-keymap"]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,259 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>fileTypes</key>
|
||||||
|
<array>
|
||||||
|
<string>sublime-keymap</string>
|
||||||
|
</array>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Sublime Text Key Map</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#multiLineComment</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#lineComment</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>(^\[$)</string>
|
||||||
|
<key>contentName</key>
|
||||||
|
<string>meta.keybinding.collection.sublimekeymap</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>(^\]$)</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#multiLineComment</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#lineComment</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#keys</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#mainKeys</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#supportKeys</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#string</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#numericPrimitives</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>repository</key>
|
||||||
|
<dict>
|
||||||
|
<key>keys</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"(keys)": \[</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.sublimekeymap</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>end</key>
|
||||||
|
<string>\],</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>(")</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.keybinding.definition.key.sequence.start.sublimekeymap</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>contentName</key>
|
||||||
|
<string>meta.key.sequence.sublimekeymap</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>(?<!\\)(")</string>
|
||||||
|
<key>endCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.keybinding.definition.key.sequence.end.sublime.sublimekeymap</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(?<!shift|ctrl|alt|super|\+)\+</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>invalid.illegal.key.sequence.sublimekeymap</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.modifier.key.sublimekeymap</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.modifier.key.connector.sublimekeymap</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(shift|ctrl|alt|super)(\+)</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>f(?:[2-9]\d+|\d{3,})</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>invalid.illegal.key.sublimekeymap</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\b(?:up|down|right|left|insert|home|end|pageup|pagedown|backspace|delete|tab|enter|pause|escape|space|keypad[0-9]|keypad_(?:period|divide|multiply|minus|plus|enter)|clear|sysreq|break|context_menu|browser_(?:back|forward|refresh|stop|search|favorites|home)|forward_slash|backquote|plus|equals|minus|f(20|1[0-9]|[1-9]))\b</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>entity.other.attribute-name.key.named.sublimekeymap</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>[A-Za-z0-9,;.:_=+-]{2,}</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>invalid.illegal.key.sublimekeymap</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>entity.other.attribute-name.key.captured.sublimekeymap</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string><(character)></string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.control.other.sublimekeymap</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>comment</key>
|
||||||
|
<string>XXX What's invalid for key names?</string>
|
||||||
|
<key>match</key>
|
||||||
|
<string>.{1}</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.key.literal.sublimekeymap</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>[^\s,]</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>invalid.illegal.key.sequence.sublimekeymap</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>lineComment</key>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>//.*?$</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>comment.single.line.sublimekeymap</string>
|
||||||
|
</dict>
|
||||||
|
<key>mainKeys</key>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.sublimekeymap</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"(command|args|context|key)":</string>
|
||||||
|
</dict>
|
||||||
|
<key>multiLineComment</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>/\*</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>\*/</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>comment.single.line.sublimekeymap</string>
|
||||||
|
</dict>
|
||||||
|
<key>numericPrimitives</key>
|
||||||
|
<dict>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\b(?:true|false)\b</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.numeric.boolean.sublimekeymap</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\d+(?:\.\d+)?</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.numeric.sublimekeymap</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>string</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"</string>
|
||||||
|
<key>contentName</key>
|
||||||
|
<string>string.double.quote.sublimekeymap</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>(?<!\\)"</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>source.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>supportKeys</key>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.sublimekeymap</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"([A-z]+?)":</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>scopeName</key>
|
||||||
|
<string>source.sublimekeymap</string>
|
||||||
|
<key>uuid</key>
|
||||||
|
<string>f56e1baa-51fc-4791-a9d9-21301f2e3a01</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
{ "name": "Sublime Text Macro",
|
||||||
|
|
||||||
|
"scopeName": "source.sublimemacro",
|
||||||
|
|
||||||
|
"fileTypes": ["sublime-macro"],
|
||||||
|
|
||||||
|
"patterns": [
|
||||||
|
{ "begin": "(\\[)",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "punctuation.definition.collection.start.sublimemacro" }
|
||||||
|
},
|
||||||
|
"end": "(\\])",
|
||||||
|
"endCaptures": {
|
||||||
|
"1": { "name": "punctuation.definition.collection.end.sublimemacro" }
|
||||||
|
},
|
||||||
|
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "#command" },
|
||||||
|
{ "include": "#args" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
"repository": {
|
||||||
|
|
||||||
|
"args": {
|
||||||
|
"begin": "\"(args)\"\\s*:",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "keyword.other.sublimemacro"}
|
||||||
|
},
|
||||||
|
"end": "(?<=\\})",
|
||||||
|
"name": "meta.definition.attached.command.arguments.sublimemacro",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "source.jsongenericarray"
|
||||||
|
},
|
||||||
|
{ "match": "\"([a-zA-Z0-9_]+)\"\\s*:",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "support.function.array.generic.key.sublimemacro" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ "include": "source.jsongenericarrayelements"
|
||||||
|
},
|
||||||
|
{ "match": "true|false|\\d+",
|
||||||
|
"name": "constant.numeric.sublimemacro"
|
||||||
|
},
|
||||||
|
|
||||||
|
{ "match": "\\{",
|
||||||
|
"name": "punctuation.definition.array.keybinding.key.sequence"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
"command": {
|
||||||
|
"begin": "\\{",
|
||||||
|
"end": "\\}",
|
||||||
|
"patterns": [
|
||||||
|
{ "match": "\"(command)\":\\s*\"([^\"]+)\"",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "keyword.other.sublimemacro" },
|
||||||
|
"2": { "name": "string.attached.command.name.sublimemacro" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ "include": "#args" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"uuid": "f56e1baa-51fc-4791-a9d9-21301f2e3a01"
|
||||||
|
}
|
||||||
138
sublime/Packages/AAAPackageDev/Support/Sublime Macros.tmLanguage
Normal file
138
sublime/Packages/AAAPackageDev/Support/Sublime Macros.tmLanguage
Normal file
|
|
@ -0,0 +1,138 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>fileTypes</key>
|
||||||
|
<array>
|
||||||
|
<string>sublime-macro</string>
|
||||||
|
</array>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Sublime Text Macro</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>(\[)</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.collection.start.sublimecommands</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>end</key>
|
||||||
|
<string>(\])</string>
|
||||||
|
<key>endCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.collection.end.sublimecommands</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#command</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#args</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>repository</key>
|
||||||
|
<dict>
|
||||||
|
<key>args</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"(args)"\s*:</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.sublimecommands</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>end</key>
|
||||||
|
<string>(?<=\})</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.definition.attached.command.arguments.sublimecommands</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>source.jsongenericarray</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.array.generic.key.sublimecommands</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"([a-zA-Z0-9_]+)"\s*:</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>source.jsongenericarrayelements</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>true|false|\d+</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.numeric.sublimecommands</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\{</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.array.keybinding.key.sequence</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>command</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>\{</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>\}</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.sublimecommands</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.attached.command.name.sublimecommands</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"(command)":\s*"([^"]+)"</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#args</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>scopeName</key>
|
||||||
|
<string>source.sublimemacro</string>
|
||||||
|
<key>uuid</key>
|
||||||
|
<string>f56e1baa-51fc-4791-a9d9-21301f2e3a01</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
{ "name": "Sublime Settings",
|
||||||
|
"scopeName": "source.sublime-settings",
|
||||||
|
"fileTypes": ["sublime-settings"],
|
||||||
|
"patterns": [
|
||||||
|
{ "name": "comment.single.line.sublime-settings",
|
||||||
|
"match": "//.*"
|
||||||
|
},
|
||||||
|
{ "name": "comment.block.sublime-settings",
|
||||||
|
"begin": "/\\*",
|
||||||
|
"end": "\\*/"
|
||||||
|
},
|
||||||
|
{ "match": "\"([a-z0-9_.-]+)\"\\s*?:",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "keyword.other.name.sublime-settings" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{ "include": "source.jsongenericarray" },
|
||||||
|
{ "include": "source.jsongenericarrayelements" }
|
||||||
|
],
|
||||||
|
"uuid": "dd6dce14-1f27-4128-9c85-7e30c137ae30"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"extensions": ["sublime-settings"]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>fileTypes</key>
|
||||||
|
<array>
|
||||||
|
<string>sublime-settings</string>
|
||||||
|
</array>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Sublime Settings</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>//.*</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>comment.single.line.sublime-settings</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>/\*</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>\*/</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>comment.block.sublime-settings</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.name.sublime-settings</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"([a-z0-9_.-]+)"\s*?:</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>source.jsongenericarray</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>source.jsongenericarrayelements</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>scopeName</key>
|
||||||
|
<string>source.sublime-settings</string>
|
||||||
|
<key>uuid</key>
|
||||||
|
<string>dd6dce14-1f27-4128-9c85-7e30c137ae30</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
@ -0,0 +1,79 @@
|
||||||
|
{
|
||||||
|
"name": "Sublime Text Snippet (Raw)",
|
||||||
|
"scopeName": "source.sublimesnippetraw",
|
||||||
|
|
||||||
|
"patterns": [
|
||||||
|
{ "name": "entity.other.attribute-name.environment.sublimesnippetraw",
|
||||||
|
"match": "(\\$)(PARAM(\\d)|TM_SELECTED_TEXT|USER_NAME|SELECTION)",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "keyword.other.sublimesnippetraw" },
|
||||||
|
"2": { "name": "variable.storage.name.sublimesnippetraw" },
|
||||||
|
"3": { "name": "support.constant.numeric.sublimesnippetraw" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{ "name": "variable.field.numbered.sublimesnippetraw",
|
||||||
|
"match": "(\\$)(\\d+)",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "keyword.other.sublimesnippetraw" },
|
||||||
|
"2": { "name": "support.constant.numeric.name.sublimesnippetraw" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{ "name": "meta.definition.substitution.sublimesnippetraw",
|
||||||
|
"begin": "(\\$)\\{(\\d+)(?=\/)",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "keyword.other.sublimesnippetraw" },
|
||||||
|
"2": { "name": "support.constant.numeric.sublimesnippetraw" }
|
||||||
|
},
|
||||||
|
"end": "\\}",
|
||||||
|
"patterns": [
|
||||||
|
{ "match": "(?<!\\\\)(\/)",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "punctuation.definition.substitution.sublimesnippetraw" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ "include": "source.regexp" },
|
||||||
|
{ "name": "string.sublimesnippetraw",
|
||||||
|
"match": "."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
{ "name": "variable.field.sublimesnippetraw",
|
||||||
|
"match": "(\\$)(?:(packages)|([a-zA-Z0-9_]+))",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "keyword.other.sublimesnippetraw" },
|
||||||
|
"2": { "name": "entity.other.attribute-name.variable.storage.known.name.sublimesnippetraw" },
|
||||||
|
"3": { "name": "variable.storage.name.sublimesnippetraw" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{ "name": "meta.definition.variable.complex.sublimesnippetraw",
|
||||||
|
"begin": "(\\$)\\{",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "keyword.other.sublimesnippetraw" }
|
||||||
|
},
|
||||||
|
"end": "(\\})",
|
||||||
|
"endCaptures": {
|
||||||
|
"1": { "name": "meta.definition.variable.complex.sublimesnippetraw" }
|
||||||
|
},
|
||||||
|
"patterns": [
|
||||||
|
{ "match": "(?<=\\{)(\\d+)(?>:)",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "support.constant.numeric.sublimesnippetraw" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ "name": "entity.other.attribute-name.variable.storage.known.name.sublimesnippetraw",
|
||||||
|
"match": "\\b(packages)\\b"
|
||||||
|
},
|
||||||
|
{ "include": "$self" },
|
||||||
|
{ "name": "string.sublimesnippetraw",
|
||||||
|
"match": "."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
"uuid": "9c9f9b3c-0e97-4423-a995-14d6412613d3"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,183 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Sublime Text Snippet (Raw)</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>variable.storage.name.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
<key>3</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.constant.numeric.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(\$)(PARAM(\d)|TM_SELECTED_TEXT|USER_NAME|SELECTION)</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>entity.other.attribute-name.environment.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.constant.numeric.name.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(\$)(\d+)</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>variable.field.numbered.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>(\$)\{(\d+)(?=/)</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.constant.numeric.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>end</key>
|
||||||
|
<string>\}</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.definition.substitution.sublimesnippetraw</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.substitution.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(?<!\\)(/)</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>source.regexp</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>.</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>entity.other.attribute-name.variable.storage.known.name.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
<key>3</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>variable.storage.name.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(\$)(?:(packages)|([a-zA-Z0-9_]+))</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>variable.field.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>(\$)\{</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>end</key>
|
||||||
|
<string>(\})</string>
|
||||||
|
<key>endCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.definition.variable.complex.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.definition.variable.complex.sublimesnippetraw</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.constant.numeric.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(?<=\{)(\d+)(?>:)</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\b(packages)\b</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>entity.other.attribute-name.variable.storage.known.name.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>$self</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>.</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.sublimesnippetraw</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>scopeName</key>
|
||||||
|
<string>source.sublimesnippetraw</string>
|
||||||
|
<key>uuid</key>
|
||||||
|
<string>9c9f9b3c-0e97-4423-a995-14d6412613d3</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
@ -0,0 +1,197 @@
|
||||||
|
{ "name": "Sublime Text Build System",
|
||||||
|
"scopeName": "source.sublimebuild",
|
||||||
|
"fileTypes": ["sublime-build"],
|
||||||
|
"patterns": [
|
||||||
|
{ "begin": "(\\{)",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "punctuation.definition.options.start.sublimebuild" }
|
||||||
|
},
|
||||||
|
"end": "(\\})",
|
||||||
|
"endCaptures": {
|
||||||
|
"1": { "name": "punctuation.definition.options.end.sublimebuild" }
|
||||||
|
},
|
||||||
|
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "#cmd" },
|
||||||
|
{ "include": "#env" },
|
||||||
|
{ "include": "#simpleOptions" },
|
||||||
|
{ "include": "#errorRegex" },
|
||||||
|
{ "include": "#encoding" },
|
||||||
|
{ "include": "#path" },
|
||||||
|
{ "include": "#shell" },
|
||||||
|
{ "include": "#variant" },
|
||||||
|
{ "include": "source.jsongenericobject" },
|
||||||
|
{ "match": "(?<!\\}|\"|\\]),",
|
||||||
|
"name": "invalid.illegal.separator.sublimebuild"
|
||||||
|
},
|
||||||
|
{ "match": ",{2,}",
|
||||||
|
"name": "invalid.illegal.character.sublimebuild"
|
||||||
|
},
|
||||||
|
{ "match": "[^,\\t\\s]",
|
||||||
|
"name": "invalid.illegal.character.sublimebuild"
|
||||||
|
},
|
||||||
|
{ "name": "invalid.illegal.separator.sublimebuild",
|
||||||
|
"match": ",(?>$\\s+\\])",
|
||||||
|
"comment": "XXX"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"contentName": "meta.options.sublimebuild"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"cmd": {
|
||||||
|
"begin": "\"(cmd)\"\\s*:",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "keyword.other.sublimebuild"}
|
||||||
|
},
|
||||||
|
"end": "(?<=\\])",
|
||||||
|
"name": "meta.definition.command.sublimebuild",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "source.jsongenericarray"
|
||||||
|
},
|
||||||
|
{ "match": "\"([a-zA-Z0-9_]+)\"\\s*:",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "support.function.array.generic.key.sublimebuild" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"match": "\"(name)\"\\s*:\\s*\"(.+?)\"",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "keyword.other.sublimebuild" },
|
||||||
|
"2": { "name": "string.quoted.double.sublimebuild" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"variant": {
|
||||||
|
"begin": "\"(variant)\"\\s*:",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "keyword.other.sublimebuild" }
|
||||||
|
},
|
||||||
|
"end": "(?<=\\})",
|
||||||
|
"name": "meta.definition.variant.sublimebuild",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "#cmd" },
|
||||||
|
{ "include": "#env" },
|
||||||
|
{ "include": "#path" },
|
||||||
|
{ "include": "#name" },
|
||||||
|
{ "match": "{" },
|
||||||
|
{ "include": "source.jsongenericobject" },
|
||||||
|
{ "match": "}" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"env": {
|
||||||
|
"begin": "\"(env)\"\\s*:",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "keyword.other.sublimebuild"}
|
||||||
|
},
|
||||||
|
"end": "(?<=\\})",
|
||||||
|
"name": "meta.definition.environment.block.sublimebuild",
|
||||||
|
"patterns": [
|
||||||
|
{ "match": "\"([a-zA-Z0-9_]+)\"\\s*:",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "string.variable.name.sublimebuild" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ "include": "#envVarString"
|
||||||
|
},
|
||||||
|
{ "match": "\\{"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"begin": "\"(path)\"\\s*:",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "keyword.other.path.sublimebuild"},
|
||||||
|
"2": { "name": "punctuation.definition.path.start.sublimebuild" }
|
||||||
|
},
|
||||||
|
"end": "(?<=\")",
|
||||||
|
"endCaptures": {
|
||||||
|
"1": { "name": "punctuation.definition.path.end.untitled" }
|
||||||
|
},
|
||||||
|
"name": "meta.definition.path.variable.sublimebuild",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "#envVarString" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"shell": {
|
||||||
|
"match": "\"(shell)\":\\s*(true|false)",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "keyword.other.shell.sublimebuild" },
|
||||||
|
"2": { "name": "constant.numeric.boolean.sublimebuild" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"simpleOptions": {
|
||||||
|
"match": "\"(working_dir|selector|target)\":\\s*\"(.*?)\"",
|
||||||
|
"comment": "Maybe make this a begin-end: paths must contain characters; cling to that.",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "keyword.other.sublimebuild" },
|
||||||
|
"2": { "name": "string.sublimebuild" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"encoding": {
|
||||||
|
"match": "\"(encoding)\":\\s*\"(.*?)\"",
|
||||||
|
"comment": "No exhaustive list of encodings for Python exist, so we cannot restrict this.",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "keyword.other.encoding.sublimebuild" },
|
||||||
|
"2": { "name": "string.sublimebuild" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"errorRegex": {
|
||||||
|
"begin": "\"(file_regex|line_regex)\"\\s*:\\s*(\")",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": { "name": "keyword.other.error.regex.sublimebuild"},
|
||||||
|
"2": { "name": "punctuation.definition.regex.start.sublimebuild" }
|
||||||
|
},
|
||||||
|
"end": "(?<!\\\\)\"",
|
||||||
|
"name": "meta.definition.error.data.sublimebuild",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "source.escapedregexp" },
|
||||||
|
{ "match": "\"",
|
||||||
|
"name": "punctuation.definition.regex.end.sublimebuild"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
"envVarString": {
|
||||||
|
"begin":"\"",
|
||||||
|
"end": "\"",
|
||||||
|
"patterns": [
|
||||||
|
{ "match": "(\\\\(?:\"|t|n|r))",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "constant.character.escape.sublimebuild" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ "name": "meta.environment.variable.sublimebuild",
|
||||||
|
"match": "(%)(.*?)(%)",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "support.function.sublimebuild" },
|
||||||
|
"2": { "name": "entity.other.attribute-name.sublimebuild" },
|
||||||
|
"3": { "name": "support.function.sublimebuild" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ "name": "meta.environment.variable.sublimebuild",
|
||||||
|
"match": "(\\$)([A-Z]+)",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "support.function.sublimebuild" },
|
||||||
|
"2": { "name": "entity.other.attribute-name.sublimebuild" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ "name": "meta.environment.variable.sublimebuild",
|
||||||
|
"match": "(\\$){(.*?)}",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "support.function.sublimebuild" },
|
||||||
|
"2": { "name": "entity.other.attribute-name.sublimebuild" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ "name": "keyword.other.path.separator.sublimebuild",
|
||||||
|
"match": ";|:(?!\\\\)"
|
||||||
|
},
|
||||||
|
{ "match": ".",
|
||||||
|
"name": "string.sublimebuild"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid": "855d82a3-8501-467f-ba88-4bf91e02ea6d"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"extensions": ["sublime-build"]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,479 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>fileTypes</key>
|
||||||
|
<array>
|
||||||
|
<string>sublime-build</string>
|
||||||
|
</array>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Sublime Text Build System</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>(\{)</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.options.start.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>contentName</key>
|
||||||
|
<string>meta.options.sublimebuild</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>(\})</string>
|
||||||
|
<key>endCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.options.end.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#cmd</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#env</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#simpleOptions</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#errorRegex</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#encoding</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#path</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#shell</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#variant</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>source.jsongenericobject</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(?<!\}|"|\]),</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>invalid.illegal.separator.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>,{2,}</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>invalid.illegal.character.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>[^,\t\s]</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>invalid.illegal.character.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>comment</key>
|
||||||
|
<string>XXX</string>
|
||||||
|
<key>match</key>
|
||||||
|
<string>,(?>$\s+\])</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>invalid.illegal.separator.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>repository</key>
|
||||||
|
<dict>
|
||||||
|
<key>cmd</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"(cmd)"\s*:</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>end</key>
|
||||||
|
<string>(?<=\])</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.definition.command.sublimebuild</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>source.jsongenericarray</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.array.generic.key.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"([a-zA-Z0-9_]+)"\s*:</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>encoding</key>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.encoding.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>comment</key>
|
||||||
|
<string>No exhaustive list of encodings for Python exist, so we cannot restrict this.</string>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"(encoding)":\s*"(.*?)"</string>
|
||||||
|
</dict>
|
||||||
|
<key>env</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"(env)"\s*:</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>end</key>
|
||||||
|
<string>(?<=\})</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.definition.environment.block.sublimebuild</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.variable.name.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"([a-zA-Z0-9_]+)"\s*:</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#envVarString</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\{</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>envVarString</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>"</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.character.escape.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(\\(?:"|t|n|r))</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>entity.other.attribute-name.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
<key>3</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(%)(.*?)(%)</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.environment.variable.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>entity.other.attribute-name.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(\$)([A-Z]+)</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.environment.variable.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>entity.other.attribute-name.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(\$){(.*?)}</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.environment.variable.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>;|:(?!\\)</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.path.separator.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>.</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>errorRegex</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"(file_regex|line_regex)"\s*:\s*(")</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.error.regex.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.regex.start.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>end</key>
|
||||||
|
<string>(?<!\\)"</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.definition.error.data.sublimebuild</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>source.escapedregexp</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.regex.end.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>name</key>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.quoted.double.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"(name)"\s*:\s*"(.+?)"</string>
|
||||||
|
</dict>
|
||||||
|
<key>path</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"(path)"\s*:</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.path.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.path.start.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>end</key>
|
||||||
|
<string>(?<=")</string>
|
||||||
|
<key>endCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.path.end.untitled</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.definition.path.variable.sublimebuild</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#envVarString</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>shell</key>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.shell.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.numeric.boolean.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"(shell)":\s*(true|false)</string>
|
||||||
|
</dict>
|
||||||
|
<key>simpleOptions</key>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>comment</key>
|
||||||
|
<string>Maybe make this a begin-end: paths must contain characters; cling to that.</string>
|
||||||
|
<key>match</key>
|
||||||
|
<string>"(working_dir|selector|target)":\s*"(.*?)"</string>
|
||||||
|
</dict>
|
||||||
|
<key>variant</key>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"(variant)"\s*:</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.other.sublimebuild</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>end</key>
|
||||||
|
<string>(?<=\})</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.definition.variant.sublimebuild</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#cmd</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#env</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#path</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>#name</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>{</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>include</key>
|
||||||
|
<string>source.jsongenericobject</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>}</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>scopeName</key>
|
||||||
|
<string>source.sublimebuild</string>
|
||||||
|
<key>uuid</key>
|
||||||
|
<string>855d82a3-8501-467f-ba88-4bf91e02ea6d</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
11
sublime/Packages/AAAPackageDev/bin/CleanUp.ps1
Normal file
11
sublime/Packages/AAAPackageDev/bin/CleanUp.ps1
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
$here = $MyInvocation.MyCommand.Definition
|
||||||
|
$here = split-path $here -parent
|
||||||
|
$root = resolve-path (join-path $here "..")
|
||||||
|
|
||||||
|
push-location $root
|
||||||
|
# remove-item cmdlet doesn't work well!
|
||||||
|
get-childitem "." -recurse -filter "*.pyc" | remove-item
|
||||||
|
remove-item "dist" -recurse -force
|
||||||
|
remove-item "Doc" -recurse
|
||||||
|
remove-item "MANIFEST"
|
||||||
|
pop-location
|
||||||
33
sublime/Packages/AAAPackageDev/bin/MakeRelease.ps1
Normal file
33
sublime/Packages/AAAPackageDev/bin/MakeRelease.ps1
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
param([switch]$DontUpload=$False)
|
||||||
|
|
||||||
|
$here = $MyInvocation.MyCommand.Definition
|
||||||
|
$here = split-path $here -parent
|
||||||
|
$root = resolve-path (join-path $here "..")
|
||||||
|
|
||||||
|
push-location $root
|
||||||
|
if (-not (test-path (join-path $root "Doc"))) {
|
||||||
|
new-item -itemtype "d" -name "Doc" > $null
|
||||||
|
copy-item ".\Data\main.css" ".\Doc"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Generate docs in html from rst.
|
||||||
|
push-location ".\Doc"
|
||||||
|
get-childitem "..\*.rst" | foreach-object {
|
||||||
|
& "rst2html.py" `
|
||||||
|
"--template" "..\data\html_template.txt" `
|
||||||
|
"--stylesheet-path" "main.css" `
|
||||||
|
"--link-stylesheet" `
|
||||||
|
$_.fullname "$($_.basename).html"
|
||||||
|
}
|
||||||
|
pop-location
|
||||||
|
|
||||||
|
# Ensure MANIFEST reflects all changes to file system.
|
||||||
|
remove-item ".\MANIFEST" -erroraction silentlycontinue
|
||||||
|
& "python" ".\setup.py" "spa"
|
||||||
|
|
||||||
|
(get-item ".\dist\AAAPackageDev.sublime-package").fullname | clip.exe
|
||||||
|
pop-location
|
||||||
|
|
||||||
|
if (-not $DontUpload) {
|
||||||
|
start-process "https://bitbucket.org/guillermooo/aaapackagedev/downloads"
|
||||||
|
}
|
||||||
18
sublime/Packages/AAAPackageDev/build_sys_dev.py
Normal file
18
sublime/Packages/AAAPackageDev/build_sys_dev.py
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
import sublime_plugin
|
||||||
|
|
||||||
|
from sublime_lib.path import root_at_packages
|
||||||
|
|
||||||
|
|
||||||
|
BUILD_SYSTEM_SYNTAX = 'Packages/AAAPackageDev/Support/Sublime Text Build System.tmLanguage'
|
||||||
|
|
||||||
|
|
||||||
|
# Adding "2" to avoid name clash with shipped command.
|
||||||
|
class NewBuildSystem2Command(sublime_plugin.WindowCommand):
|
||||||
|
def run(self):
|
||||||
|
v = self.window.new_file()
|
||||||
|
v.settings().set('default_dir', root_at_packages('User'))
|
||||||
|
v.set_syntax_file(BUILD_SYSTEM_SYNTAX)
|
||||||
|
v.set_name('untitled.sublime-build')
|
||||||
|
|
||||||
|
template = """{\n\t"cmd": ["${0:make}"]\n}"""
|
||||||
|
v.run_command("insert_snippet", {"contents": template})
|
||||||
20
sublime/Packages/AAAPackageDev/commands_file_dev.py
Normal file
20
sublime/Packages/AAAPackageDev/commands_file_dev.py
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
import sublime_plugin
|
||||||
|
|
||||||
|
from sublime_lib import path
|
||||||
|
|
||||||
|
|
||||||
|
tpl = """[
|
||||||
|
{ "caption": "${1:My Caption for the Comand Palette}", "command": "${2:my_command}" }$0
|
||||||
|
]"""
|
||||||
|
|
||||||
|
SYNTAX_DEF = 'Packages/AAAPackageDev/Support/Sublime Commands.tmLanguage'
|
||||||
|
|
||||||
|
|
||||||
|
class NewCommandsFileCommand(sublime_plugin.WindowCommand):
|
||||||
|
def run(self):
|
||||||
|
v = self.window.new_file()
|
||||||
|
v.run_command('insert_snippet', {'contents': tpl})
|
||||||
|
v.settings().set('default_dir', path.root_at_packages('User'))
|
||||||
|
v.set_syntax_file(SYNTAX_DEF)
|
||||||
|
|
||||||
|
|
||||||
21
sublime/Packages/AAAPackageDev/completions_dev.py
Normal file
21
sublime/Packages/AAAPackageDev/completions_dev.py
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
import sublime, sublime_plugin
|
||||||
|
|
||||||
|
from sublime_lib.path import root_at_packages
|
||||||
|
|
||||||
|
|
||||||
|
COMPLETIONS_SYNTAX_DEF = "Packages/AAAPackageDev/Support/Sublime Completions.tmLanguage"
|
||||||
|
TPL = """{
|
||||||
|
"scope": "source.${1:off}",
|
||||||
|
|
||||||
|
"completions": [
|
||||||
|
{ "trigger": "${2:some_trigger}", "contents": "${3:Hint: Use f, ff and fff plus Tab inside here.}" }$0
|
||||||
|
]
|
||||||
|
}"""
|
||||||
|
|
||||||
|
|
||||||
|
class NewCompletionsCommand(sublime_plugin.WindowCommand):
|
||||||
|
def run(self):
|
||||||
|
v = self.window.new_file()
|
||||||
|
v.run_command('insert_snippet', {"contents": TPL})
|
||||||
|
v.settings().set('syntax', COMPLETIONS_SYNTAX_DEF)
|
||||||
|
v.settings().set('default_dir', root_at_packages('User'))
|
||||||
35
sublime/Packages/AAAPackageDev/data/README.rst
Normal file
35
sublime/Packages/AAAPackageDev/data/README.rst
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
================
|
||||||
|
%(package_name)s
|
||||||
|
================
|
||||||
|
|
||||||
|
<main description>
|
||||||
|
|
||||||
|
|
||||||
|
The Problem
|
||||||
|
===========
|
||||||
|
|
||||||
|
<problem this package tries to solve>
|
||||||
|
|
||||||
|
|
||||||
|
Getting Started
|
||||||
|
===============
|
||||||
|
|
||||||
|
- Install `%(package_name)s`_
|
||||||
|
|
||||||
|
.. _%(package_name)s: https://
|
||||||
|
|
||||||
|
If you're running a full installation of Sublime Text, simply doublelick on the
|
||||||
|
``.sublime-package`` file. If you're running a portable installation, you need
|
||||||
|
to perform an `installation by hand`_.
|
||||||
|
|
||||||
|
.. _installation by hand: http://sublimetext.info/docs/extensibility/packages.html#installation-of-packages-with-sublime-package-archives
|
||||||
|
|
||||||
|
Once installed, run the following command from the Python console (``Ctrl+```)::
|
||||||
|
|
||||||
|
view.run_command("COMMAND")
|
||||||
|
|
||||||
|
Alternatively, you can define a new key binding for this command.
|
||||||
|
|
||||||
|
How to Use
|
||||||
|
==========
|
||||||
|
|
||||||
9
sublime/Packages/AAAPackageDev/data/html_template.txt
Normal file
9
sublime/Packages/AAAPackageDev/data/html_template.txt
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
%(head_prefix)s
|
||||||
|
<link href='http://fonts.googleapis.com/css?family=Permanent+Marker' rel='stylesheet' type='text/css'>
|
||||||
|
%(head)s
|
||||||
|
%(stylesheet)s
|
||||||
|
%(body_prefix)s
|
||||||
|
%(body_pre_docinfo)s
|
||||||
|
%(docinfo)s
|
||||||
|
%(body)s
|
||||||
|
%(body_suffix)s
|
||||||
37
sublime/Packages/AAAPackageDev/data/main.css
Normal file
37
sublime/Packages/AAAPackageDev/data/main.css
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
body {
|
||||||
|
font-family: 'Calibri', 'Helvetica', 'Arial', sans-serif;
|
||||||
|
font-size: 14pt;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #F5F5F5;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.document {
|
||||||
|
width: 50%;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-family: 'Calibri', 'Helvetica', sans-serif;
|
||||||
|
font-size: 1.5em;
|
||||||
|
color: #546473;
|
||||||
|
word-spacing: -0.08em;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 1.25em;
|
||||||
|
color: #546473;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.pre {
|
||||||
|
font-family: 'Consolas', 'Monaco', 'Courier New', 'Courier';
|
||||||
|
background-color: #D1DCE6;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
tt.literal {
|
||||||
|
font-family: 'Consolas', 'Monaco', 'Courier New', 'Courier';
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
19
sublime/Packages/AAAPackageDev/manifest.in
Normal file
19
sublime/Packages/AAAPackageDev/manifest.in
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
global-include *.sublime-*
|
||||||
|
global-exclude *.sublime-project
|
||||||
|
global-exclude *.cache
|
||||||
|
|
||||||
|
global-exclude _*.txt
|
||||||
|
exclude html_template.txt
|
||||||
|
|
||||||
|
global-include *.py
|
||||||
|
exclude sublime_inspect.py
|
||||||
|
exclude setup.py
|
||||||
|
|
||||||
|
graft Support
|
||||||
|
graft Snippets
|
||||||
|
graft Doc
|
||||||
|
# recursive-include Lib *.py
|
||||||
|
|
||||||
|
prune PackageDev
|
||||||
|
prune dist
|
||||||
|
prune tests
|
||||||
1
sublime/Packages/AAAPackageDev/package-metadata.json
Normal file
1
sublime/Packages/AAAPackageDev/package-metadata.json
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{"url": "https://github.com/SublimeText/AAAPackageDev", "version": "2012.09.05.17.25.48", "description": "Tools to ease the creation of snippets, syntax definitions, etc. for Sublime Text."}
|
||||||
136
sublime/Packages/AAAPackageDev/package_dev.py
Normal file
136
sublime/Packages/AAAPackageDev/package_dev.py
Normal file
|
|
@ -0,0 +1,136 @@
|
||||||
|
import sublime
|
||||||
|
import sublime_plugin
|
||||||
|
|
||||||
|
import plistlib
|
||||||
|
import json
|
||||||
|
|
||||||
|
import glob
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
# Makes sublime_lib package available for all packages.
|
||||||
|
if not os.path.join(sublime.packages_path(), "AAAPackageDev/Lib") in sys.path:
|
||||||
|
sys.path.append(os.path.join(sublime.packages_path(), "AAAPackageDev/Lib"))
|
||||||
|
|
||||||
|
from sublime_lib.path import root_at_packages
|
||||||
|
|
||||||
|
|
||||||
|
DEBUG = 1
|
||||||
|
THIS_PACKAGE = "AAAPackageDev"
|
||||||
|
|
||||||
|
status = sublime.status_message
|
||||||
|
error = sublime.error_message
|
||||||
|
join_path = os.path.join
|
||||||
|
path_exists = os.path.exists
|
||||||
|
|
||||||
|
DEFAULT_DIRS = (
|
||||||
|
"Snippets",
|
||||||
|
"Support",
|
||||||
|
"Docs",
|
||||||
|
"Macros",
|
||||||
|
"bin",
|
||||||
|
"data"
|
||||||
|
)
|
||||||
|
|
||||||
|
# name, default template
|
||||||
|
DEFAULT_FILES = (
|
||||||
|
("LICENSE.txt", None),
|
||||||
|
("README.rst", root_at_packages(THIS_PACKAGE, "data/README.rst")),
|
||||||
|
(".hgignore", root_at_packages(THIS_PACKAGE, "data/hgignore.txt")),
|
||||||
|
(".gitignore", root_at_packages(THIS_PACKAGE, "data/gitignore.txt")),
|
||||||
|
("bin/MakeRelease.ps1", root_at_packages(THIS_PACKAGE, "data/MakeRelease.ps1")),
|
||||||
|
("bin/CleanUp.ps1", root_at_packages(THIS_PACKAGE, "data/CleanUp.ps1")),
|
||||||
|
("data/html_template.txt", root_at_packages(THIS_PACKAGE, "data/html_template.txt")),
|
||||||
|
("data/main.css", root_at_packages(THIS_PACKAGE, "data/main.css")),
|
||||||
|
("setup.py", root_at_packages(THIS_PACKAGE, "data/setup.py")),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class NewPackageCommand(sublime_plugin.WindowCommand):
|
||||||
|
|
||||||
|
def on_done(self, pkg_name):
|
||||||
|
pam = PackageManager()
|
||||||
|
if pam.exists(pkg_name):
|
||||||
|
error(" NewPackage -- Error\n\n"
|
||||||
|
" Package '" + pkg_name + "' already exists.\n"
|
||||||
|
" You cannot overwrite an existing package."
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
|
pam.create_new(pkg_name)
|
||||||
|
|
||||||
|
|
||||||
|
def on_cancel(self):
|
||||||
|
status('on_cancel')
|
||||||
|
|
||||||
|
def on_changed(self):
|
||||||
|
status('on_changed')
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
self.window.show_input_panel(
|
||||||
|
"New Package Name", '', self.on_done, None, None)
|
||||||
|
|
||||||
|
|
||||||
|
class DeletePackageCommand(sublime_plugin.WindowCommand):
|
||||||
|
def run(self):
|
||||||
|
pam = PackageManager()
|
||||||
|
pam.browse()
|
||||||
|
|
||||||
|
|
||||||
|
class PackageManager(object):
|
||||||
|
|
||||||
|
def is_installed(self, name):
|
||||||
|
raise NotImplemented
|
||||||
|
|
||||||
|
def exists(self, name):
|
||||||
|
return path_exists(root_at_packages(name))
|
||||||
|
|
||||||
|
def browse(self):
|
||||||
|
# Let user choose.
|
||||||
|
sublime.active_window().run_command("open_dir",
|
||||||
|
{"dir": sublime.packages_path()})
|
||||||
|
|
||||||
|
def create_new(self, name):
|
||||||
|
print "[NewPackage] Creating new package...",
|
||||||
|
print root_at_packages(name)
|
||||||
|
|
||||||
|
if self.dry_run:
|
||||||
|
msg = "[NewPackage] ** Nothing done. This was a test. **"
|
||||||
|
print msg
|
||||||
|
status(msg)
|
||||||
|
return
|
||||||
|
|
||||||
|
# Create top folder, default folders, default files.
|
||||||
|
map(os.makedirs, [root_at_packages(name, d) for d in DEFAULT_DIRS])
|
||||||
|
|
||||||
|
for f, template in [(root_at_packages(name, fname), template)
|
||||||
|
for fname, template in DEFAULT_FILES]:
|
||||||
|
with open(f, 'w') as fh:
|
||||||
|
if template:
|
||||||
|
try:
|
||||||
|
content = "".join(open(template, 'r').readlines()) % \
|
||||||
|
{"package_name": name}
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
finally:
|
||||||
|
content = "".join(open(template, 'r').readlines())
|
||||||
|
|
||||||
|
fh.write(content)
|
||||||
|
|
||||||
|
msg = "[NewPackage] Created new package '%s'." % name
|
||||||
|
print msg
|
||||||
|
status(msg)
|
||||||
|
|
||||||
|
def __init__(self, dry_run=False):
|
||||||
|
self.dry_run = dry_run
|
||||||
|
|
||||||
|
|
||||||
|
class PlistToJson(sublime_plugin.TextCommand):
|
||||||
|
def is_enabled(self ):
|
||||||
|
return self.view.file_name().endswith('.tmLanguage')
|
||||||
|
|
||||||
|
def run(self, edit):
|
||||||
|
plist_data = plistlib.readPlist(self.view.file_name())
|
||||||
|
v = self.view.window().new_file()
|
||||||
|
v.insert(edit, 0, json.dumps(plist_data, indent=4))
|
||||||
|
v.set_syntax_file('Packages/AAAPackageDev/Support/Sublime JSON Syntax Definition.tmLanguage')
|
||||||
17
sublime/Packages/AAAPackageDev/settings_dev.py
Normal file
17
sublime/Packages/AAAPackageDev/settings_dev.py
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
import sublime, sublime_plugin
|
||||||
|
|
||||||
|
from sublime_lib.path import root_at_packages
|
||||||
|
|
||||||
|
|
||||||
|
SETTINGS_SYNTAX = 'Packages/AAAPackageDev/Support/Sublime Settings.tmLanguage'
|
||||||
|
|
||||||
|
|
||||||
|
TPL = """{$0}"""
|
||||||
|
|
||||||
|
|
||||||
|
class NewSettingsCommand(sublime_plugin.WindowCommand):
|
||||||
|
def run(self):
|
||||||
|
v = self.window.new_file()
|
||||||
|
v.settings().set('default_dir', root_at_packages('User'))
|
||||||
|
v.settings().set('syntax', SETTINGS_SYNTAX)
|
||||||
|
v.run_command('insert_snippet', {'contents': TPL})
|
||||||
589
sublime/Packages/AAAPackageDev/setup.py
Normal file
589
sublime/Packages/AAAPackageDev/setup.py
Normal file
|
|
@ -0,0 +1,589 @@
|
||||||
|
# encoding: utf-8
|
||||||
|
|
||||||
|
"""Commands to build and manage .sublime-package archives with distutils."""
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import os, string
|
||||||
|
from types import *
|
||||||
|
from glob import glob
|
||||||
|
from distutils import log, dir_util, dep_util, file_util, archive_util
|
||||||
|
from distutils.core import Command
|
||||||
|
from distutils.core import setup
|
||||||
|
from distutils.text_file import TextFile
|
||||||
|
from distutils.filelist import FileList
|
||||||
|
from distutils.errors import *
|
||||||
|
from distutils.spawn import spawn
|
||||||
|
from distutils.dir_util import mkpath
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
|
def make_zipfile (base_name, base_dir, verbose=0, dry_run=0):
|
||||||
|
"""Create a zip file from all the files under 'base_dir'. The output
|
||||||
|
zip file will be named 'base_dir' + ".zip". Uses either the "zipfile"
|
||||||
|
Python module (if available) or the InfoZIP "zip" utility (if installed
|
||||||
|
and found on the default search path). If neither tool is available,
|
||||||
|
raises DistutilsExecError. Returns the name of the output zip file.
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
import zipfile
|
||||||
|
except ImportError:
|
||||||
|
zipfile = None
|
||||||
|
|
||||||
|
zip_filename = base_name + ".sublime-package"
|
||||||
|
mkpath(os.path.dirname(zip_filename), dry_run=dry_run)
|
||||||
|
|
||||||
|
# If zipfile module is not available, try spawning an external
|
||||||
|
# 'zip' command.
|
||||||
|
if zipfile is None:
|
||||||
|
if verbose:
|
||||||
|
zipoptions = "-r"
|
||||||
|
else:
|
||||||
|
zipoptions = "-rq"
|
||||||
|
|
||||||
|
try:
|
||||||
|
spawn(["zip", zipoptions, zip_filename, base_dir],
|
||||||
|
dry_run=dry_run)
|
||||||
|
except DistutilsExecError:
|
||||||
|
# XXX really should distinguish between "couldn't find
|
||||||
|
# external 'zip' command" and "zip failed".
|
||||||
|
raise DistutilsExecError, \
|
||||||
|
("unable to create zip file '%s': "
|
||||||
|
"could neither import the 'zipfile' module nor "
|
||||||
|
"find a standalone zip utility") % zip_filename
|
||||||
|
|
||||||
|
else:
|
||||||
|
log.info("creating '%s' and adding '%s' to it",
|
||||||
|
zip_filename, base_dir)
|
||||||
|
|
||||||
|
if not dry_run:
|
||||||
|
z = zipfile.ZipFile(zip_filename, "w",
|
||||||
|
compression=zipfile.ZIP_DEFLATED)
|
||||||
|
|
||||||
|
for dirpath, dirnames, filenames in os.walk(base_dir):
|
||||||
|
for name in filenames:
|
||||||
|
path = os.path.normpath(os.path.join(dirpath, name))
|
||||||
|
arcname = path[len(base_dir):]
|
||||||
|
# if dirpath == base_dir:
|
||||||
|
# arcname = name
|
||||||
|
# else:
|
||||||
|
# arcname = path[len(base_dir):]
|
||||||
|
# print arcname
|
||||||
|
if os.path.isfile(path):
|
||||||
|
z.write(path, arcname)
|
||||||
|
log.info("adding '%s'" % path)
|
||||||
|
z.close()
|
||||||
|
|
||||||
|
return zip_filename
|
||||||
|
|
||||||
|
|
||||||
|
def show_formats ():
|
||||||
|
"""Print all possible values for the 'formats' option (used by
|
||||||
|
the "--help-formats" command-line option).
|
||||||
|
"""
|
||||||
|
from distutils.fancy_getopt import FancyGetopt
|
||||||
|
from distutils.archive_util import ARCHIVE_FORMATS
|
||||||
|
formats=[]
|
||||||
|
for format in ARCHIVE_FORMATS.keys():
|
||||||
|
formats.append(("formats=" + format, None,
|
||||||
|
ARCHIVE_FORMATS[format][2]))
|
||||||
|
formats.sort()
|
||||||
|
pretty_printer = FancyGetopt(formats)
|
||||||
|
pretty_printer.print_help(
|
||||||
|
"List of available source distribution formats:")
|
||||||
|
|
||||||
|
class spa (Command):
|
||||||
|
|
||||||
|
description = "create a source distribution (tarball, zip file, etc.)"
|
||||||
|
|
||||||
|
user_options = [
|
||||||
|
('template=', 't',
|
||||||
|
"name of manifest template file [default: MANIFEST.in]"),
|
||||||
|
('manifest=', 'm',
|
||||||
|
"name of manifest file [default: MANIFEST]"),
|
||||||
|
('use-defaults', None,
|
||||||
|
"include the default file set in the manifest "
|
||||||
|
"[default; disable with --no-defaults]"),
|
||||||
|
('no-defaults', None,
|
||||||
|
"don't include the default file set"),
|
||||||
|
('prune', None,
|
||||||
|
"specifically exclude files/directories that should not be "
|
||||||
|
"distributed (build tree, RCS/CVS dirs, etc.) "
|
||||||
|
"[default; disable with --no-prune]"),
|
||||||
|
('no-prune', None,
|
||||||
|
"don't automatically exclude anything"),
|
||||||
|
('manifest-only', 'o',
|
||||||
|
"just regenerate the manifest and then stop "
|
||||||
|
"(implies --force-manifest)"),
|
||||||
|
('force-manifest', 'f',
|
||||||
|
"forcibly regenerate the manifest and carry on as usual"),
|
||||||
|
('formats=', None,
|
||||||
|
"formats for source distribution (comma-separated list)"),
|
||||||
|
('keep-temp', 'k',
|
||||||
|
"keep the distribution tree around after creating " +
|
||||||
|
"archive file(s)"),
|
||||||
|
('dist-dir=', 'd',
|
||||||
|
"directory to put the source distribution archive(s) in "
|
||||||
|
"[default: dist]"),
|
||||||
|
]
|
||||||
|
|
||||||
|
boolean_options = ['use-defaults', 'prune',
|
||||||
|
'manifest-only', 'force-manifest',
|
||||||
|
'keep-temp']
|
||||||
|
|
||||||
|
help_options = [
|
||||||
|
('help-formats', None,
|
||||||
|
"list available distribution formats", show_formats),
|
||||||
|
]
|
||||||
|
|
||||||
|
negative_opt = {'no-defaults': 'use-defaults',
|
||||||
|
'no-prune': 'prune' }
|
||||||
|
|
||||||
|
default_format = { 'posix': 'gztar',
|
||||||
|
'nt': 'zip' }
|
||||||
|
|
||||||
|
def initialize_options (self):
|
||||||
|
# 'template' and 'manifest' are, respectively, the names of
|
||||||
|
# the manifest template and manifest file.
|
||||||
|
self.template = None
|
||||||
|
self.manifest = None
|
||||||
|
|
||||||
|
# 'use_defaults': if true, we will include the default file set
|
||||||
|
# in the manifest
|
||||||
|
self.use_defaults = 1
|
||||||
|
self.prune = 1
|
||||||
|
|
||||||
|
self.manifest_only = 0
|
||||||
|
self.force_manifest = 0
|
||||||
|
|
||||||
|
self.formats = None
|
||||||
|
self.keep_temp = 0
|
||||||
|
self.dist_dir = None
|
||||||
|
|
||||||
|
self.archive_files = None
|
||||||
|
|
||||||
|
|
||||||
|
def finalize_options (self):
|
||||||
|
if self.manifest is None:
|
||||||
|
self.manifest = "MANIFEST"
|
||||||
|
if self.template is None:
|
||||||
|
self.template = "MANIFEST.in"
|
||||||
|
|
||||||
|
self.ensure_string_list('formats')
|
||||||
|
if self.formats is None:
|
||||||
|
try:
|
||||||
|
self.formats = [self.default_format[os.name]]
|
||||||
|
except KeyError:
|
||||||
|
raise DistutilsPlatformError, \
|
||||||
|
"don't know how to create source distributions " + \
|
||||||
|
"on platform %s" % os.name
|
||||||
|
|
||||||
|
bad_format = archive_util.check_archive_formats(self.formats)
|
||||||
|
if bad_format:
|
||||||
|
raise DistutilsOptionError, \
|
||||||
|
"unknown archive format '%s'" % bad_format
|
||||||
|
|
||||||
|
if self.dist_dir is None:
|
||||||
|
self.dist_dir = "dist"
|
||||||
|
|
||||||
|
|
||||||
|
def run (self):
|
||||||
|
|
||||||
|
# 'filelist' contains the list of files that will make up the
|
||||||
|
# manifest
|
||||||
|
self.filelist = FileList()
|
||||||
|
|
||||||
|
# Ensure that all required meta-data is given; warn if not (but
|
||||||
|
# don't die, it's not *that* serious!)
|
||||||
|
self.check_metadata()
|
||||||
|
|
||||||
|
# Do whatever it takes to get the list of files to process
|
||||||
|
# (process the manifest template, read an existing manifest,
|
||||||
|
# whatever). File list is accumulated in 'self.filelist'.
|
||||||
|
self.get_file_list()
|
||||||
|
|
||||||
|
# If user just wanted us to regenerate the manifest, stop now.
|
||||||
|
if self.manifest_only:
|
||||||
|
return
|
||||||
|
|
||||||
|
# Otherwise, go ahead and create the source distribution tarball,
|
||||||
|
# or zipfile, or whatever.
|
||||||
|
self.make_distribution()
|
||||||
|
|
||||||
|
|
||||||
|
def check_metadata (self):
|
||||||
|
"""Ensure that all required elements of meta-data (name, version,
|
||||||
|
URL, (author and author_email) or (maintainer and
|
||||||
|
maintainer_email)) are supplied by the Distribution object; warn if
|
||||||
|
any are missing.
|
||||||
|
"""
|
||||||
|
metadata = self.distribution.metadata
|
||||||
|
|
||||||
|
missing = []
|
||||||
|
for attr in ('name', 'version', 'url'):
|
||||||
|
if not (hasattr(metadata, attr) and getattr(metadata, attr)):
|
||||||
|
missing.append(attr)
|
||||||
|
|
||||||
|
if missing:
|
||||||
|
self.warn("missing required meta-data: " +
|
||||||
|
string.join(missing, ", "))
|
||||||
|
|
||||||
|
if metadata.author:
|
||||||
|
if not metadata.author_email:
|
||||||
|
self.warn("missing meta-data: if 'author' supplied, " +
|
||||||
|
"'author_email' must be supplied too")
|
||||||
|
elif metadata.maintainer:
|
||||||
|
if not metadata.maintainer_email:
|
||||||
|
self.warn("missing meta-data: if 'maintainer' supplied, " +
|
||||||
|
"'maintainer_email' must be supplied too")
|
||||||
|
else:
|
||||||
|
self.warn("missing meta-data: either (author and author_email) " +
|
||||||
|
"or (maintainer and maintainer_email) " +
|
||||||
|
"must be supplied")
|
||||||
|
|
||||||
|
# check_metadata ()
|
||||||
|
|
||||||
|
|
||||||
|
def get_file_list (self):
|
||||||
|
"""Figure out the list of files to include in the source
|
||||||
|
distribution, and put it in 'self.filelist'. This might involve
|
||||||
|
reading the manifest template (and writing the manifest), or just
|
||||||
|
reading the manifest, or just using the default file set -- it all
|
||||||
|
depends on the user's options and the state of the filesystem.
|
||||||
|
"""
|
||||||
|
|
||||||
|
# If we have a manifest template, see if it's newer than the
|
||||||
|
# manifest; if so, we'll regenerate the manifest.
|
||||||
|
template_exists = os.path.isfile(self.template)
|
||||||
|
if template_exists:
|
||||||
|
template_newer = dep_util.newer(self.template, self.manifest)
|
||||||
|
|
||||||
|
# The contents of the manifest file almost certainly depend on the
|
||||||
|
# setup script as well as the manifest template -- so if the setup
|
||||||
|
# script is newer than the manifest, we'll regenerate the manifest
|
||||||
|
# from the template. (Well, not quite: if we already have a
|
||||||
|
# manifest, but there's no template -- which will happen if the
|
||||||
|
# developer elects to generate a manifest some other way -- then we
|
||||||
|
# can't regenerate the manifest, so we don't.)
|
||||||
|
self.debug_print("checking if %s newer than %s" %
|
||||||
|
(self.distribution.script_name, self.manifest))
|
||||||
|
setup_newer = dep_util.newer(self.distribution.script_name,
|
||||||
|
self.manifest)
|
||||||
|
|
||||||
|
# cases:
|
||||||
|
# 1) no manifest, template exists: generate manifest
|
||||||
|
# (covered by 2a: no manifest == template newer)
|
||||||
|
# 2) manifest & template exist:
|
||||||
|
# 2a) template or setup script newer than manifest:
|
||||||
|
# regenerate manifest
|
||||||
|
# 2b) manifest newer than both:
|
||||||
|
# do nothing (unless --force or --manifest-only)
|
||||||
|
# 3) manifest exists, no template:
|
||||||
|
# do nothing (unless --force or --manifest-only)
|
||||||
|
# 4) no manifest, no template: generate w/ warning ("defaults only")
|
||||||
|
|
||||||
|
manifest_outofdate = (template_exists and
|
||||||
|
(template_newer or setup_newer))
|
||||||
|
force_regen = self.force_manifest or self.manifest_only
|
||||||
|
manifest_exists = os.path.isfile(self.manifest)
|
||||||
|
neither_exists = (not template_exists and not manifest_exists)
|
||||||
|
|
||||||
|
# Regenerate the manifest if necessary (or if explicitly told to)
|
||||||
|
if manifest_outofdate or neither_exists or force_regen:
|
||||||
|
if not template_exists:
|
||||||
|
self.warn(("manifest template '%s' does not exist " +
|
||||||
|
"(using default file list)") %
|
||||||
|
self.template)
|
||||||
|
self.filelist.findall()
|
||||||
|
|
||||||
|
if self.use_defaults:
|
||||||
|
self.add_defaults()
|
||||||
|
if template_exists:
|
||||||
|
self.read_template()
|
||||||
|
if self.prune:
|
||||||
|
self.prune_file_list()
|
||||||
|
|
||||||
|
self.filelist.sort()
|
||||||
|
self.filelist.remove_duplicates()
|
||||||
|
self.write_manifest()
|
||||||
|
|
||||||
|
# Don't regenerate the manifest, just read it in.
|
||||||
|
else:
|
||||||
|
self.read_manifest()
|
||||||
|
|
||||||
|
# get_file_list ()
|
||||||
|
|
||||||
|
|
||||||
|
def add_defaults (self):
|
||||||
|
"""Add all the default files to self.filelist:
|
||||||
|
- README or README.txt
|
||||||
|
- setup.py
|
||||||
|
- test/test*.py
|
||||||
|
- all pure Python modules mentioned in setup script
|
||||||
|
- all C sources listed as part of extensions or C libraries
|
||||||
|
in the setup script (doesn't catch C headers!)
|
||||||
|
Warns if (README or README.txt) or setup.py are missing; everything
|
||||||
|
else is optional.
|
||||||
|
"""
|
||||||
|
|
||||||
|
standards = [('README', 'README.txt'), self.distribution.script_name]
|
||||||
|
for fn in standards:
|
||||||
|
# XXX
|
||||||
|
if fn == 'setup.py': continue # We don't want setup.py
|
||||||
|
if type(fn) is TupleType:
|
||||||
|
alts = fn
|
||||||
|
got_it = 0
|
||||||
|
for fn in alts:
|
||||||
|
if os.path.exists(fn):
|
||||||
|
got_it = 1
|
||||||
|
self.filelist.append(fn)
|
||||||
|
break
|
||||||
|
|
||||||
|
if not got_it:
|
||||||
|
self.warn("standard file not found: should have one of " +
|
||||||
|
string.join(alts, ', '))
|
||||||
|
else:
|
||||||
|
if os.path.exists(fn):
|
||||||
|
self.filelist.append(fn)
|
||||||
|
else:
|
||||||
|
self.warn("standard file '%s' not found" % fn)
|
||||||
|
|
||||||
|
optional = ['test/test*.py', 'setup.cfg']
|
||||||
|
for pattern in optional:
|
||||||
|
files = filter(os.path.isfile, glob(pattern))
|
||||||
|
if files:
|
||||||
|
self.filelist.extend(files)
|
||||||
|
|
||||||
|
if self.distribution.has_pure_modules():
|
||||||
|
build_py = self.get_finalized_command('build_py')
|
||||||
|
self.filelist.extend(build_py.get_source_files())
|
||||||
|
|
||||||
|
if self.distribution.has_ext_modules():
|
||||||
|
build_ext = self.get_finalized_command('build_ext')
|
||||||
|
self.filelist.extend(build_ext.get_source_files())
|
||||||
|
|
||||||
|
if self.distribution.has_c_libraries():
|
||||||
|
build_clib = self.get_finalized_command('build_clib')
|
||||||
|
self.filelist.extend(build_clib.get_source_files())
|
||||||
|
|
||||||
|
if self.distribution.has_scripts():
|
||||||
|
build_scripts = self.get_finalized_command('build_scripts')
|
||||||
|
self.filelist.extend(build_scripts.get_source_files())
|
||||||
|
|
||||||
|
# add_defaults ()
|
||||||
|
|
||||||
|
|
||||||
|
def read_template (self):
|
||||||
|
"""Read and parse manifest template file named by self.template.
|
||||||
|
|
||||||
|
(usually "MANIFEST.in") The parsing and processing is done by
|
||||||
|
'self.filelist', which updates itself accordingly.
|
||||||
|
"""
|
||||||
|
log.info("reading manifest template '%s'", self.template)
|
||||||
|
template = TextFile(self.template,
|
||||||
|
strip_comments=1,
|
||||||
|
skip_blanks=1,
|
||||||
|
join_lines=1,
|
||||||
|
lstrip_ws=1,
|
||||||
|
rstrip_ws=1,
|
||||||
|
collapse_join=1)
|
||||||
|
|
||||||
|
while 1:
|
||||||
|
line = template.readline()
|
||||||
|
if line is None: # end of file
|
||||||
|
break
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.filelist.process_template_line(line)
|
||||||
|
except DistutilsTemplateError, msg:
|
||||||
|
self.warn("%s, line %d: %s" % (template.filename,
|
||||||
|
template.current_line,
|
||||||
|
msg))
|
||||||
|
|
||||||
|
# read_template ()
|
||||||
|
|
||||||
|
|
||||||
|
def prune_file_list (self):
|
||||||
|
"""Prune off branches that might slip into the file list as created
|
||||||
|
by 'read_template()', but really don't belong there:
|
||||||
|
* the build tree (typically "build")
|
||||||
|
* the release tree itself (only an issue if we ran "spa"
|
||||||
|
previously with --keep-temp, or it aborted)
|
||||||
|
* any RCS, CVS, .svn, .hg, .git, .bzr, _darcs directories
|
||||||
|
"""
|
||||||
|
build = self.get_finalized_command('build')
|
||||||
|
base_dir = self.distribution.get_fullname()
|
||||||
|
base_dir = self.distribution.get_name()
|
||||||
|
|
||||||
|
self.filelist.exclude_pattern(None, prefix=build.build_base)
|
||||||
|
self.filelist.exclude_pattern(None, prefix=base_dir)
|
||||||
|
|
||||||
|
# pruning out vcs directories
|
||||||
|
# both separators are used under win32
|
||||||
|
if sys.platform == 'win32':
|
||||||
|
seps = r'/|\\'
|
||||||
|
else:
|
||||||
|
seps = '/'
|
||||||
|
|
||||||
|
vcs_dirs = ['RCS', 'CVS', r'\.svn', r'\.hg', r'\.git', r'\.bzr',
|
||||||
|
'_darcs']
|
||||||
|
vcs_ptrn = r'(^|%s)(%s)(%s).*' % (seps, '|'.join(vcs_dirs), seps)
|
||||||
|
self.filelist.exclude_pattern(vcs_ptrn, is_regex=1)
|
||||||
|
|
||||||
|
def write_manifest (self):
|
||||||
|
"""Write the file list in 'self.filelist' (presumably as filled in
|
||||||
|
by 'add_defaults()' and 'read_template()') to the manifest file
|
||||||
|
named by 'self.manifest'.
|
||||||
|
"""
|
||||||
|
self.execute(file_util.write_file,
|
||||||
|
(self.manifest, self.filelist.files),
|
||||||
|
"writing manifest file '%s'" % self.manifest)
|
||||||
|
|
||||||
|
# write_manifest ()
|
||||||
|
|
||||||
|
|
||||||
|
def read_manifest (self):
|
||||||
|
"""Read the manifest file (named by 'self.manifest') and use it to
|
||||||
|
fill in 'self.filelist', the list of files to include in the source
|
||||||
|
distribution.
|
||||||
|
"""
|
||||||
|
log.info("reading manifest file '%s'", self.manifest)
|
||||||
|
manifest = open(self.manifest)
|
||||||
|
while 1:
|
||||||
|
line = manifest.readline()
|
||||||
|
if line == '': # end of file
|
||||||
|
break
|
||||||
|
if line[-1] == '\n':
|
||||||
|
line = line[0:-1]
|
||||||
|
self.filelist.append(line)
|
||||||
|
manifest.close()
|
||||||
|
|
||||||
|
# read_manifest ()
|
||||||
|
|
||||||
|
|
||||||
|
def make_release_tree (self, base_dir, files):
|
||||||
|
"""Create the directory tree that will become the source
|
||||||
|
distribution archive. All directories implied by the filenames in
|
||||||
|
'files' are created under 'base_dir', and then we hard link or copy
|
||||||
|
(if hard linking is unavailable) those files into place.
|
||||||
|
Essentially, this duplicates the developer's source tree, but in a
|
||||||
|
directory named after the distribution, containing only the files
|
||||||
|
to be distributed.
|
||||||
|
"""
|
||||||
|
# Create all the directories under 'base_dir' necessary to
|
||||||
|
# put 'files' there; the 'mkpath()' is just so we don't die
|
||||||
|
# if the manifest happens to be empty.
|
||||||
|
self.mkpath(base_dir)
|
||||||
|
dir_util.create_tree(base_dir, files, dry_run=self.dry_run)
|
||||||
|
|
||||||
|
# And walk over the list of files, either making a hard link (if
|
||||||
|
# os.link exists) to each one that doesn't already exist in its
|
||||||
|
# corresponding location under 'base_dir', or copying each file
|
||||||
|
# that's out-of-date in 'base_dir'. (Usually, all files will be
|
||||||
|
# out-of-date, because by default we blow away 'base_dir' when
|
||||||
|
# we're done making the distribution archives.)
|
||||||
|
|
||||||
|
if hasattr(os, 'link'): # can make hard links on this system
|
||||||
|
link = 'hard'
|
||||||
|
msg = "making hard links in %s..." % base_dir
|
||||||
|
else: # nope, have to copy
|
||||||
|
link = None
|
||||||
|
msg = "copying files to %s..." % base_dir
|
||||||
|
|
||||||
|
if not files:
|
||||||
|
log.warn("no files to distribute -- empty manifest?")
|
||||||
|
else:
|
||||||
|
log.info(msg)
|
||||||
|
for file in files:
|
||||||
|
if not os.path.isfile(file):
|
||||||
|
log.warn("'%s' not a regular file -- skipping" % file)
|
||||||
|
else:
|
||||||
|
dest = os.path.join(base_dir, file)
|
||||||
|
self.copy_file(file, dest, link=link)
|
||||||
|
|
||||||
|
self.distribution.metadata.write_pkg_info(base_dir)
|
||||||
|
|
||||||
|
# make_release_tree ()
|
||||||
|
|
||||||
|
def make_distribution (self):
|
||||||
|
"""Create the source distribution(s). First, we create the release
|
||||||
|
tree with 'make_release_tree()'; then, we create all required
|
||||||
|
archive files (according to 'self.formats') from the release tree.
|
||||||
|
Finally, we clean up by blowing away the release tree (unless
|
||||||
|
'self.keep_temp' is true). The list of archive files created is
|
||||||
|
stored so it can be retrieved later by 'get_archive_files()'.
|
||||||
|
"""
|
||||||
|
# Don't warn about missing meta-data here -- should be (and is!)
|
||||||
|
# done elsewhere.
|
||||||
|
base_dir = self.distribution.get_fullname()
|
||||||
|
base_dir = self.distribution.get_name()
|
||||||
|
# XXX
|
||||||
|
# base_dir = "TEST"
|
||||||
|
base_name = os.path.join(self.dist_dir, base_dir)
|
||||||
|
|
||||||
|
|
||||||
|
self.make_release_tree(base_dir, self.filelist.files)
|
||||||
|
archive_files = [] # remember names of files we create
|
||||||
|
# tar archive must be created last to avoid overwrite and remove
|
||||||
|
if 'tar' in self.formats:
|
||||||
|
self.formats.append(self.formats.pop(self.formats.index('tar')))
|
||||||
|
|
||||||
|
for fmt in self.formats:
|
||||||
|
# file = self.make_archive(base_name, fmt, base_dir=base_dir)
|
||||||
|
file = make_zipfile(base_name, base_dir=base_dir)
|
||||||
|
archive_files.append(file)
|
||||||
|
self.distribution.dist_files.append(('spa', '', file))
|
||||||
|
|
||||||
|
self.archive_files = archive_files
|
||||||
|
|
||||||
|
if not self.keep_temp:
|
||||||
|
dir_util.remove_tree(base_dir, dry_run=self.dry_run)
|
||||||
|
|
||||||
|
def get_archive_files (self):
|
||||||
|
"""Return the list of archive files created when the command
|
||||||
|
was run, or None if the command hasn't run yet.
|
||||||
|
"""
|
||||||
|
return self.archive_files
|
||||||
|
|
||||||
|
# class spa
|
||||||
|
|
||||||
|
|
||||||
|
class install(Command):
|
||||||
|
"""Does it make sense?"""
|
||||||
|
|
||||||
|
user_options = [('aa', 'a', 'aa')]
|
||||||
|
|
||||||
|
def initialize_options(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def finalize_options(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
print NotImplementedError("Command not implemented yet.")
|
||||||
|
|
||||||
|
|
||||||
|
class test(Command):
|
||||||
|
"""Does it make sense?"""
|
||||||
|
|
||||||
|
user_options = [('aa', 'a', 'aa')]
|
||||||
|
|
||||||
|
def initialize_options(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def finalize_options(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
if os.name == 'nt':
|
||||||
|
subprocess.call(["py.test.exe"])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
setup(cmdclass={'spa': spa, 'install': install, 'test': test},
|
||||||
|
name='AAAPackageDev',
|
||||||
|
version='0.6',
|
||||||
|
description='Sublime Text Dev Tools for Packages.',
|
||||||
|
author='Guillermo López-Anglada',
|
||||||
|
author_email='guillermo@sublimetext.info',
|
||||||
|
url='http://sublimetext.info',
|
||||||
|
)
|
||||||
71
sublime/Packages/AAAPackageDev/snippet_dev.py
Normal file
71
sublime/Packages/AAAPackageDev/snippet_dev.py
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
import sublime, sublime_plugin
|
||||||
|
|
||||||
|
from sublime_lib.view import has_file_ext
|
||||||
|
from sublime_lib.path import root_at_packages
|
||||||
|
|
||||||
|
from xml.etree import ElementTree as ET
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
RAW_SNIPPETS_SYNTAX = 'Packages/AAAPackageDev/Support/Sublime Snippet (Raw).tmLanguage'
|
||||||
|
|
||||||
|
|
||||||
|
TPL = """<snippet>
|
||||||
|
<content><![CDATA[$1]]></content>
|
||||||
|
<tabTrigger>${2:tab_trigger}</tabTrigger>
|
||||||
|
<scope>${3:source.name}</scope>
|
||||||
|
</snippet>"""
|
||||||
|
|
||||||
|
|
||||||
|
class NewRawSnippetCommand(sublime_plugin.WindowCommand):
|
||||||
|
def run(self):
|
||||||
|
v = self.window.new_file()
|
||||||
|
v.settings().set('default_dir', root_at_packages('User'))
|
||||||
|
v.settings().set('syntax', RAW_SNIPPETS_SYNTAX)
|
||||||
|
v.set_scratch(True)
|
||||||
|
|
||||||
|
|
||||||
|
class GenerateSnippetFromRawSnippetCommand(sublime_plugin.TextCommand):
|
||||||
|
def is_enabled(self):
|
||||||
|
return self.view.match_selector(0, 'source.sublimesnippetraw')
|
||||||
|
|
||||||
|
def run(self, edit):
|
||||||
|
# XXX: sublime_lib: new whole_content(view) function?
|
||||||
|
content = self.view.substr(sublime.Region(0, self.view.size()))
|
||||||
|
self.view.replace(edit, sublime.Region(0, self.view.size()), '')
|
||||||
|
self.view.run_command('insert_snippet', { 'contents': TPL })
|
||||||
|
self.view.settings().set('syntax', 'Packages/XML/XML.tmLanguage')
|
||||||
|
# Insert existing contents into CDATA section. We rely on the fact
|
||||||
|
# that Sublime will place the first selection in the first field of
|
||||||
|
# the newly inserted snippet.
|
||||||
|
self.view.insert(edit, self.view.sel()[0].begin(), content)
|
||||||
|
|
||||||
|
|
||||||
|
class NewRawSnippetFromSnippetCommand(sublime_plugin.TextCommand):
|
||||||
|
def is_enabled(self):
|
||||||
|
return has_file_ext(self.view, 'sublime-snippet')
|
||||||
|
|
||||||
|
def run(self, edit):
|
||||||
|
snippet = self.view.substr(sublime.Region(0, self.view.size()))
|
||||||
|
contents = ET.fromstring(snippet).findtext(".//content")
|
||||||
|
v = self.view.window().new_file()
|
||||||
|
v.insert(edit, 0, contents)
|
||||||
|
v.settings().set('syntax', RAW_SNIPPETS_SYNTAX)
|
||||||
|
|
||||||
|
|
||||||
|
class CopyAndInsertRawSnippetCommand(sublime_plugin.TextCommand):
|
||||||
|
"""Inserts the raw snippet contents into the first selection of
|
||||||
|
the previous view in the stack.
|
||||||
|
|
||||||
|
Allows a workflow where you're creating snippets for a .sublime-completions
|
||||||
|
file, for example, and you don't want to store them as .sublime-snippet
|
||||||
|
files.
|
||||||
|
"""
|
||||||
|
def is_enabled(self):
|
||||||
|
return self.view.match_selector(0, 'source.sublimesnippetraw')
|
||||||
|
|
||||||
|
def run(self, edit):
|
||||||
|
snip = self.view.substr(sublime.Region(0, self.view.size()))
|
||||||
|
self.view.window().run_command('close')
|
||||||
|
target = sublime.active_window().active_view()
|
||||||
|
target.replace(edit, target.sel()[0], snip)
|
||||||
57
sublime/Packages/AAAPackageDev/sublime_inspect.py
Normal file
57
sublime/Packages/AAAPackageDev/sublime_inspect.py
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
import sublime, sublime_plugin
|
||||||
|
|
||||||
|
import sublime_lib
|
||||||
|
|
||||||
|
import os
|
||||||
|
import json
|
||||||
|
|
||||||
|
|
||||||
|
class SublimeInspect(sublime_plugin.WindowCommand):
|
||||||
|
def on_done(self, s):
|
||||||
|
rep = Report(s)
|
||||||
|
rep.show()
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
self.window.show_input_panel("Search String:", '', self.on_done, None, None)
|
||||||
|
|
||||||
|
|
||||||
|
class Report(object):
|
||||||
|
def __init__(self, s):
|
||||||
|
self.s = s
|
||||||
|
|
||||||
|
def collect_info(self):
|
||||||
|
try:
|
||||||
|
atts = dir(eval(self.s, {"sublime": sublime, "sublime_plugin": sublime_plugin}))
|
||||||
|
except NameError, e:
|
||||||
|
atts = e
|
||||||
|
|
||||||
|
self.data = atts
|
||||||
|
|
||||||
|
def show(self):
|
||||||
|
self.collect_info()
|
||||||
|
v = sublime.active_window().new_file()
|
||||||
|
v.insert(v.begin_edit(), 0, '\n'.join(self.data))
|
||||||
|
v.set_scratch(True)
|
||||||
|
v.set_name("SublimeInspect - Report")
|
||||||
|
|
||||||
|
|
||||||
|
class OpenSublimeSessionCommand(sublime_plugin.WindowCommand):
|
||||||
|
def run(self):
|
||||||
|
session_file = os.path.join(sublime.packages_path(), "..", "Settings", "Session.sublime_session")
|
||||||
|
self.window.open_file(session_file)
|
||||||
|
|
||||||
|
|
||||||
|
def to_json_type(v):
|
||||||
|
""""Convert string value to proper JSON type.
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
if v.lower() in ("false", "true"):
|
||||||
|
v = (True if v.lower() == "true" else False)
|
||||||
|
elif v.isdigit():
|
||||||
|
v = int(v)
|
||||||
|
elif v.replace(".", "").isdigit():
|
||||||
|
v = float(v)
|
||||||
|
except AttributeError:
|
||||||
|
raise ValueError("Conversion to JSON failed for: %s" % v)
|
||||||
|
|
||||||
|
return v
|
||||||
228
sublime/Packages/AAAPackageDev/syntax_def_dev.py
Normal file
228
sublime/Packages/AAAPackageDev/syntax_def_dev.py
Normal file
|
|
@ -0,0 +1,228 @@
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import plistlib
|
||||||
|
import xml.parsers.expat
|
||||||
|
import uuid
|
||||||
|
import re
|
||||||
|
|
||||||
|
import sublime_plugin
|
||||||
|
|
||||||
|
from sublime_lib.path import root_at_packages
|
||||||
|
from sublime_lib.view import (in_one_edit, coorded_substr)
|
||||||
|
|
||||||
|
|
||||||
|
JSON_TMLANGUAGE_SYNTAX = 'Packages/AAAPackageDev/Support/Sublime JSON Syntax Definition.tmLanguage'
|
||||||
|
|
||||||
|
|
||||||
|
# XXX: Move this to a txt file. Let user define his own under User too.
|
||||||
|
def get_syntax_def_boilerplate():
|
||||||
|
JSON_TEMPLATE = """{ "name": "${1:Syntax Name}",
|
||||||
|
"scopeName": "source.${2:syntax_name}",
|
||||||
|
"fileTypes": ["$3"],
|
||||||
|
"patterns": [$0
|
||||||
|
],
|
||||||
|
"uuid": "%s"
|
||||||
|
}"""
|
||||||
|
|
||||||
|
actual_tmpl = JSON_TEMPLATE % str(uuid.uuid4())
|
||||||
|
return actual_tmpl
|
||||||
|
|
||||||
|
|
||||||
|
class NewSyntaxDefCommand(sublime_plugin.WindowCommand):
|
||||||
|
"""Creates a new syntax definition file for Sublime Text in JSON format
|
||||||
|
with some boilerplate text.
|
||||||
|
"""
|
||||||
|
def run(self):
|
||||||
|
target = self.window.new_file()
|
||||||
|
|
||||||
|
target.settings().set('default_dir', root_at_packages('User'))
|
||||||
|
target.settings().set('syntax', JSON_TMLANGUAGE_SYNTAX)
|
||||||
|
|
||||||
|
target.run_command('insert_snippet',
|
||||||
|
{'contents': get_syntax_def_boilerplate()})
|
||||||
|
|
||||||
|
|
||||||
|
class NewSyntaxDefFromBufferCommand(sublime_plugin.TextCommand):
|
||||||
|
"""Inserts boilerplate text for syntax defs into current view.
|
||||||
|
"""
|
||||||
|
def is_enabled(self):
|
||||||
|
# Don't mess up a non-empty buffer.
|
||||||
|
return self.view.size() == 0
|
||||||
|
|
||||||
|
def run(self, edit):
|
||||||
|
self.view.settings().set('default_dir', root_at_packages('User'))
|
||||||
|
self.view.settings().set('syntax', JSON_TMLANGUAGE_SYNTAX)
|
||||||
|
|
||||||
|
with in_one_edit(self.view):
|
||||||
|
self.view.run_command('insert_snippet',
|
||||||
|
{'contents': get_syntax_def_boilerplate()})
|
||||||
|
|
||||||
|
|
||||||
|
# XXX: Why is this a WindowCommand? Wouldn't it work otherwise in build-systems?
|
||||||
|
class JsonToPlistCommand(sublime_plugin.WindowCommand):
|
||||||
|
"""
|
||||||
|
Parses ``.json`` files and writes them into corresponding ``.plist``.
|
||||||
|
Source file ``.JSON-XXX`` will generate a plist file named ``.XXX``.
|
||||||
|
Pretty useful with ``.JSON-tmLanguage`` but works with almost any other name.
|
||||||
|
"""
|
||||||
|
ext_regexp = re.compile(r'\.json(?:-([^\.]+))?$', flags=re.I)
|
||||||
|
|
||||||
|
def is_enabled(self):
|
||||||
|
v = self.window.active_view()
|
||||||
|
return (v and (self.get_file_ext(v.file_name()) is not None))
|
||||||
|
|
||||||
|
def get_file_ext(self, file_name):
|
||||||
|
ret = self.ext_regexp.search(file_name)
|
||||||
|
if ret is None:
|
||||||
|
return None
|
||||||
|
return '.' + (ret.group(1) or 'plist')
|
||||||
|
|
||||||
|
def run(self, **kwargs):
|
||||||
|
v = self.window.active_view()
|
||||||
|
path = v.file_name()
|
||||||
|
ext = self.get_file_ext(path)
|
||||||
|
if not os.path.exists(path):
|
||||||
|
print "[AAAPackageDev] File does not exists. (%s)" % path
|
||||||
|
return
|
||||||
|
if ext is None:
|
||||||
|
print "[AAAPackageDev] Not a valid JSON file, please check extension. (%s)" % path
|
||||||
|
return
|
||||||
|
|
||||||
|
self.json_to_plist(path, ext)
|
||||||
|
|
||||||
|
def json_to_plist(self, json_file, new_ext):
|
||||||
|
path, fname = os.path.split(json_file)
|
||||||
|
fbase, old_ext = os.path.splitext(fname)
|
||||||
|
file_regex = r"Error parsing JSON:\s+'(.*?)'\s+.*?\s+line\s+(\d+)\s+column\s+(\d+)"
|
||||||
|
|
||||||
|
if not hasattr(self, 'output_view'):
|
||||||
|
# Try not to call get_output_panel until the regexes are assigned
|
||||||
|
self.output_view = self.window.get_output_panel("aaa_package_dev")
|
||||||
|
|
||||||
|
# FIXME: Can't get error navigation to work.
|
||||||
|
self.output_view.settings().set("result_file_regex", file_regex)
|
||||||
|
self.output_view.settings().set("result_base_dir", path)
|
||||||
|
|
||||||
|
# Call get_output_panel a second time after assigning the above
|
||||||
|
# settings, so that it'll be picked up as a result buffer
|
||||||
|
self.window.get_output_panel("aaa_package_dev")
|
||||||
|
|
||||||
|
with in_one_edit(self.output_view) as edit:
|
||||||
|
try:
|
||||||
|
with open(json_file) as json_content:
|
||||||
|
tmlanguage = json.load(json_content)
|
||||||
|
except ValueError, e:
|
||||||
|
self.output_view.insert(edit, 0, "Error parsing JSON: '%s' %s" % (json_file, str(e)))
|
||||||
|
else:
|
||||||
|
target = os.path.join(path, fbase + new_ext)
|
||||||
|
self.output_view.insert(edit, 0, "Writing plist... (%s)" % target)
|
||||||
|
plistlib.writePlist(tmlanguage, target)
|
||||||
|
|
||||||
|
self.window.run_command("show_panel", {"panel": "output.aaa_package_dev"})
|
||||||
|
|
||||||
|
|
||||||
|
class PlistToJsonCommand(sublime_plugin.WindowCommand):
|
||||||
|
"""
|
||||||
|
Parses ``.plist`` files and writes them into corresponding ``.json``.
|
||||||
|
A source file has ``<!DOCTYPE plist`` at the beginning of the first two lines
|
||||||
|
and uses the extension ``.XXX`` will generate a json file named ``.JSON-XXX``.
|
||||||
|
This is pretty much the reverse of the json_to_plist command.
|
||||||
|
|
||||||
|
Accepts parameters for ``json.dump()`` as arguments which override the default
|
||||||
|
settings. Use this only if you know what you're doing!
|
||||||
|
|
||||||
|
Please note:
|
||||||
|
- Be careful with non-native JSON data types like <date> or <data>, they
|
||||||
|
result in unpredictable behavior!
|
||||||
|
- Floats of <float> or <real> tend to lose precision when being cast into Python
|
||||||
|
data types. ``32.1`` (plist) will likely result in ``32.100000000000001`` (json).
|
||||||
|
"""
|
||||||
|
DOCTYPE = "<!DOCTYPE plist"
|
||||||
|
|
||||||
|
def is_enabled(self):
|
||||||
|
v = self.window.active_view()
|
||||||
|
return (self.get_file_ext(v) is not None)
|
||||||
|
|
||||||
|
def get_file_ext(self, v):
|
||||||
|
if not v:
|
||||||
|
return None
|
||||||
|
fn = v.file_name()
|
||||||
|
ext = os.path.splitext(fn)[1]
|
||||||
|
|
||||||
|
# check for ".plist" ext
|
||||||
|
if ext == ".plist":
|
||||||
|
return ".json"
|
||||||
|
|
||||||
|
# check for plist namespace (doctype) in first two lines
|
||||||
|
for i in range(2):
|
||||||
|
text = coorded_substr(v, (i, 0), (i, len(self.DOCTYPE)))
|
||||||
|
print "i: %d, text: %s" % (i, text)
|
||||||
|
if text == self.DOCTYPE:
|
||||||
|
return ".JSON-" + ext[1:]
|
||||||
|
|
||||||
|
# not a plist file, 99% likely
|
||||||
|
return None
|
||||||
|
|
||||||
|
def run(self, **kwargs):
|
||||||
|
v = self.window.active_view()
|
||||||
|
path = v.file_name()
|
||||||
|
if not os.path.exists(path):
|
||||||
|
print "[AAAPackageDev] File does not exists. (%s)" % path
|
||||||
|
return
|
||||||
|
new_ext = self.get_file_ext(v)
|
||||||
|
if new_ext is None:
|
||||||
|
print "[AAAPackageDev] Not a valid Property List. (%s)" % path
|
||||||
|
return
|
||||||
|
|
||||||
|
self.plist_to_json(path, new_ext, **kwargs)
|
||||||
|
|
||||||
|
def plist_to_json(self, plist_file, new_ext, **kwargs):
|
||||||
|
path, fname = os.path.split(plist_file)
|
||||||
|
fbase, old_ext = os.path.splitext(fname)
|
||||||
|
target = os.path.join(path, fbase + new_ext)
|
||||||
|
|
||||||
|
debug_base = "Error parsing Plist (%s): %s; line (%s) column (%s)"
|
||||||
|
file_regex = re.escape(debug_base).replace(r'\%', '%') % (r'(.*?)', r'.*?', r'(\d+)', r'(\d+)')
|
||||||
|
|
||||||
|
# Define default parameters
|
||||||
|
json_params = dict(
|
||||||
|
skipkeys=True,
|
||||||
|
check_circular=False, # there won't be references here
|
||||||
|
indent=4,
|
||||||
|
sort_keys=True
|
||||||
|
)
|
||||||
|
json_params.update(kwargs)
|
||||||
|
print json_params
|
||||||
|
|
||||||
|
# Handle the output
|
||||||
|
if not hasattr(self, 'output_view'):
|
||||||
|
# Try not to call get_output_panel until the regexes are assigned
|
||||||
|
self.output_view = self.window.get_output_panel("aaa_package_dev")
|
||||||
|
|
||||||
|
# FIXME: Can't get error navigation to work.
|
||||||
|
self.output_view.settings().set("result_file_regex", file_regex)
|
||||||
|
self.output_view.settings().set("result_base_dir", path)
|
||||||
|
|
||||||
|
# Call get_output_panel a second time after assigning the above
|
||||||
|
# settings, so that it'll be picked up as a result buffer
|
||||||
|
self.window.get_output_panel("aaa_package_dev")
|
||||||
|
|
||||||
|
with in_one_edit(self.output_view) as edit:
|
||||||
|
try:
|
||||||
|
pl = plistlib.readPlist(plist_file)
|
||||||
|
except xml.parsers.expat.ExpatError, e:
|
||||||
|
self.output_view.insert(edit, 0,
|
||||||
|
debug_base % (plist_file,
|
||||||
|
xml.parsers.expat.ErrorString(e.code),
|
||||||
|
e.lineno,
|
||||||
|
e.offset)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
self.output_view.insert(edit, 0, "Writing json... (%s)" % target)
|
||||||
|
try:
|
||||||
|
with open(target, "w") as f:
|
||||||
|
json.dump(pl, f, **json_params)
|
||||||
|
except Exception, e:
|
||||||
|
print "[AAAPackageDev] Error writing json: %s" % str(e)
|
||||||
|
|
||||||
|
self.window.run_command("show_panel", {"panel": "output.aaa_package_dev"})
|
||||||
0
sublime/Packages/AAAPackageDev/tests/sublime.py
Normal file
0
sublime/Packages/AAAPackageDev/tests/sublime.py
Normal file
0
sublime/Packages/AAAPackageDev/tests/sublime_plugin.py
Normal file
0
sublime/Packages/AAAPackageDev/tests/sublime_plugin.py
Normal file
12
sublime/Packages/AAAPackageDev/tests/test_setup.py
Normal file
12
sublime/Packages/AAAPackageDev/tests/test_setup.py
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
here = os.path.split(__file__)[0]
|
||||||
|
path_to_lib = os.path.normpath(os.path.join(here, "..", "Lib"))
|
||||||
|
if not path_to_lib in sys.path:
|
||||||
|
sys.path.append(path_to_lib)
|
||||||
|
|
||||||
|
|
||||||
|
# path_to_other = os.path.normpath(os.path.join(here, ".."))
|
||||||
|
# if not path_to_other in sys.path:
|
||||||
|
# sys.path.append(path_to_other)
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
|
import mock
|
||||||
|
|
||||||
|
import sublime
|
||||||
|
|
||||||
|
import sublime_lib.path as su_path
|
||||||
|
|
||||||
|
|
||||||
|
def test_root_at_packages():
|
||||||
|
sublime.packages_path = mock.Mock()
|
||||||
|
sublime.packages_path.return_value = "XXX"
|
||||||
|
expected = os.path.join("XXX", "ZZZ")
|
||||||
|
assert su_path.root_at_packages("ZZZ") == expected
|
||||||
|
|
||||||
|
|
||||||
|
def test_root_at_data():
|
||||||
|
sublime.packages_path = mock.Mock()
|
||||||
|
sublime.packages_path.return_value = "XXX\\YYY"
|
||||||
|
expected = os.path.join("XXX", "ZZZ")
|
||||||
|
assert su_path.root_at_data("ZZZ") == expected
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
|
import mock
|
||||||
|
|
||||||
|
import sublime
|
||||||
|
|
@ -0,0 +1,63 @@
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
|
import mock
|
||||||
|
|
||||||
|
import sublime
|
||||||
|
|
||||||
|
import sublime_lib.view as su_lib_view
|
||||||
|
|
||||||
|
|
||||||
|
def test_append():
|
||||||
|
view = mock.Mock()
|
||||||
|
|
||||||
|
edit = object()
|
||||||
|
view.begin_edit.return_value = edit
|
||||||
|
view.size.return_value = 100
|
||||||
|
su_lib_view.append(view, "new text")
|
||||||
|
assert view.insert.call_args == ((edit, 100, "new text"),)
|
||||||
|
|
||||||
|
|
||||||
|
def test_in_one_edit():
|
||||||
|
view = mock.Mock()
|
||||||
|
|
||||||
|
edit = object()
|
||||||
|
view.begin_edit.return_value = edit
|
||||||
|
with su_lib_view.in_one_edit(view) as x:
|
||||||
|
assert x is edit
|
||||||
|
assert view.end_edit.call_args == ((edit,),)
|
||||||
|
|
||||||
|
|
||||||
|
def test_has_file_ext():
|
||||||
|
view = mock.Mock()
|
||||||
|
|
||||||
|
view.file_name.return_value = "foo.bar"
|
||||||
|
assert su_lib_view.has_file_ext(view, "bar")
|
||||||
|
|
||||||
|
view.file_name.return_value = 'foo.'
|
||||||
|
assert not su_lib_view.has_file_ext(view, ".")
|
||||||
|
|
||||||
|
view.file_name.return_value = ''
|
||||||
|
assert not su_lib_view.has_file_ext(view, ".")
|
||||||
|
|
||||||
|
view.file_name.return_value = ''
|
||||||
|
assert not su_lib_view.has_file_ext(view, '')
|
||||||
|
|
||||||
|
view.file_name.return_value = 'foo'
|
||||||
|
assert not su_lib_view.has_file_ext(view, '')
|
||||||
|
|
||||||
|
view.file_name.return_value = 'foo'
|
||||||
|
assert not su_lib_view.has_file_ext(view, 'foo')
|
||||||
|
|
||||||
|
view.file_name.return_value = None
|
||||||
|
assert not su_lib_view.has_file_ext(view, None)
|
||||||
|
|
||||||
|
view.file_name.return_value = None
|
||||||
|
assert not su_lib_view.has_file_ext(view, '.any')
|
||||||
|
|
||||||
|
|
||||||
|
def test_has_sels():
|
||||||
|
view = mock.Mock()
|
||||||
|
view.sel.return_value = range(1)
|
||||||
|
|
||||||
|
assert su_lib_view.has_sels(view)
|
||||||
31
sublime/Packages/LESS/.gitignore
vendored
Normal file
31
sublime/Packages/LESS/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
# Numerous always-ignore extensions
|
||||||
|
*.diff
|
||||||
|
*.err
|
||||||
|
*.orig
|
||||||
|
*.log
|
||||||
|
*.rej
|
||||||
|
*.swo
|
||||||
|
*.swp
|
||||||
|
*.vi
|
||||||
|
*.cache
|
||||||
|
*~
|
||||||
|
|
||||||
|
# OS or Editor folders
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
.cache
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.tmproj
|
||||||
|
*.esproj
|
||||||
|
nbproject
|
||||||
|
*.sublime-project
|
||||||
|
*.sublime-workspace
|
||||||
|
.tm_properties
|
||||||
|
|
||||||
|
# Folders to ignore
|
||||||
|
.hg
|
||||||
|
.svn
|
||||||
|
.CVS
|
||||||
|
.idea
|
||||||
|
.sass-cache
|
||||||
42
sublime/Packages/LESS/Comments.tmPreferences
Normal file
42
sublime/Packages/LESS/Comments.tmPreferences
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Comments</string>
|
||||||
|
<key>scope</key>
|
||||||
|
<string>source.css.less</string>
|
||||||
|
<key>settings</key>
|
||||||
|
<dict>
|
||||||
|
<key>shellVariables</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>TM_COMMENT_START</string>
|
||||||
|
<key>value</key>
|
||||||
|
<string>// </string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>TM_COMMENT_START_2</string>
|
||||||
|
<key>value</key>
|
||||||
|
<string>/*</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>TM_COMMENT_END_2</string>
|
||||||
|
<key>value</key>
|
||||||
|
<string>*/</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>TM_COMMENT_DISABLE_INDENT</string>
|
||||||
|
<key>value</key>
|
||||||
|
<string>no</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>uuid</key>
|
||||||
|
<string>375CF370-8A7B-450A-895C-FD18B47957E2</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
492
sublime/Packages/LESS/LESS.tmLanguage
Normal file
492
sublime/Packages/LESS/LESS.tmLanguage
Normal file
|
|
@ -0,0 +1,492 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>comment</key>
|
||||||
|
<string>LESS</string>
|
||||||
|
<key>fileTypes</key>
|
||||||
|
<array>
|
||||||
|
<string>less</string>
|
||||||
|
<string>css</string>
|
||||||
|
</array>
|
||||||
|
|
||||||
|
<key>foldingStartMarker</key>
|
||||||
|
<string>/\*\*(?!\*)|\{\s*($|/\*(?!.*?\*/.*\S))</string>
|
||||||
|
<key>foldingStopMarker</key>
|
||||||
|
<string>(?<!\*)\*\*/|^\s*\}</string>
|
||||||
|
<key>keyEquivalent</key>
|
||||||
|
<string>^~L</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>LESS</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|datalist|dd|del|details|dfn|dialog|div|dl|dt|em|eventsource|fieldset|figure|figcaption|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|label|legend|li|link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|samp|script|section|select|small|span|strike|strong|style|sub|summary|sup|svg|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)\b</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.control.html.elements</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>"</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>"</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.quoted.double.css</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\\.</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.character.escaped.css</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>'</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>'</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.quoted.single.css</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\\.</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.character.escaped.css</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>`</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>`</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.quoted.single.css markup.raw</string>
|
||||||
|
<key>patterns</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\\.</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.character.escaped.css</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>entity.other.less.mixin</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(\.(?![0-9])[a-zA-Z0-9_-]+(?=\())</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>entity.other.attribute-name.class.css</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(\.(?![0-9])[a-zA-Z0-9_-]+)</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>(url)(\()(\')</string>
|
||||||
|
<key>contentName</key>
|
||||||
|
<string>string.quoted.variable.parameter.url</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>(\')(\))</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.any-method.builtin.css</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.brace.round.js</string>
|
||||||
|
</dict>
|
||||||
|
<key>3</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.quoted.variable.parameter.url</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>endCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.quoted.variable.parameter.url</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.brace.round.js</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>(url)(\()(\")</string>
|
||||||
|
<key>contentName</key>
|
||||||
|
<string>string.quoted.variable.parameter.url</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>(\")(\))</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.any-method.builtin.css</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.brace.round.js</string>
|
||||||
|
</dict>
|
||||||
|
<key>3</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.quoted.variable.parameter.url</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>endCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.quoted.variable.parameter.url</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.brace.round.js</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>(url)(\()</string>
|
||||||
|
<key>contentName</key>
|
||||||
|
<string>string.quoted.variable.parameter.url</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>(\))</string>
|
||||||
|
<key>beginCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.any-method.builtin.css</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.brace.round.js</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>endCaptures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.brace.round.js</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(#)([0-9a-fA-F]{3}|[0-9a-fA-F]{6})\b</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.other.rgb-value.css</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>0</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>entity.other.attribute-name.id</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>#[a-zA-Z0-9_-]+</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.selector.css</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>/\*</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>\*/</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>comment.block.css</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(-|\+)?\s*[0-9]+(\.[0-9]+)?</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>constant.numeric.css</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(?<=[\d])(px|pt|cm|mm|in|em|ex|pc|rem|deg|ms|s)\b|%</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.unit.css</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.entity.css</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(:+)\b(not|after|before|disabled|empty|enabled|first-child|first-letter|first-line|first-of-type|invalid|last-of-type|last-child|only-child|only-of-type|selection|target|valid|required|nth-child)\b</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>entity.other.attribute-name.pseudo-element.css</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.entity.css</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(:)\b(active|hover|link|visited|focus)\b</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>entity.other.attribute-name.pseudo-class.css</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.entity.css</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>entity.other.attribute-name.attribute.css</string>
|
||||||
|
</dict>
|
||||||
|
<key>3</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.separator.operator.css keyword.operator.less</string>
|
||||||
|
</dict>
|
||||||
|
<key>4</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.unquoted.attribute-value.css</string>
|
||||||
|
</dict>
|
||||||
|
<key>5</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>string.quoted.double.attribute-value.css</string>
|
||||||
|
</dict>
|
||||||
|
<key>6</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.string.begin.css</string>
|
||||||
|
</dict>
|
||||||
|
<key>7</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.string.end.css</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(?i)(\[)\s*(-?[_a-z\\[[:^ascii:]]][_a-z0-9\-\\[[:^ascii:]]]*)(?:\s*([~|^$*]?=)\s*(?:(-?[_a-z\\[[:^ascii:]]][_a-z0-9\-\\[[:^ascii:]]]*)|((?>(['"])(?:[^\\]|\\.)*?(\6)))))?\s*(\])</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.attribute-selector.css</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.control.at-rule.import.css</string>
|
||||||
|
</dict>
|
||||||
|
<key>2</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>punctuation.definition.keyword.css</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>^\s*((@)import\b)</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.at-rule.import.css</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.type.property-name.css.vendor</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(-(?:webkit|moz|khtml|o|ms|icab)-(?:text-overflow|hyphens|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|backface-visibility|background-clip|background-origin|background-size|border-image|border-radius-topleft|border-radius-bottomleft|border-radius-topright|border-radius-bottomright|border-radius|box-align|box-shadow|box-sizing|column-count|column-gap|columns|font-smoothing|min-device-pixel-ratio|opacity|perspective-origin-x|perspective-origin-y|perspective-origin|perspective|tap-highlight-color|text-size-adjust|text-stroke|transform-origin-x|transform-origin-y|transform-origin-z|transform-style|transform-origin|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|input-placeholder|placeholder|inline-stack|border-top-left-radius|border-top-right-radius|border-bottom-left-radius|border-bottom-right-radius|focus-inner|margin-top-collapse|focus-ring-color|user-select|touch-callout|filter))\s*(?:)</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.type.property-name.css</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\s*\b(hyphens|backface-visibility|text-overflow|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|background-attachment|background-color|background-clip|background-image|background-origin|background-position|background-repeat|background-size|background|behavior|border-bottom-color|border-bottom-style|border-bottom-width|border-bottom-left-radius|border-bottom-right-radius|border-bottom|border-collapse|border-color|border-left-color|border-left-style|border-left-width|border-left|border-right-color|border-right-style|border-right-width|border-right|border-spacing|border-style|border-top-color|border-top-style|border-top-width|border-top-left-radius|border-top-right-radius|border-top|border-width|border-image|border-radius-topleft|border-radius-bottomleft|border-radius-topright|border-radius-bottomright|border-radius|border-box|border|box-align|box-shadow|box-sizing|bottom|caption-side|clear|clip|color-stop|color|column-count|column-gap|columns|content-box|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size-adjust|font-size|font-stretch|font-style|font-variant|font-weight|font|height|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|marker-offset|margin|marks|max-height|max-width|min-device-pixel-ratio|min-height|min-width|opacity|orientation|orphans|outline-offset|outline-color|outline-style|outline-width|outline|overflow(-[xy])?|padding-bottom|padding-left|padding-right|padding-top|padding-box|padding|page-break-after|page-break-before|page-break-inside|page|pause-after|pause-before|pause|perspective-origin|perspective-origin-x|perspective-origin-y|perspective|pitch-range|pitch|play-during|position|quotes|resize|richness|right|size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|stress|table-layout|text-align|text-decoration|text-indent|text-shadow|text-transform|top|transform-origin|transform-origin-x|transform-origin-y|transform-origin-z|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-spacing|word-wrap|z-index|zoom|filter|word-break|user-select|text-rendering)\s*(?:)</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\s*\b(grab|grabbing|antialiased|absolute|all-scroll|all|always|auto|baseline|below|bidi-override|block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|char|circle|col-resize|collapse|content-box|crosshair|dashed|decimal|default|disabled|disc|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in-out|ease-in|ease-out|ease|ellipsis|fixed|groove|hand|help|hidden|horizontal|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|inactive|inherit|inline-block|inline|inset|inside|inter-ideograph|inter-word|italic|justify|keep-all|landscape|left|lighter|line-edge|line-through|line|linear-gradient|linear|list-item|loose|lower-alpha|lower-roman|lowercase|lr-tb|ltr|medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|cover|contain|nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|overline|padding-box|pointer-events|pointer|portrait|pre-wrap|progress|relative|repeat-x|repeat-y|repeat|right|ridge|rotate|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|solid|square|static|strict|super|sw-resize|table-footer-group|table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-roman|uppercase|vertical-ideographic|vertical-text|vertical|visible|w-resize|wait|whitespace|initial|radial|bicubic|textfield|table-cell)\b</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.constant.property-value.css</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(\b(?i:arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace|monaco|menlo|consolas)\b)</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.constant.font-name.css</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>comment</key>
|
||||||
|
<string>http://www.w3.org/TR/CSS21/syndata.html#value-def-color</string>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\b(aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow)(?!\()\b</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.constant.color.w3c-standard-color-name.css</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>comment</key>
|
||||||
|
<string>Moar colors.. this is about colors after all.</string>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\b(indianred|lightcoral|salmon|darksalmon|lightsalmon|crimson|red|firebrick|darkred|pink|lightpink|hotpink|deeppink|mediumvioletred|palevioletred|lightsalmon|coral|tomato|orangered|darkorange|orange|gold|yellow|lightyellow|lemonchiffon|lightgoldenrodyellow|papayawhip|moccasin|peachpuff|palegoldenrod|khaki|darkkhaki|lavender|thistle|plum|violet|orchid|fuchsia|magenta|mediumorchid|mediumpurple|blueviolet|darkviolet|darkorchid|darkmagenta|purple|indigo|slateblue|darkslateblue|mediumslateblue|greenyellow|chartreuse|lawngreen|lime|limegreen|palegreen|lightgreen|mediumspringgreen|springgreen|mediumseagreen|seagreen|forestgreen|green|darkgreen|yellowgreen|olivedrab|olive|darkolivegreen|mediumaquamarine|darkseagreen|lightseagreen|darkcyan|teal|aqua|cyan|lightcyan|paleturquoise|aquamarine|turquoise|mediumturquoise|darkturquoise|cadetblue|steelblue|lightsteelblue|powderblue|lightblue|skyblue|lightskyblue|deepskyblue|dodgerblue|cornflowerblue|mediumslateblue|royalblue|blue|mediumblue|darkblue|navy|midnightblue|cornsilk|blanchedalmond|bisque|navajowhite|wheat|burlywood|tan|rosybrown|sandybrown|goldenrod|darkgoldenrod|peru|chocolate|saddlebrown|sienna|brown|maroon|white|snow|honeydew|mintcream|azure|aliceblue|ghostwhite|whitesmoke|seashell|beige|oldlace|floralwhite|ivory|antiquewhite|linen|lavenderblush|mistyrose|gainsboro|lightgrey|silver|darkgray|gray|dimgray|lightslategray|slategray|darkslategray|black|grey)(?!\()\b</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.constant.color.extra</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\b(argb|blur|color|saturate|desaturate|lighten|darken|grayscale|fade|fadein|fadeout|spin|mix|hue|saturation|lightness|alpha|round|ceil|floor|percentage|translate|rotate|scale|skew|skewX|skewY|matrix|matrix3d|translate3d|translateX|translateY|translateZ|scale3d|scaleX|scaleY|scaleZ|rotate3d|rotateX|rotateY|rotateZ|perspective|greyscale|iscolor|isnumber|isstring|iskeyword|isurl|ispixel|ispercentage|isem|contrast|red|green|blue|luma)\b</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.any-method.builtin.less</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\b(rgb|rgba|hsl|hsla|url|format|src|cubic-bezier)\b</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.any-method.builtin.css</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.any-method.vendor.css</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(-(?:webkit|moz|khtml|o|ms|icab)-(?:linear-gradient|gradient|radial-gradient|interpolation-mode|search-decoration|search-cancel-button))</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\b(color-stop|from|to)\b</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.any-method.webkit.gradient.css</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>captures</key>
|
||||||
|
<dict>
|
||||||
|
<key>1</key>
|
||||||
|
<dict>
|
||||||
|
<key>name</key>
|
||||||
|
<string>support.function.less</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(\.[a-zA-Z0-9_-]+)\s*(;|\()</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>begin</key>
|
||||||
|
<string>//</string>
|
||||||
|
<key>end</key>
|
||||||
|
<string>$\n?</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>comment.line.double-slash.less</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>(?>@[a-zA-Z0-9_-][\w-]*+)(?!:)</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>variable.other.less</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>@[a-zA-Z0-9_-][\w-]*</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>variable.declaration.less</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>@{[a-zA-Z0-9_-][\w-]*}</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>variable.interpolation.less</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>!important|$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|(?<!\()/=|%=|\+=|\-=|&=|when\b</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>keyword.operator.less</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\{|\}</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.brace.curly.js</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\(|\)</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.brace.round.js</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>match</key>
|
||||||
|
<string>\[|\]</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>meta.brace.square.js</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>scopeName</key>
|
||||||
|
<string>source.css.less</string>
|
||||||
|
<key>uuid</key>
|
||||||
|
<string>9343D324-75A1-4733-A5C0-5D1D4B6182D0</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue