Closes #13998 /cc @notpeter would you mind giving this branch a go to see if this is pleasant to use? This impl is not quite what VSC has, but I think it feels okay? In this PR, the sequence goes as follows: 1st keypress: "|" 2nd keypress: ""| 3rd keypress: """|""" Release Notes: - Improved handling of triple-quote strings in Python.
20 lines
873 B
TOML
20 lines
873 B
TOML
name = "Python"
|
|
grammar = "python"
|
|
path_suffixes = ["py", "pyi", "mpy"]
|
|
first_line_pattern = '^#!.*\bpython[0-9.]*\b'
|
|
line_comments = ["# "]
|
|
autoclose_before = ";:.,=}])>"
|
|
brackets = [
|
|
{ start = "\"\"\"", end = "\"\"\"", close = true, newline = false, not_in = ["string"] },
|
|
{ start = "'''", end = "'''", close = true, newline = false, not_in = ["string"] },
|
|
{ start = "{", end = "}", close = true, newline = true },
|
|
{ start = "[", end = "]", close = true, newline = true },
|
|
{ start = "(", end = ")", close = true, newline = true },
|
|
{ start = "\"", end = "\"", close = true, newline = false, not_in = ["string"] },
|
|
{ start = "'", end = "'", close = true, newline = false, not_in = ["string"] },
|
|
]
|
|
|
|
auto_indent_using_last_non_empty_line = false
|
|
increase_indent_pattern = ":\\s*$"
|
|
decrease_indent_pattern = "^\\s*(else|elif|except|finally)\\b.*:"
|