Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodeCompletion/python.json #2

Open
ghost opened this issue May 7, 2013 · 4 comments
Open

CodeCompletion/python.json #2

ghost opened this issue May 7, 2013 · 4 comments

Comments

@ghost
Copy link

ghost commented May 7, 2013

You'll want to change the UUID for this, but this is how far I got writing this down this morning. Cheers!

{
    "description": "Textastic Code Completion for Python",
    "uuid": "00000000-0000-4000-8000-000000000000",

    "completionSets": [
        {
            "name": "keyword.control.flow.python",
            "scope": "source.py",
            "strings": [
                "break",
                "continue",
                "elif",
                "else",
                "except",
                "finally",
                "for",
                "if",
                "pass",
                "raise",
                "return",
                "try",
                "while",
                "with",
                "yield"
            ]
        },
        {
            "name": "keyword.operator.logical.python",
            "scope": "source.py",
            "strings": [
                "and",
                "in",
                "is",
                "not",
                "or"
            ]
        },
        {
            "name": "keyword.other.python",
            "scope": "source.py",
            "strings": [
                "as",
                "assert",
                "del",
                "exec",
                "print"
            ]
        },
        {
            "name": "storage.type.class.python",
            "scope": "source.py",
            "strings": [
                "class"
            ]
        },
        {
            "name": "constant.language.python",
            "scope": "source.py",
            "strings": [
                "Ellipsis",
                "False",
                "NotImplemented",
                "True"
            ]
        },
        {
            "name": "support.type.exception.python",
            "scope": "source.py",
            "strings": [
                "ArithmeticError",
                "AssertionError",
                "AttributeError",
                "BaseException",
                "BufferError",
                "BytesWarning",
                "DeprecationWarning",
                "EOFError",
                "EnvironmentError",
                "Exception",
                "FloatingPointError",
                "FutureWarning",
                "GeneratorExit",
                "IOError",
                "ImportError",
                "ImportWarning",
                "IndentationError",
                "IndexError",
                "KeyError",
                "KeyboardInterrupt",
                "LookupError",
                "MemoryError",
                "NameError",
                "NotImplemented",
                "NotImplementedError",
                "OSError",
                "OverflowError",
                "PendingDeprecationWarning",
                "ReferenceError",
                "RuntimeError",
                "RuntimeWarning",
                "StandardError",
                "StopIteration",
                "SyntaxError",
                "SystemError",
                "SystemExit",
                "SytaxWarning",
                "TabError",
                "TypeError",
                "UnboundLocalError",
                "UnicodeDecodeError",
                "UnicodeEncodeError",
                "UnicodeTranslateError",
                "UnicodeWarning",
                "UserWarning",
                "VMSError",
                "ValueError",
                "WindowsError",
                "ZeroDivisionError"
            ]
        },
        {
            "name": "support.function.builtin.python",
            "scope": "source.py",
            "strings": [
                "__import__",
                "abs",
                "all",
                "any",
                "apply",
                "callable",
                "chr",
                "cmp",
                "coerce",
                "compile",
                "delattr",
                "dir",
                "divmod",
                "eval",
                "execfile",
                "filter",
                "getattr",
                "globals",
                "hasattr",
                "hash",
                "hex",
                "id",
                "input",
                "intern",
                "isinstance",
                "issubclass",
                "iter",
                "len",
                "locals",
                "map",
                "max",
                "min",
                "oct",
                "ord",
                "pow",
                "range",
                "raw_input",
                "reduce",
                "reload",
                "repr",
                "round",
                "setattr",
                "sorted",
                "sum",
                "unichr",
                "vars",
                "zip",
            ]
        },
        {
            "name": "support.type.python",
            "scope": "source.py",
            "strings": [
                "basestring",
                "bool",
                "buffer",
                "classmethod",
                "complex",
                "dict",
                "enumerate",
                "file",
                "float",
                "frozenset",
                "int",
                "list",
                "long",
                "object",
                "open",
                "property",
                "reversed",
                "set",
                "slice",
                "staticmethod",
                "str",
                "super",
                "tuple",
                "type",
                "unicode",
                "xrange"
            ]
        },
        {
            "name": "invalid.illegal.name.python",
            "scope": "source.py",
            "strings": [
                "and",
                "as",
                "assert",
                "break",
                "class",
                "continue",
                "def",
                "del",
                "elif",
                "else",
                "except",
                "exec",
                "finally",
                "for",
                "from",
                "global",
                "if",
                "import",
                "in",
                "is",
                "lambda",
                "not",
                "or",
                "pass",
                "print",
                "raise",
                "return",
                "try",
                "while",
                "with",
                "yield"
            ]
        },
        {
            "name": "variable.language.python",
            "scope": "source.py",
            "strings": [
                "self",
                "cls"
            ]
        },
        {
            "name": "support.function.magic.python",
            "scope": "source.py",
            "strings": [
                "__abs__",
                "__add__",
                "__and__",
                "__call__",
                "__cmp__",
                "__coerce__",
                "__complex__",
                "__contains__",
                "__del__",
                "__delattr__",
                "__delete__",
                "__delitem__",
                "__delslice__",
                "__div__",
                "__divmod__",
                "__enter__",
                "__eq__",
                "__exit__",
                "__float__",
                "__floordiv__",
                "__ge__",
                "__get__",
                "__getattr__",
                "__getattribute__",
                "__getitem__",
                "__getslice__",
                "__gt__",
                "__hash__",
                "__hex__",
                "__iadd__",
                "__iand__",
                "__idiv__",
                "__ifloordiv__",
                "__ilshift__",
                "__imod__",
                "__imul__",
                "__init__",
                "__int__",
                "__invert__",
                "__ior__",
                "__ipow__",
                "__irshift__",
                "__isub__",
                "__iter__",
                "__itruediv__",
                "__ixor__",
                "__le__",
                "__len__",
                "__long__",
                "__lshift__",
                "__lt__",
                "__mod__",
                "__mul__",
                "__ne__",
                "__neg__",
                "__new__",
                "__nonzero__",
                "__oct__",
                "__or__",
                "__pos__",
                "__pow__",
                "__radd__",
                "__rand__",
                "__rdiv__",
                "__rdivmod__",
                "__repr__",
                "__rfloordiv__",
                "__rlshift__",
                "__rmod__",
                "__rmul__",
                "__ror__",
                "__rpow__",
                "__rrshift__",
                "__rshift__",
                "__rsub__",
                "__rtruediv__",
                "__rxor__",
                "__set__",
                "__setattr__",
                "__setitem__",
                "__setslice__",
                "__str__",
                "__sub__",
                "__truediv__",
                "__unicode__",
                "__xor__"
            ]
        },
        {
            "name": "support.variable.magic.python",
            "scope": "source.py",
            "strings": [
                "__all__",
                "__bases__",
                "__class__",
                "__debug__",
                "__dict__",
                "__doc__",
                "__file__",
                "__members__",
                "__metaclass__",
                "__methods__",
                "__name__",
                "__slots__",
                "__weakref__"
            ]
        },
        {
            "name": "string.quoted.double.block.sql.python",
            "scope": "source.py",
            "strings": [
                "ALTER",
                "CREATE",
                "DELETE",
                "INSERT",
                "REPLACE",
                "SELECT",
                "UPDATE"
            ]
        }
    ]
}
@ev-w
Copy link

ev-w commented Apr 10, 2020

I can't for the life of me figure out how to use this in the app.

@suliveevil
Copy link

I can't for the life of me figure out how to use this in the app.

It‘s very similar to VSCode’s setting.json

pattern matches file content and user input
capture group(in pattern)matches user input
string is the capture group pattern‘s instance
replace/append is the snippet you want

@niculw
Copy link

niculw commented Nov 13, 2020

I know this original thread is very old, but we have gotten no answer? Other than a context part missing, i have no idea how to make this work in the app. I tried copying the contexts from c.json into this, adjust the scope to only include source.py and then change the completionsets to the ones defined, but nada. I get nothing. I wonder if the scope is wrong. And as i have seen you can tap with three fingers to see, however ipadOS now brings up a menu for undo when tapping with 3 fingers.
Could someone please help?

@niculw
Copy link

niculw commented Nov 13, 2020

Solved it. I found the shortcut for scope by holding down command. Its Alt shift p. It seems the scope for python files are source.python, not source.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants