forked from Mirrors/helix
Merge branch 'master' of github.com:helix-editor/helix
commit
151ac52741
@ -0,0 +1,11 @@
|
||||
# Auto detect text files and perform normalization
|
||||
* text=auto
|
||||
|
||||
*.rs text diff=rust
|
||||
*.toml text diff=toml
|
||||
|
||||
*.scm text diff=scheme
|
||||
*.md text diff=markdown
|
||||
|
||||
book/theme/highlight.js linguist-vendored
|
||||
Cargo.lock text
|
@ -0,0 +1,5 @@
|
||||
# Things that we don't want ripgrep to search that we do want in git
|
||||
# https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md#automatic-filtering
|
||||
|
||||
# Minified JS vendored from mdbook
|
||||
book/theme/highlight.js
|
@ -0,0 +1,49 @@
|
||||
# You can move it here ~/.config/elvish/lib/hx.elv
|
||||
# Or add `eval (slurp < ~/$REPOS/helix/contrib/completion/hx.elv)`
|
||||
# Be sure to replace `$REPOS` with something that makes sense for you!
|
||||
|
||||
### Renders a pretty completion candidate
|
||||
var candidate = { | _stem _desc |
|
||||
edit:complex-candidate $_stem &display=(styled $_stem bold)(styled " "$_desc dim)
|
||||
}
|
||||
|
||||
### These commands will invalidate further input (i.e. not react to them)
|
||||
var skips = [ "--tutor" "--help" "--version" "-V" "--health" ]
|
||||
|
||||
### Grammar commands
|
||||
var grammar = [ "--grammar" "-g" ]
|
||||
|
||||
### Config commands
|
||||
var config = [ "--config" "-c" ]
|
||||
|
||||
### Set an arg-completer for the `hx` binary
|
||||
set edit:completion:arg-completer[hx] = {|@args|
|
||||
var n = (count $args)
|
||||
if (>= $n 3) {
|
||||
# Stop completions if passed arg will take presedence
|
||||
# and invalidate further input
|
||||
if (has-value $skips $args[-2]) {
|
||||
return
|
||||
}
|
||||
# If the previous arg == --grammar, then only suggest:
|
||||
if (has-value $grammar $args[-2]) {
|
||||
$candidate "fetch" "Fetch the tree-sitter grammars"
|
||||
$candidate "build" "Build the tree-sitter grammars"
|
||||
return
|
||||
}
|
||||
# When we have --config, we need a file
|
||||
if (has-values $config $args[-2]) {
|
||||
edit:complete-filename $args[-1] | each { |v| put $v[stem] }
|
||||
return
|
||||
}
|
||||
}
|
||||
edit:complete-filename $args[-1] | each { |v| put $v[stem]}
|
||||
$candidate "--help" "(Prints help information)"
|
||||
$candidate "--version" "(Prints version information)"
|
||||
$candidate "--tutor" "(Loads the tutorial)"
|
||||
$candidate "--health" "(Checks for errors in editor setup)"
|
||||
$candidate "--grammar" "(Fetch or build the tree-sitter grammars)"
|
||||
$candidate "--vsplit" "(Splits all given files vertically)"
|
||||
$candidate "--hsplit" "(Splits all given files horizontally)"
|
||||
$candidate "--config" "(Specifies a file to use for configuration)"
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,153 +1,163 @@
|
||||
use bitflags::bitflags;
|
||||
|
||||
bitflags! {
|
||||
/// Represents key modifiers (shift, control, alt).
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
pub struct KeyModifiers: u8 {
|
||||
const SHIFT = 0b0000_0001;
|
||||
const CONTROL = 0b0000_0010;
|
||||
const ALT = 0b0000_0100;
|
||||
const NONE = 0b0000_0000;
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "term")]
|
||||
impl From<KeyModifiers> for crossterm::event::KeyModifiers {
|
||||
fn from(key_modifiers: KeyModifiers) -> Self {
|
||||
use crossterm::event::KeyModifiers as CKeyModifiers;
|
||||
|
||||
let mut result = CKeyModifiers::NONE;
|
||||
|
||||
if key_modifiers.contains(KeyModifiers::SHIFT) {
|
||||
result.insert(CKeyModifiers::SHIFT);
|
||||
}
|
||||
if key_modifiers.contains(KeyModifiers::CONTROL) {
|
||||
result.insert(CKeyModifiers::CONTROL);
|
||||
}
|
||||
if key_modifiers.contains(KeyModifiers::ALT) {
|
||||
result.insert(CKeyModifiers::ALT);
|
||||
}
|
||||
|
||||
result
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "term")]
|
||||
impl From<crossterm::event::KeyModifiers> for KeyModifiers {
|
||||
fn from(val: crossterm::event::KeyModifiers) -> Self {
|
||||
use crossterm::event::KeyModifiers as CKeyModifiers;
|
||||
|
||||
let mut result = KeyModifiers::NONE;
|
||||
|
||||
if val.contains(CKeyModifiers::SHIFT) {
|
||||
result.insert(KeyModifiers::SHIFT);
|
||||
}
|
||||
if val.contains(CKeyModifiers::CONTROL) {
|
||||
result.insert(KeyModifiers::CONTROL);
|
||||
}
|
||||
if val.contains(CKeyModifiers::ALT) {
|
||||
result.insert(KeyModifiers::ALT);
|
||||
}
|
||||
|
||||
result
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents a key.
|
||||
#[derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Copy, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
pub enum KeyCode {
|
||||
/// Backspace key.
|
||||
Backspace,
|
||||
/// Enter key.
|
||||
Enter,
|
||||
/// Left arrow key.
|
||||
Left,
|
||||
/// Right arrow key.
|
||||
Right,
|
||||
/// Up arrow key.
|
||||
Up,
|
||||
/// Down arrow key.
|
||||
Down,
|
||||
/// Home key.
|
||||
Home,
|
||||
/// End key.
|
||||
End,
|
||||
/// Page up key.
|
||||
PageUp,
|
||||
/// Page down key.
|
||||
PageDown,
|
||||
/// Tab key.
|
||||
Tab,
|
||||
/// Delete key.
|
||||
Delete,
|
||||
/// Insert key.
|
||||
Insert,
|
||||
/// F key.
|
||||
///
|
||||
/// `KeyCode::F(1)` represents F1 key, etc.
|
||||
F(u8),
|
||||
/// A character.
|
||||
///
|
||||
/// `KeyCode::Char('c')` represents `c` character, etc.
|
||||
Char(char),
|
||||
/// Null.
|
||||
Null,
|
||||
/// Escape key.
|
||||
Esc,
|
||||
}
|
||||
|
||||
#[cfg(feature = "term")]
|
||||
impl From<KeyCode> for crossterm::event::KeyCode {
|
||||
fn from(key_code: KeyCode) -> Self {
|
||||
use crossterm::event::KeyCode as CKeyCode;
|
||||
|
||||
match key_code {
|
||||
KeyCode::Backspace => CKeyCode::Backspace,
|
||||
KeyCode::Enter => CKeyCode::Enter,
|
||||
KeyCode::Left => CKeyCode::Left,
|
||||
KeyCode::Right => CKeyCode::Right,
|
||||
KeyCode::Up => CKeyCode::Up,
|
||||
KeyCode::Down => CKeyCode::Down,
|
||||
KeyCode::Home => CKeyCode::Home,
|
||||
KeyCode::End => CKeyCode::End,
|
||||
KeyCode::PageUp => CKeyCode::PageUp,
|
||||
KeyCode::PageDown => CKeyCode::PageDown,
|
||||
KeyCode::Tab => CKeyCode::Tab,
|
||||
KeyCode::Delete => CKeyCode::Delete,
|
||||
KeyCode::Insert => CKeyCode::Insert,
|
||||
KeyCode::F(f_number) => CKeyCode::F(f_number),
|
||||
KeyCode::Char(character) => CKeyCode::Char(character),
|
||||
KeyCode::Null => CKeyCode::Null,
|
||||
KeyCode::Esc => CKeyCode::Esc,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "term")]
|
||||
impl From<crossterm::event::KeyCode> for KeyCode {
|
||||
fn from(val: crossterm::event::KeyCode) -> Self {
|
||||
use crossterm::event::KeyCode as CKeyCode;
|
||||
|
||||
match val {
|
||||
CKeyCode::Backspace => KeyCode::Backspace,
|
||||
CKeyCode::Enter => KeyCode::Enter,
|
||||
CKeyCode::Left => KeyCode::Left,
|
||||
CKeyCode::Right => KeyCode::Right,
|
||||
CKeyCode::Up => KeyCode::Up,
|
||||
CKeyCode::Down => KeyCode::Down,
|
||||
CKeyCode::Home => KeyCode::Home,
|
||||
CKeyCode::End => KeyCode::End,
|
||||
CKeyCode::PageUp => KeyCode::PageUp,
|
||||
CKeyCode::PageDown => KeyCode::PageDown,
|
||||
CKeyCode::Tab => KeyCode::Tab,
|
||||
CKeyCode::BackTab => unreachable!("BackTab should have been handled on KeyEvent level"),
|
||||
CKeyCode::Delete => KeyCode::Delete,
|
||||
CKeyCode::Insert => KeyCode::Insert,
|
||||
CKeyCode::F(f_number) => KeyCode::F(f_number),
|
||||
CKeyCode::Char(character) => KeyCode::Char(character),
|
||||
CKeyCode::Null => KeyCode::Null,
|
||||
CKeyCode::Esc => KeyCode::Esc,
|
||||
}
|
||||
}
|
||||
}
|
||||
use bitflags::bitflags;
|
||||
|
||||
bitflags! {
|
||||
/// Represents key modifiers (shift, control, alt).
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
pub struct KeyModifiers: u8 {
|
||||
const SHIFT = 0b0000_0001;
|
||||
const CONTROL = 0b0000_0010;
|
||||
const ALT = 0b0000_0100;
|
||||
const NONE = 0b0000_0000;
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "term")]
|
||||
impl From<KeyModifiers> for crossterm::event::KeyModifiers {
|
||||
fn from(key_modifiers: KeyModifiers) -> Self {
|
||||
use crossterm::event::KeyModifiers as CKeyModifiers;
|
||||
|
||||
let mut result = CKeyModifiers::NONE;
|
||||
|
||||
if key_modifiers.contains(KeyModifiers::SHIFT) {
|
||||
result.insert(CKeyModifiers::SHIFT);
|
||||
}
|
||||
if key_modifiers.contains(KeyModifiers::CONTROL) {
|
||||
result.insert(CKeyModifiers::CONTROL);
|
||||
}
|
||||
if key_modifiers.contains(KeyModifiers::ALT) {
|
||||
result.insert(CKeyModifiers::ALT);
|
||||
}
|
||||
|
||||
result
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "term")]
|
||||
impl From<crossterm::event::KeyModifiers> for KeyModifiers {
|
||||
fn from(val: crossterm::event::KeyModifiers) -> Self {
|
||||
use crossterm::event::KeyModifiers as CKeyModifiers;
|
||||
|
||||
let mut result = KeyModifiers::NONE;
|
||||
|
||||
if val.contains(CKeyModifiers::SHIFT) {
|
||||
result.insert(KeyModifiers::SHIFT);
|
||||
}
|
||||
if val.contains(CKeyModifiers::CONTROL) {
|
||||
result.insert(KeyModifiers::CONTROL);
|
||||
}
|
||||
if val.contains(CKeyModifiers::ALT) {
|
||||
result.insert(KeyModifiers::ALT);
|
||||
}
|
||||
|
||||
result
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents a key.
|
||||
#[derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Copy, Hash)]
|
||||
pub enum KeyCode {
|
||||
/// Backspace key.
|
||||
Backspace,
|
||||
/// Enter key.
|
||||
Enter,
|
||||
/// Left arrow key.
|
||||
Left,
|
||||
/// Right arrow key.
|
||||
Right,
|
||||
/// Up arrow key.
|
||||
Up,
|
||||
/// Down arrow key.
|
||||
Down,
|
||||
/// Home key.
|
||||
Home,
|
||||
/// End key.
|
||||
End,
|
||||
/// Page up key.
|
||||
PageUp,
|
||||
/// Page down key.
|
||||
PageDown,
|
||||
/// Tab key.
|
||||
Tab,
|
||||
/// Delete key.
|
||||
Delete,
|
||||
/// Insert key.
|
||||
Insert,
|
||||
/// F key.
|
||||
///
|
||||
/// `KeyCode::F(1)` represents F1 key, etc.
|
||||
F(u8),
|
||||
/// A character.
|
||||
///
|
||||
/// `KeyCode::Char('c')` represents `c` character, etc.
|
||||
Char(char),
|
||||
/// Null.
|
||||
Null,
|
||||
/// Escape key.
|
||||
Esc,
|
||||
}
|
||||
|
||||
#[cfg(feature = "term")]
|
||||
impl From<KeyCode> for crossterm::event::KeyCode {
|
||||
fn from(key_code: KeyCode) -> Self {
|
||||
use crossterm::event::KeyCode as CKeyCode;
|
||||
|
||||
match key_code {
|
||||
KeyCode::Backspace => CKeyCode::Backspace,
|
||||
KeyCode::Enter => CKeyCode::Enter,
|
||||
KeyCode::Left => CKeyCode::Left,
|
||||
KeyCode::Right => CKeyCode::Right,
|
||||
KeyCode::Up => CKeyCode::Up,
|
||||
KeyCode::Down => CKeyCode::Down,
|
||||
KeyCode::Home => CKeyCode::Home,
|
||||
KeyCode::End => CKeyCode::End,
|
||||
KeyCode::PageUp => CKeyCode::PageUp,
|
||||
KeyCode::PageDown => CKeyCode::PageDown,
|
||||
KeyCode::Tab => CKeyCode::Tab,
|
||||
KeyCode::Delete => CKeyCode::Delete,
|
||||
KeyCode::Insert => CKeyCode::Insert,
|
||||
KeyCode::F(f_number) => CKeyCode::F(f_number),
|
||||
KeyCode::Char(character) => CKeyCode::Char(character),
|
||||
KeyCode::Null => CKeyCode::Null,
|
||||
KeyCode::Esc => CKeyCode::Esc,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "term")]
|
||||
impl From<crossterm::event::KeyCode> for KeyCode {
|
||||
fn from(val: crossterm::event::KeyCode) -> Self {
|
||||
use crossterm::event::KeyCode as CKeyCode;
|
||||
|
||||
match val {
|
||||
CKeyCode::Backspace => KeyCode::Backspace,
|
||||
CKeyCode::Enter => KeyCode::Enter,
|
||||
CKeyCode::Left => KeyCode::Left,
|
||||
CKeyCode::Right => KeyCode::Right,
|
||||
CKeyCode::Up => KeyCode::Up,
|
||||
CKeyCode::Down => KeyCode::Down,
|
||||
CKeyCode::Home => KeyCode::Home,
|
||||
CKeyCode::End => KeyCode::End,
|
||||
CKeyCode::PageUp => KeyCode::PageUp,
|
||||
CKeyCode::PageDown => KeyCode::PageDown,
|
||||
CKeyCode::Tab => KeyCode::Tab,
|
||||
CKeyCode::BackTab => unreachable!("BackTab should have been handled on KeyEvent level"),
|
||||
CKeyCode::Delete => KeyCode::Delete,
|
||||
CKeyCode::Insert => KeyCode::Insert,
|
||||
CKeyCode::F(f_number) => KeyCode::F(f_number),
|
||||
CKeyCode::Char(character) => KeyCode::Char(character),
|
||||
CKeyCode::Null => KeyCode::Null,
|
||||
CKeyCode::Esc => KeyCode::Esc,
|
||||
CKeyCode::CapsLock
|
||||
| CKeyCode::ScrollLock
|
||||
| CKeyCode::NumLock
|
||||
| CKeyCode::PrintScreen
|
||||
| CKeyCode::Pause
|
||||
| CKeyCode::Menu
|
||||
| CKeyCode::KeypadBegin
|
||||
| CKeyCode::Media(_)
|
||||
| CKeyCode::Modifier(_) => unreachable!(
|
||||
"Shouldn't get this key without enabling DISAMBIGUATE_ESCAPE_CODES in crossterm"
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,4 @@
|
||||
[
|
||||
(transaction)
|
||||
(section)
|
||||
] @fold
|
@ -0,0 +1,49 @@
|
||||
(date) @variable.builtin
|
||||
(txn) @variable.builtin
|
||||
|
||||
(account) @type
|
||||
|
||||
[
|
||||
(amount)
|
||||
(incomplete_amount)
|
||||
(amount_tolerance)
|
||||
(number)
|
||||
] @constant.numeric
|
||||
|
||||
|
||||
[(key_value) (key)] @variable.other.member
|
||||
(string) @string
|
||||
|
||||
[
|
||||
(currency)
|
||||
(tag)
|
||||
(link)
|
||||
] @constant
|
||||
|
||||
(comment) @comment
|
||||
|
||||
[
|
||||
(minus)
|
||||
(plus)
|
||||
] @operator
|
||||
|
||||
[
|
||||
(balance) (open) (close) (commodity) (pad)
|
||||
(event) (price) (note) (document) (query)
|
||||
(custom) (pushtag) (poptag) (pushmeta)
|
||||
(popmeta) (option) (include) (plugin)
|
||||
] @keyword
|
||||
|
||||
|
||||
((headline item: (item) @markup.heading.6) @markup.heading.marker
|
||||
(#match? @markup.heading.marker "^\\*\\*\\*\\*\\*\\*"))
|
||||
((headline item: (item) @markup.heading.5) @markup.heading.marker
|
||||
(#match? @markup.heading.marker "^\\*\\*\\*\\*\\*"))
|
||||
((headline item: (item) @markup.heading.4) @markup.heading.marker
|
||||
(#match? @markup.heading.marker "^\\*\\*\\*\\*"))
|
||||
((headline item: (item) @markup.heading.3) @markup.heading.marker
|
||||
(#match? @markup.heading.marker "^\\*\\*\\*"))
|
||||
((headline item: (item) @markup.heading.2) @markup.heading.marker
|
||||
(#match? @markup.heading.marker "^\\*\\*"))
|
||||
((headline item: (item) @markup.heading.1) @markup.heading.marker
|
||||
(#match? @markup.heading.marker "^\\*"))
|
@ -0,0 +1,110 @@
|
||||
(package_clause "package" @keyword.control.import)
|
||||
|
||||
(package_identifier) @variable
|
||||
|
||||
(import_declaration "import" @keyword.control.import)
|
||||
|
||||
[
|
||||
"!"
|
||||
"*"
|
||||
"|"
|
||||
"&"
|
||||
"||"
|
||||
"&&"
|
||||
"=="
|
||||
"!="
|
||||
"<"
|
||||
"<="
|
||||
">"
|
||||
">="
|
||||
"=~"
|
||||
"!~"
|
||||
"+"
|
||||
"-"
|
||||
"*"
|
||||
"/"
|
||||
] @operator
|
||||
|
||||
(unary_expression "*" @operator.default)
|
||||
|
||||
(unary_expression "=~" @operator.regexp)
|
||||
|
||||
(unary_expression "!~" @operator.regexp)
|
||||
|
||||
(binary_expression _ "&" @operator.unify _)
|
||||
|
||||
(binary_expression _ "|" @operator.disjunct _)
|
||||
|
||||
(builtin) @function.builtin
|
||||
|
||||
(qualified_identifier) @function.builtin
|
||||
|
||||
(let_clause "let" @keyword.storage.type)
|
||||
|
||||
(for_clause "for" @keyword.control.repeat)
|
||||
(for_clause "in" @keyword.control.repeat)
|
||||
|
||||
(guard_clause "if" @keyword.control.conditional)
|
||||
|
||||
(comment) @comment
|
||||
|
||||
[
|
||||
(string_type)
|
||||
(simple_string_lit)
|
||||
(multiline_string_lit)
|
||||
(bytes_type)
|
||||
(simple_bytes_lit)
|
||||
(multiline_bytes_lit)
|
||||
] @string
|
||||
|
||||
[
|
||||
(number_type)
|
||||
(int_lit)
|
||||
(int_type)
|
||||
(uint_type)
|
||||
] @constant.numeric.integer
|
||||
|
||||
[
|
||||
(float_lit)
|
||||
(float_type)
|
||||
] @constant.numeric.float
|
||||
|
||||
[
|
||||
(bool_type)
|
||||
(true)
|
||||
(false)
|
||||
] @constant.builtin.boolean
|
||||
|
||||
(null) @constant.builtin
|
||||
|
||||
(ellipsis) @punctuation.bracket
|
||||
|
||||
[
|
||||
","
|
||||
":"
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
(interpolation "\\(" @punctuation.bracket (_) ")" @punctuation.bracket) @variable.other.member
|
||||
|
||||
(field (label (identifier) @variable.other.member))
|
||||
|
||||
(
|
||||
(identifier) @keyword.storage.type
|
||||
(#match? @keyword.storage.type "^#")
|
||||
)
|
||||
|
||||
(field (label alias: (identifier) @label))
|
||||
|
||||
(let_clause left: (identifier) @label)
|
||||
|
||||
|
||||
(attribute (identifier) @tag)
|
@ -0,0 +1,43 @@
|
||||
(keyword) @keyword
|
||||
(string_literal) @string
|
||||
(number_literal) @constant.numeric
|
||||
|
||||
[
|
||||
(edgeop)
|
||||
(operator)
|
||||
] @operator
|
||||
|
||||
[
|
||||
","
|
||||
";"
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"{"
|
||||
"}"
|
||||
"["
|
||||
"]"
|
||||
"<"
|
||||
">"
|
||||
] @punctuation.bracket
|
||||
|
||||
(subgraph
|
||||
id: (id
|
||||
(identifier) @namespace)
|
||||
)
|
||||
|
||||
(attribute
|
||||
name: (id
|
||||
(identifier) @type)
|
||||
value: (id
|
||||
(identifier) @constant)
|
||||
)
|
||||
|
||||
[
|
||||
(comment)
|
||||
(preproc)
|
||||
] @comment
|
||||
|
||||
(ERROR) @error
|
||||
|
||||
(identifier) @variable
|
@ -0,0 +1,2 @@
|
||||
((html_internal) @injection.content
|
||||
(#set! injection.language "html"))
|
@ -0,0 +1,221 @@
|
||||
; Special identifiers
|
||||
;--------------------
|
||||
|
||||
([
|
||||
(identifier)
|
||||
(shorthand_property_identifier)
|
||||
(shorthand_property_identifier_pattern)
|
||||
] @constant
|
||||
(#match? @constant "^[A-Z_][A-Z\\d_]+$"))
|
||||
|
||||
|
||||
((identifier) @constructor
|
||||
(#match? @constructor "^[A-Z]"))
|
||||
|
||||
((identifier) @variable.builtin
|
||||
(#match? @variable.builtin "^(arguments|module|console|window|document)$")
|
||||
(#is-not? local))
|
||||
|
||||
((identifier) @function.builtin
|
||||
(#eq? @function.builtin "require")
|
||||
(#is-not? local))
|
||||
|
||||
; Function and method definitions
|
||||
;--------------------------------
|
||||
|
||||
(function
|
||||
name: (identifier) @function)
|
||||
(function_declaration
|
||||
name: (identifier) @function)
|
||||
(method_definition
|
||||
name: (property_identifier) @function.method)
|
||||
|
||||
(pair
|
||||
key: (property_identifier) @function.method
|
||||
value: [(function) (arrow_function)])
|
||||
|
||||
(assignment_expression
|
||||
left: (member_expression
|
||||
property: (property_identifier) @function.method)
|
||||
right: [(function) (arrow_function)])
|
||||
|
||||
(variable_declarator
|
||||
name: (identifier) @function
|
||||
value: [(function) (arrow_function)])
|
||||
|
||||
(assignment_expression
|
||||
left: (identifier) @function
|
||||
right: [(function) (arrow_function)])
|
||||
|
||||
|
||||
; Function and method calls
|
||||
;--------------------------
|
||||
|
||||
(call_expression
|
||||
function: (identifier) @function)
|
||||
|
||||
(call_expression
|
||||
function: (member_expression
|
||||
property: (property_identifier) @function.method))
|
||||
|
||||
; Variables
|
||||
;----------
|
||||
|
||||
(identifier) @variable
|
||||
|
||||
; Properties
|
||||
;-----------
|
||||
|
||||
(property_identifier) @variable.other.member
|
||||
(shorthand_property_identifier) @variable.other.member
|
||||
(shorthand_property_identifier_pattern) @variable.other.member
|
||||
|
||||
; Literals
|
||||
;---------
|
||||
|
||||
(this) @variable.builtin
|
||||
(super) @variable.builtin
|
||||
|
||||
[
|
||||
(true)
|
||||
(false)
|
||||
(null)
|
||||
(undefined)
|
||||
] @constant.builtin
|
||||
|
||||
(comment) @comment
|
||||
|
||||
[
|
||||
(string)
|
||||
(template_string)
|
||||
] @string
|
||||
|
||||
(regex) @string.regexp
|
||||
(number) @constant.numeric.integer
|
||||
|
||||
; Tokens
|
||||
;-------
|
||||
|
||||
(template_substitution
|
||||
"${" @punctuation.special
|
||||
"}" @punctuation.special) @embedded
|
||||
|
||||
[
|
||||
";"
|
||||
"?."
|
||||
"."
|
||||
","
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"-"
|
||||
"--"
|
||||
"-="
|
||||
"+"
|
||||
"++"
|
||||
"+="
|
||||
"*"
|
||||
"*="
|
||||
"**"
|
||||
"**="
|
||||
"/"
|
||||
"/="
|
||||
"%"
|
||||
"%="
|
||||
"<"
|
||||
"<="
|
||||
"<<"
|
||||
"<<="
|
||||
"="
|
||||
"=="
|
||||
"==="
|
||||
"!"
|
||||
"!="
|
||||
"!=="
|
||||
"=>"
|
||||
">"
|
||||
">="
|
||||
">>"
|
||||
">>="
|
||||
">>>"
|
||||
">>>="
|
||||
"~"
|
||||
"^"
|
||||
"&"
|
||||
"|"
|
||||
"^="
|
||||
"&="
|
||||
"|="
|
||||
"&&"
|
||||
"||"
|
||||
"??"
|
||||
"&&="
|
||||
"||="
|
||||
"??="
|
||||
"..."
|
||||
] @operator
|
||||
|
||||
(ternary_expression ["?" ":"] @operator)
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
"as"
|
||||
"async"
|
||||
"debugger"
|
||||
"delete"
|
||||
"extends"
|
||||
"from"
|
||||
"function"
|
||||
"get"
|
||||
"in"
|
||||
"instanceof"
|
||||
"new"
|
||||
"of"
|
||||
"set"
|
||||
"static"
|
||||
"target"
|
||||
"try"
|
||||
"typeof"
|
||||
"void"
|
||||
"with"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"class"
|
||||
"let"
|
||||
"const"
|
||||
"var"
|
||||
] @keyword.storage.type
|
||||
|
||||
[
|
||||
"switch"
|
||||
"case"
|
||||
"default"
|
||||
"if"
|
||||
"else"
|
||||
"yield"
|
||||
"throw"
|
||||
"finally"
|
||||
"return"
|
||||
"catch"
|
||||
"continue"
|
||||
"while"
|
||||
"break"
|
||||
"for"
|
||||
"do"
|
||||
"await"
|
||||
] @keyword.control
|
||||
|
||||
[
|
||||
"import"
|
||||
"export"
|
||||
] @keyword.control.import
|
||||
|
@ -0,0 +1,22 @@
|
||||
[
|
||||
(array)
|
||||
(object)
|
||||
(arguments)
|
||||
(formal_parameters)
|
||||
|
||||
(statement_block)
|
||||
(object_pattern)
|
||||
(class_body)
|
||||
(named_imports)
|
||||
|
||||
(binary_expression)
|
||||
(return_statement)
|
||||
(template_substitution)
|
||||
(export_clause)
|
||||
] @indent
|
||||
|
||||
[
|
||||
"}"
|
||||
"]"
|
||||
")"
|
||||
] @outdent
|
@ -0,0 +1,36 @@
|
||||
; Parse the contents of tagged template literals using
|
||||
; a language inferred from the tag.
|
||||
|
||||
(call_expression
|
||||
function: [
|
||||
(identifier) @injection.language
|
||||
(member_expression
|
||||
property: (property_identifier) @injection.language)
|
||||
]
|
||||
arguments: (template_string) @injection.content)
|
||||
|
||||
; Parse the contents of gql template literals
|
||||
|
||||
((call_expression
|
||||
function: (identifier) @_template_function_name
|
||||
arguments: (template_string) @injection.content)
|
||||
(#eq? @_template_function_name "gql")
|
||||
(#set! injection.language "graphql"))
|
||||
|
||||
; Parse regex syntax within regex literals
|
||||
|
||||
((regex_pattern) @injection.content
|
||||
(#set! injection.language "regex"))
|
||||
|
||||
; Parse JSDoc annotations in multiline comments
|
||||
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "jsdoc")
|
||||
(#match? @injection.content "^/\\*+"))
|
||||
|
||||
; Parse general tags in single line comments
|
||||
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment")
|
||||
(#match? @injection.content "^//"))
|
||||
|
@ -0,0 +1,29 @@
|
||||
; Scopes
|
||||
;-------
|
||||
|
||||
[
|
||||
(statement_block)
|
||||
(function)
|
||||
(arrow_function)
|
||||
(function_declaration)
|
||||
(method_definition)
|
||||
] @local.scope
|
||||
|
||||
; Definitions
|
||||
;------------
|
||||
|
||||
(pattern/identifier) @local.definition
|
||||
|
||||
(pattern/rest_pattern
|
||||
(identifier) @local.definition)
|
||||
|
||||
(arrow_function
|
||||
parameter: (identifier) @local.definition)
|
||||
|
||||
(variable_declarator
|
||||
name: (identifier) @local.definition)
|
||||
|
||||
; References
|
||||
;------------
|
||||
|
||||
(identifier) @local.reference
|
@ -0,0 +1,36 @@
|
||||
(function_declaration
|
||||
body: (_) @function.inside) @function.around
|
||||
|
||||
(function
|
||||
body: (_) @function.inside) @function.around
|
||||
|
||||
(arrow_function
|
||||
body: (_) @function.inside) @function.around
|
||||
|
||||
(method_definition
|
||||
body: (_) @function.inside) @function.around
|
||||
|
||||
(generator_function_declaration
|
||||
body: (_) @function.inside) @function.around
|
||||
|
||||
(class_declaration
|
||||
body: (class_body) @class.inside) @class.around
|
||||
|
||||
(class
|
||||
(class_body) @class.inside) @class.around
|
||||
|
||||
(export_statement
|
||||
declaration: [
|
||||
(function_declaration) @function.around
|
||||
(class_declaration) @class.around
|
||||
])
|
||||
|
||||
(formal_parameters
|
||||
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
||||
|
||||
(arguments
|
||||
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
||||
|
||||
(comment) @comment.inside
|
||||
|
||||
(comment)+ @comment.around
|
@ -0,0 +1,76 @@
|
||||
; Identifiers
|
||||
|
||||
[
|
||||
(field)
|
||||
(field_identifier)
|
||||
] @variable.other.member
|
||||
|
||||
(variable) @variable
|
||||
|
||||
; Function calls
|
||||
|
||||
(function_call
|
||||
function: (identifier) @function)
|
||||
|
||||
(method_call
|
||||
method: (selector_expression
|
||||
field: (field_identifier) @function))
|
||||
|
||||
; Operators
|
||||
|
||||
"|" @operator
|
||||
":=" @operator
|
||||
|
||||
; Builtin functions
|
||||
|
||||
((identifier) @function.builtin
|
||||
(#match? @function.builtin "^(and|call|html|index|slice|js|len|not|or|print|printf|println|urlquery|eq|ne|lt|ge|gt|ge)$"))
|
||||
|
||||
; Delimiters
|
||||
|
||||
"." @punctuation.delimiter
|
||||
"," @punctuation.delimiter
|
||||
|
||||
"{{" @punctuation.bracket
|
||||
"}}" @punctuation.bracket
|
||||
"{{-" @punctuation.bracket
|
||||
"-}}" @punctuation.bracket
|
||||
")" @punctuation.bracket
|
||||
"(" @punctuation.bracket
|
||||
|
||||
; Keywords
|
||||
|
||||
"else" @keyword
|
||||
"if" @keyword
|
||||
"range" @keyword
|
||||
"with" @keyword
|
||||
"end" @keyword
|
||||
"template" @keyword
|
||||
"define" @keyword
|
||||
"block" @keyword
|
||||
|
||||
; Literals
|
||||
|
||||
[
|
||||
(interpreted_string_literal)
|
||||
(raw_string_literal)
|
||||
(rune_literal)
|
||||
] @string
|
||||
|
||||
(escape_sequence) @string.special
|
||||
|
||||
[
|
||||
(int_literal)
|
||||
(float_literal)
|
||||
(imaginary_literal)
|
||||
] @constant.numeric.integer
|
||||
|
||||
[
|
||||
(true)
|
||||
(false)
|
||||
] @constant.builtin.boolean
|
||||
|
||||
(nil) @constant.builtin
|
||||
|
||||
(comment) @comment
|
||||
(ERROR) @error
|
@ -0,0 +1,2 @@
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
@ -0,0 +1 @@
|
||||
(comment) @comment.around @comment.inside
|
@ -1,12 +0,0 @@
|
||||
(formal_parameters
|
||||
[
|
||||
(identifier) @variable.parameter
|
||||
(array_pattern
|
||||
(identifier) @variable.parameter)
|
||||
(object_pattern
|
||||
[
|
||||
(pair_pattern value: (identifier) @variable.parameter)
|
||||
(shorthand_property_identifier_pattern) @variable.parameter
|
||||
])
|
||||
]
|
||||
)
|
@ -1,215 +1,38 @@
|
||||
; Special identifiers
|
||||
;--------------------
|
||||
|
||||
([
|
||||
(identifier)
|
||||
(shorthand_property_identifier)
|
||||
(shorthand_property_identifier_pattern)
|
||||
] @constant
|
||||
(#match? @constant "^[A-Z_][A-Z\\d_]+$"))
|
||||
|
||||
|
||||
((identifier) @constructor
|
||||
(#match? @constructor "^[A-Z]"))
|
||||
|
||||
((identifier) @variable.builtin
|
||||
(#match? @variable.builtin "^(arguments|module|console|window|document)$")
|
||||
(#is-not? local))
|
||||
|
||||
((identifier) @function.builtin
|
||||
(#eq? @function.builtin "require")
|
||||
(#is-not? local))
|
||||
|
||||
; Function and method definitions
|
||||
;--------------------------------
|
||||
|
||||
(function
|
||||
name: (identifier) @function)
|
||||
(function_declaration
|
||||
name: (identifier) @function)
|
||||
(method_definition
|
||||
name: (property_identifier) @function.method)
|
||||
|
||||
(pair
|
||||
key: (property_identifier) @function.method
|
||||
value: [(function) (arrow_function)])
|
||||
|
||||
(assignment_expression
|
||||
left: (member_expression
|
||||
property: (property_identifier) @function.method)
|
||||
right: [(function) (arrow_function)])
|
||||
|
||||
(variable_declarator
|
||||
name: (identifier) @function
|
||||
value: [(function) (arrow_function)])
|
||||
|
||||
(assignment_expression
|
||||
left: (identifier) @function
|
||||
right: [(function) (arrow_function)])
|
||||
|
||||
; Function and method calls
|
||||
;--------------------------
|
||||
|
||||
(call_expression
|
||||
function: (identifier) @function)
|
||||
|
||||
(call_expression
|
||||
function: (member_expression
|
||||
property: (property_identifier) @function.method))
|
||||
|
||||
; Variables
|
||||
;----------
|
||||
|
||||
(identifier) @variable
|
||||
|
||||
; Properties
|
||||
;-----------
|
||||
|
||||
(property_identifier) @variable.other.member
|
||||
|
||||
; Literals
|
||||
;---------
|
||||
|
||||
(this) @variable.builtin
|
||||
(super) @variable.builtin
|
||||
|
||||
[
|
||||
(true)
|
||||
(false)
|
||||
(null)
|
||||
(undefined)
|
||||
] @constant.builtin
|
||||
|
||||
(comment) @comment
|
||||
|
||||
[
|
||||
(string)
|
||||
(template_string)
|
||||
] @string
|
||||
|
||||
(regex) @string.regexp
|
||||
(number) @constant.numeric.integer
|
||||
|
||||
; Tokens
|
||||
;-------
|
||||
|
||||
(template_substitution
|
||||
"${" @punctuation.special
|
||||
"}" @punctuation.special) @embedded
|
||||
|
||||
[
|
||||
";"
|
||||
"?."
|
||||
"."
|
||||
","
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"-"
|
||||
"--"
|
||||
"-="
|
||||
"+"
|
||||
"++"
|
||||
"+="
|
||||
"*"
|
||||
"*="
|
||||
"**"
|
||||
"**="
|
||||
"/"
|
||||
"/="
|
||||
"%"
|
||||
"%="
|
||||
"<"
|
||||
"<="
|
||||
"<<"
|
||||
"<<="
|
||||
"="
|
||||
"=="
|
||||
"==="
|
||||
"!"
|
||||
"!="
|
||||
"!=="
|
||||
"=>"
|
||||
">"
|
||||
">="
|
||||
">>"
|
||||
">>="
|
||||
">>>"
|
||||
">>>="
|
||||
"~"
|
||||
"^"
|
||||
"&"
|
||||
"|"
|
||||
"^="
|
||||
"&="
|
||||
"|="
|
||||
"&&"
|
||||
"||"
|
||||
"??"
|
||||
"&&="
|
||||
"||="
|
||||
"??="
|
||||
] @operator
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
"as"
|
||||
"async"
|
||||
"debugger"
|
||||
"delete"
|
||||
"extends"
|
||||
"from"
|
||||
"function"
|
||||
"get"
|
||||
"in"
|
||||
"instanceof"
|
||||
"new"
|
||||
"of"
|
||||
"set"
|
||||
"static"
|
||||
"target"
|
||||
"try"
|
||||
"typeof"
|
||||
"void"
|
||||
"with"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"class"
|
||||
"let"
|
||||
"const"
|
||||
"var"
|
||||
] @keyword.storage.type
|
||||
|
||||
[
|
||||
"switch"
|
||||
"case"
|
||||
"default"
|
||||
"if"
|
||||
"else"
|
||||
"yield"
|
||||
"throw"
|
||||
"finally"
|
||||
"return"
|
||||
"catch"
|
||||
"continue"
|
||||
"while"
|
||||
"break"
|
||||
"for"
|
||||
"do"
|
||||
"await"
|
||||
] @keyword.control
|
||||
|
||||
[
|
||||
"import"
|
||||
"export"
|
||||
] @keyword.control.import
|
||||
|
||||
; Function and method parameters
|
||||
;-------------------------------
|
||||
|
||||
; (p) => ...
|
||||
(formal_parameters
|
||||
(identifier) @variable.parameter)
|
||||
|
||||
; (...p) => ...
|
||||
(formal_parameters
|
||||
(rest_pattern
|
||||
(identifier) @variable.parameter))
|
||||
|
||||
; ({ p }) => ...
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(shorthand_property_identifier_pattern) @variable.parameter))
|
||||
|
||||
; ({ a: p }) => ...
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(pair_pattern
|
||||
value: (identifier) @variable.parameter)))
|
||||
|
||||
; ([ p ]) => ...
|
||||
(formal_parameters
|
||||
(array_pattern
|
||||
(identifier) @variable.parameter))
|
||||
|
||||
; (p = 1) => ...
|
||||
(formal_parameters
|
||||
(assignment_pattern
|
||||
left: (identifier) @variable.parameter))
|
||||
|
||||
; p => ...
|
||||
(arrow_function
|
||||
parameter: (identifier) @variable.parameter)
|
||||
|
||||
; inherits: ecma
|
||||
|
@ -1,22 +1 @@
|
||||
[
|
||||
(array)
|
||||
(object)
|
||||
(arguments)
|
||||
(formal_parameters)
|
||||
|
||||
(statement_block)
|
||||
(object_pattern)
|
||||
(class_body)
|
||||
(named_imports)
|
||||
|
||||
(binary_expression)
|
||||
(return_statement)
|
||||
(template_substitution)
|
||||
(export_clause)
|
||||
] @indent
|
||||
|
||||
[
|
||||
"}"
|
||||
"]"
|
||||
")"
|
||||
] @outdent
|
||||
; inherits: ecma
|
||||
|
@ -1,36 +1 @@
|
||||
; Parse the contents of tagged template literals using
|
||||
; a language inferred from the tag.
|
||||
|
||||
(call_expression
|
||||
function: [
|
||||
(identifier) @injection.language
|
||||
(member_expression
|
||||
property: (property_identifier) @injection.language)
|
||||
]
|
||||
arguments: (template_string) @injection.content)
|
||||
|
||||
; Parse the contents of gql template literals
|
||||
|
||||
((call_expression
|
||||
function: (identifier) @_template_function_name
|
||||
arguments: (template_string) @injection.content)
|
||||
(#eq? @_template_function_name "gql")
|
||||
(#set! injection.language "graphql"))
|
||||
|
||||
; Parse regex syntax within regex literals
|
||||
|
||||
((regex_pattern) @injection.content
|
||||
(#set! injection.language "regex"))
|
||||
|
||||
; Parse JSDoc annotations in multiline comments
|
||||
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "jsdoc")
|
||||
(#match? @injection.content "^/\\*+"))
|
||||
|
||||
; Parse general tags in single line comments
|
||||
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment")
|
||||
(#match? @injection.content "^//"))
|
||||
|
||||
; inherits: ecma
|
||||
|
@ -1,23 +1 @@
|
||||
; Scopes
|
||||
;-------
|
||||
|
||||
[
|
||||
(statement_block)
|
||||
(function)
|
||||
(arrow_function)
|
||||
(function_declaration)
|
||||
(method_definition)
|
||||
] @local.scope
|
||||
|
||||
; Definitions
|
||||
;------------
|
||||
|
||||
(pattern/identifier)@local.definition
|
||||
|
||||
(variable_declarator
|
||||
name: (identifier) @local.definition)
|
||||
|
||||
; References
|
||||
;------------
|
||||
|
||||
(identifier) @local.reference
|
||||
; inherits: ecma
|
||||
|
@ -0,0 +1 @@
|
||||
; inherits: ecma
|
@ -1 +1 @@
|
||||
; inherits: javascript
|
||||
; inherits: ecma
|
||||
|
@ -1 +1 @@
|
||||
; inherits: javascript
|
||||
; inherits: ecma
|
||||
|
@ -1 +1 @@
|
||||
; inherits: javascript
|
||||
; inherits: ecma
|
||||
|
@ -0,0 +1 @@
|
||||
; inherits: ecma
|
@ -1,410 +1,235 @@
|
||||
;; Math
|
||||
[
|
||||
(displayed_equation)
|
||||
(inline_formula)
|
||||
] @text.math
|
||||
|
||||
;; This highlights the whole environment like vimtex does
|
||||
((environment
|
||||
(begin
|
||||
name: (word) @_env)) @text.math
|
||||
(#any-of? @_env
|
||||
"displaymath" "displaymath*"
|
||||
"equation" "equation*"
|
||||
"multline" "multline*"
|
||||
"eqnarray" "eqnarray*"
|
||||
"align" "align*"
|
||||
"array" "array*"
|
||||
"split" "split*"
|
||||
"alignat" "alignat*"
|
||||
"gather" "gather*"
|
||||
"flalign" "flalign*"))
|
||||
;; General syntax
|
||||
(ERROR) @error
|
||||
|
||||
[
|
||||
(generic_command_name)
|
||||
"\\newcommand"
|
||||
"\\renewcommand"
|
||||
"\\DeclareRobustCommand"
|
||||
"\\DeclareMathOperator"
|
||||
"\\newglossaryentry"
|
||||
"\\caption"
|
||||
"\\label"
|
||||
"\\newlabel"
|
||||
"\\color"
|
||||
"\\colorbox"
|
||||
"\\textcolor"
|
||||
"\\pagecolor"
|
||||
"\\definecolor"
|
||||
"\\definecolorset"
|
||||
"\\newtheorem"
|
||||
"\\declaretheorem"
|
||||
"\\newacronym"
|
||||
] @function.macro
|
||||
(command_name) @function
|
||||
(caption
|
||||
command: _ @function)
|
||||
|
||||
[
|
||||
"\\ref"
|
||||
"\\vref"
|
||||
"\\Vref"
|
||||
"\\autoref"
|
||||
"\\pageref"
|
||||
"\\cref"
|
||||
"\\Cref"
|
||||
"\\cref*"
|
||||
"\\Cref*"
|
||||
"\\namecref"
|
||||
"\\nameCref"
|
||||
"\\lcnamecref"
|
||||
"\\namecrefs"
|
||||
"\\nameCrefs"
|
||||
"\\lcnamecrefs"
|
||||
"\\labelcref"
|
||||
"\\labelcpageref"
|
||||
"\\crefrange"
|
||||
"\\crefrange"
|
||||
"\\Crefrange"
|
||||
"\\Crefrange"
|
||||
"\\crefrange*"
|
||||
"\\crefrange*"
|
||||
"\\Crefrange*"
|
||||
"\\Crefrange*"
|
||||
] @function.macro
|
||||
(key_value_pair
|
||||
key: (_) @variable.parameter
|
||||
value: (_))
|
||||
|
||||
[
|
||||
"\\cite"
|
||||
"\\cite*"
|
||||
"\\Cite"
|
||||
"\\nocite"
|
||||
"\\citet"
|
||||
"\\citep"
|
||||
"\\citet*"
|
||||
"\\citep*"
|
||||
"\\citeauthor"
|
||||
"\\citeauthor*"
|
||||
"\\Citeauthor"
|
||||
"\\Citeauthor*"
|
||||
"\\citetitle"
|
||||
"\\citetitle*"
|
||||
"\\citeyear"
|
||||
"\\citeyear*"
|
||||
"\\citedate"
|
||||
"\\citedate*"
|
||||
"\\citeurl"
|
||||
"\\fullcite"
|
||||
"\\citeyearpar"
|
||||
"\\citealt"
|
||||
"\\citealp"
|
||||
"\\citetext"
|
||||
"\\parencite"
|
||||
"\\parencite*"
|
||||
"\\Parencite"
|
||||
"\\footcite"
|
||||
"\\footfullcite"
|
||||
"\\footcitetext"
|
||||
"\\textcite"
|
||||
"\\Textcite"
|
||||
"\\smartcite"
|
||||
"\\Smartcite"
|
||||
"\\supercite"
|
||||
"\\autocite"
|
||||
"\\Autocite"
|
||||
"\\autocite*"
|
||||
"\\Autocite*"
|
||||
"\\volcite"
|
||||
"\\Volcite"
|
||||
"\\pvolcite"
|
||||
"\\Pvolcite"
|
||||
"\\fvolcite"
|
||||
"\\ftvolcite"
|
||||
"\\svolcite"
|
||||
"\\Svolcite"
|
||||
"\\tvolcite"
|
||||
"\\Tvolcite"
|
||||
"\\avolcite"
|
||||
"\\Avolcite"
|
||||
"\\notecite"
|
||||
"\\notecite"
|
||||
"\\pnotecite"
|
||||
"\\Pnotecite"
|
||||
"\\fnotecite"
|
||||
] @function.macro
|
||||
(comment)
|
||||
(line_comment)
|
||||
(block_comment)
|
||||
(comment_environment)
|
||||
] @comment
|
||||
|
||||
[
|
||||
"\\ref"
|
||||
"\\vref"
|
||||
"\\Vref"
|
||||
"\\autoref"
|
||||
"\\pageref"
|
||||
"\\cref"
|
||||
"\\Cref"
|
||||
"\\cref*"
|
||||
"\\Cref*"
|
||||
"\\namecref"
|
||||
"\\nameCref"
|
||||
"\\lcnamecref"
|
||||
"\\namecrefs"
|
||||
"\\nameCrefs"
|
||||
"\\lcnamecrefs"
|
||||
"\\labelcref"
|
||||
"\\labelcpageref"
|
||||
] @function.macro
|
||||
(brack_group)
|
||||
(brack_group_argc)
|
||||
] @variable.parameter
|
||||
|
||||
[(operator) "="] @operator
|
||||
|
||||
[
|
||||
"\\crefrange"
|
||||
"\\crefrange"
|
||||
"\\Crefrange"
|
||||
"\\Crefrange"
|
||||
"\\crefrange*"
|
||||
"\\crefrange*"
|
||||
"\\Crefrange*"
|
||||
"\\Crefrange*"
|
||||
] @function.macro
|
||||
"\\item" @punctuation.special
|
||||
|
||||
((word) @punctuation.delimiter
|
||||
(#eq? @punctuation.delimiter "&"))
|
||||
|
||||
[
|
||||
"\\gls"
|
||||
"\\Gls"
|
||||
"\\GLS"
|
||||
"\\glspl"
|
||||
"\\Glspl"
|
||||
"\\GLSpl"
|
||||
"\\glsdisp"
|
||||
"\\glslink"
|
||||
"\\glstext"
|
||||
"\\Glstext"
|
||||
"\\GLStext"
|
||||
"\\glsfirst"
|
||||
"\\Glsfirst"
|
||||
"\\GLSfirst"
|
||||
"\\glsplural"
|
||||
"\\Glsplural"
|
||||
"\\GLSplural"
|
||||
"\\glsfirstplural"
|
||||
"\\Glsfirstplural"
|
||||
"\\GLSfirstplural"
|
||||
"\\glsname"
|
||||
"\\Glsname"
|
||||
"\\GLSname"
|
||||
"\\glssymbol"
|
||||
"\\Glssymbol"
|
||||
"\\glsdesc"
|
||||
"\\Glsdesc"
|
||||
"\\GLSdesc"
|
||||
"\\glsuseri"
|
||||
"\\Glsuseri"
|
||||
"\\GLSuseri"
|
||||
"\\glsuserii"
|
||||
"\\Glsuserii"
|
||||
"\\GLSuserii"
|
||||
"\\glsuseriii"
|
||||
"\\Glsuseriii"
|
||||
"\\GLSuseriii"
|
||||
"\\glsuseriv"
|
||||
"\\Glsuseriv"
|
||||
"\\GLSuseriv"
|
||||
"\\glsuserv"
|
||||
"\\Glsuserv"
|
||||
"\\GLSuserv"
|
||||
"\\glsuservi"
|
||||
"\\Glsuservi"
|
||||
"\\GLSuservi"
|
||||
] @function.macro
|
||||
["[" "]" "{" "}"] @punctuation.bracket ; "(" ")" has no syntactical meaning in LaTeX
|
||||
|
||||
;; General environments
|
||||
(begin
|
||||
command: _ @function.builtin
|
||||
name: (curly_group_text (text) @function.macro))
|
||||
|
||||
[
|
||||
"\\acrshort"
|
||||
"\\Acrshort"
|
||||
"\\ACRshort"
|
||||
"\\acrshortpl"
|
||||
"\\Acrshortpl"
|
||||
"\\ACRshortpl"
|
||||
"\\acrlong"
|
||||
"\\Acrlong"
|
||||
"\\ACRlong"
|
||||
"\\acrlongpl"
|
||||
"\\Acrlongpl"
|
||||
"\\ACRlongpl"
|
||||
"\\acrfull"
|
||||
"\\Acrfull"
|
||||
"\\ACRfull"
|
||||
"\\acrfullpl"
|
||||
"\\Acrfullpl"
|
||||
"\\ACRfullpl"
|
||||
"\\acs"
|
||||
"\\Acs"
|
||||
"\\acsp"
|
||||
"\\Acsp"
|
||||
"\\acl"
|
||||
"\\Acl"
|
||||
"\\aclp"
|
||||
"\\Aclp"
|
||||
"\\acf"
|
||||
"\\Acf"
|
||||
"\\acfp"
|
||||
"\\Acfp"
|
||||
"\\ac"
|
||||
"\\Ac"
|
||||
"\\acp"
|
||||
"\\glsentrylong"
|
||||
"\\Glsentrylong"
|
||||
"\\glsentrylongpl"
|
||||
"\\Glsentrylongpl"
|
||||
"\\glsentryshort"
|
||||
"\\Glsentryshort"
|
||||
"\\glsentryshortpl"
|
||||
"\\Glsentryshortpl"
|
||||
"\\glsentryfullpl"
|
||||
"\\Glsentryfullpl"
|
||||
] @function.macro
|
||||
|
||||
(comment) @comment
|
||||
|
||||
(bracket_group) @variable.parameter
|
||||
|
||||
[(math_operator) "="] @operator
|
||||
(end
|
||||
command: _ @function.builtin
|
||||
name: (curly_group_text (text) @function.macro))
|
||||
|
||||
;; Definitions and references
|
||||
(new_command_definition
|
||||
command: _ @function.macro
|
||||
declaration: (curly_group_command_name (_) @function))
|
||||
(old_command_definition
|
||||
command: _ @function.macro
|
||||
declaration: (_) @function)
|
||||
(let_command_definition
|
||||
command: _ @function.macro
|
||||
declaration: (_) @function)
|
||||
|
||||
(environment_definition
|
||||
command: _ @function.macro
|
||||
name: (curly_group_text (_) @constant))
|
||||
|
||||
(theorem_definition
|
||||
command: _ @function.macro
|
||||
name: (curly_group_text (_) @constant))
|
||||
|
||||
(paired_delimiter_definition
|
||||
command: _ @function.macro
|
||||
declaration: (curly_group_command_name (_) @function))
|
||||
|
||||
[
|
||||
"\\usepackage"
|
||||
"\\documentclass"
|
||||
"\\input"
|
||||
"\\include"
|
||||
"\\subfile"
|
||||
"\\subfileinclude"
|
||||
"\\subfileinclude"
|
||||
"\\includegraphics"
|
||||
"\\addbibresource"
|
||||
"\\bibliography"
|
||||
"\\includesvg"
|
||||
"\\includeinkscape"
|
||||
"\\usepgflibrary"
|
||||
"\\usetikzlibrary"
|
||||
] @keyword.control.import
|
||||
(label_definition
|
||||
command: _ @function.macro
|
||||
name: (curly_group_text (_) @label))
|
||||
(label_reference_range
|
||||
command: _ @function.macro
|
||||
from: (curly_group_text (_) @label)
|
||||
to: (curly_group_text (_) @label))
|
||||
(label_reference
|
||||
command: _ @function.macro
|
||||
names: (curly_group_text_list (_) @label))
|
||||
(label_number
|
||||
command: _ @function.macro
|
||||
name: (curly_group_text (_) @label)
|
||||
number: (_) @markup.link.label)
|
||||
|
||||
[
|
||||
"\\part"
|
||||
"\\chapter"
|
||||
"\\section"
|
||||
"\\subsection"
|
||||
"\\subsubsection"
|
||||
"\\paragraph"
|
||||
"\\subparagraph"
|
||||
] @type
|
||||
(citation
|
||||
command: _ @function.macro
|
||||
keys: (curly_group_text_list) @string)
|
||||
|
||||
(glossary_entry_definition
|
||||
command: _ @function.macro
|
||||
name: (curly_group_text (_) @string))
|
||||
(glossary_entry_reference
|
||||
command: _ @function.macro
|
||||
name: (curly_group_text (_) @string))
|
||||
|
||||
(acronym_definition
|
||||
command: _ @function.macro
|
||||
name: (curly_group_text (_) @string))
|
||||
(acronym_reference
|
||||
command: _ @function.macro
|
||||
name: (curly_group_text (_) @string))
|
||||
|
||||
(color_definition
|
||||
command: _ @function.macro
|
||||
name: (curly_group_text (_) @string))
|
||||
(color_reference
|
||||
command: _ @function.macro
|
||||
name: (curly_group_text (_) @string))
|
||||
|
||||
"\\item" @punctuation.special
|
||||
;; Math
|
||||
|
||||
((word) @punctuation.delimiter
|
||||
(#eq? @punctuation.delimiter "&"))
|
||||
(displayed_equation) @markup.raw.block
|
||||
(inline_formula) @markup.raw.inline
|
||||
|
||||
["$" "\\[" "\\]" "\\(" "\\)"] @punctuation.delimiter
|
||||
(math_environment
|
||||
(begin
|
||||
command: _ @function.builtin
|
||||
name: (curly_group_text (text) @markup.raw)))
|
||||
|
||||
(label_definition
|
||||
name: (_) @text.reference)
|
||||
(label_reference
|
||||
label: (_) @text.reference)
|
||||
(equation_label_reference
|
||||
label: (_) @text.reference)
|
||||
(label_reference
|
||||
label: (_) @text.reference)
|
||||
(label_number
|
||||
label: (_) @text.reference)
|
||||
(math_environment
|
||||
(text) @markup.raw)
|
||||
|
||||
(citation
|
||||
key: (word) @text.reference)
|
||||
(math_environment
|
||||
(end
|
||||
command: _ @function.builtin
|
||||
name: (curly_group_text (text) @markup.raw)))
|
||||
|
||||
(key_val_pair
|
||||
key: (_) @variable.parameter
|
||||
value: (_))
|
||||
;; Sectioning
|
||||
(title_declaration
|
||||
command: _ @namespace
|
||||
options: (brack_group (_) @markup.heading)?
|
||||
text: (curly_group (_) @markup.heading))
|
||||
|
||||
["[" "]" "{" "}"] @punctuation.bracket ;"(" ")" is has no special meaning in LaTeX
|
||||
(author_declaration
|
||||
command: _ @namespace
|
||||
authors: (curly_group_author_list
|
||||
((author)+ @markup.heading)))
|
||||
|
||||
(chapter
|
||||
text: (brace_group) @markup.heading)
|
||||
command: _ @namespace
|
||||
toc: (brack_group (_) @markup.heading)?
|
||||
text: (curly_group (_) @markup.heading))
|
||||
|
||||
(part
|
||||
text: (brace_group) @markup.heading)
|
||||
command: _ @namespace
|
||||
toc: (brack_group (_) @markup.heading)?
|
||||
text: (curly_group (_) @markup.heading))
|
||||
|
||||
(section
|
||||
text: (brace_group) @markup.heading)
|
||||
command: _ @namespace
|
||||
toc: (brack_group (_) @markup.heading)?
|
||||
text: (curly_group (_) @markup.heading))
|
||||
|
||||
(subsection
|
||||
text: (brace_group) @markup.heading)
|
||||
command: _ @namespace
|
||||
toc: (brack_group (_) @markup.heading)?
|
||||
text: (curly_group (_) @markup.heading))
|
||||
|
||||
(subsubsection
|
||||
text: (brace_group) @markup.heading)
|
||||
command: _ @namespace
|
||||
toc: (brack_group (_) @markup.heading)?
|
||||
text: (curly_group (_) @markup.heading))
|
||||
|
||||
(paragraph
|
||||
text: (brace_group) @markup.heading)
|
||||
command: _ @namespace
|
||||
toc: (brack_group (_) @markup.heading)?
|
||||
text: (curly_group (_) @markup.heading))
|
||||
|
||||
(subparagraph
|
||||
text: (brace_group) @markup.heading)
|
||||
command: _ @namespace
|
||||
toc: (brack_group (_) @markup.heading)?
|
||||
text: (curly_group (_) @markup.heading))
|
||||
|
||||
((environment
|
||||
;; Beamer frames
|
||||
(generic_environment
|
||||
(begin
|
||||
name: (word) @_frame)
|
||||
(brace_group
|
||||
child: (text) @markup.heading))
|
||||
(#eq? @_frame "frame"))
|
||||
name: (curly_group_text
|
||||
(text) @markup.heading)
|
||||
(#any-of? @markup.heading "frame"))
|
||||
.
|
||||
(curly_group (_) @markup.heading))
|
||||
|
||||
((generic_command
|
||||
name:(generic_command_name) @_name
|
||||
arg: (brace_group
|
||||
command: (command_name) @_name
|
||||
arg: (curly_group
|
||||
(text) @markup.heading))
|
||||
(#eq? @_name "\\frametitle"))
|
||||
(#eq? @_name "\\frametitle"))
|
||||
|
||||
;; Formatting
|
||||
|
||||
((generic_command
|
||||
name:(generic_command_name) @_name
|
||||
arg: (_) @markup.italic)
|
||||
(#eq? @_name "\\emph"))
|
||||
command: (command_name) @_name
|
||||
arg: (curly_group (_) @markup.italic))
|
||||
(#eq? @_name "\\emph"))
|
||||
|
||||
((generic_command
|
||||
name:(generic_command_name) @_name
|
||||
arg: (_) @markup.italic)
|
||||
(#match? @_name "^(\\\\textit|\\\\mathit)$"))
|
||||
command: (command_name) @_name
|
||||
arg: (curly_group (_) @markup.italic))
|
||||
(#match? @_name "^(\\\\textit|\\\\mathit)$"))
|
||||
|
||||
((generic_command
|
||||
name:(generic_command_name) @_name
|
||||
arg: (_) @markup.bold)
|
||||
(#match? @_name "^(\\\\textbf|\\\\mathbf)$"))
|
||||
command: (command_name) @_name
|
||||
arg: (curly_group (_) @markup.bold))
|
||||
(#match? @_name "^(\\\\textbf|\\\\mathbf)$"))
|
||||
|
||||
((generic_command
|
||||
name:(generic_command_name) @_name
|
||||
command: (command_name) @_name
|
||||
.
|
||||
arg: (_) @markup.link.url)
|
||||
(#match? @_name "^(\\\\url|\\\\href)$"))
|
||||
|
||||
(ERROR) @error
|
||||
|
||||
[
|
||||
"\\begin"
|
||||
"\\end"
|
||||
] @text.environment
|
||||
|
||||
(begin
|
||||
name: (_) @text.environment.name
|
||||
(#not-any-of? @text.environment.name
|
||||
"displaymath" "displaymath*"
|
||||
"equation" "equation*"
|
||||
"multline" "multline*"
|
||||
"eqnarray" "eqnarray*"
|
||||
"align" "align*"
|
||||
"array" "array*"
|
||||
"split" "split*"
|
||||
"alignat" "alignat*"
|
||||
"gather" "gather*"
|
||||
"flalign" "flalign*"))
|
||||
|
||||
(end
|
||||
name: (_) @text.environment.name
|
||||
(#not-any-of? @text.environment.name
|
||||
"displaymath" "displaymath*"
|
||||
"equation" "equation*"
|
||||
"multline" "multline*"
|
||||
"eqnarray" "eqnarray*"
|
||||
"align" "align*"
|
||||
"array" "array*"
|
||||
"split" "split*"
|
||||
"alignat" "alignat*"
|
||||
"gather" "gather*"
|
||||
"flalign" "flalign*"))
|
||||
arg: (curly_group (_) @markup.link.uri))
|
||||
(#match? @_name "^(\\\\url|\\\\href)$"))
|
||||
|
||||
;; File inclusion commands
|
||||
(class_include
|
||||
command: _ @keyword.storage.type
|
||||
path: (curly_group_path) @string)
|
||||
|
||||
(package_include
|
||||
command: _ @keyword.storage.type
|
||||
paths: (curly_group_path_list) @string)
|
||||
|
||||
(latex_include
|
||||
command: _ @keyword.control.import
|
||||
path: (curly_group_path) @string)
|
||||
(import_include
|
||||
command: _ @keyword.control.import
|
||||
directory: (curly_group_path) @string
|
||||
file: (curly_group_path) @string)
|
||||
|
||||
(bibtex_include
|
||||
command: _ @keyword.control.import
|
||||
path: (curly_group_path) @string)
|
||||
(biblatex_include
|
||||
"\\addbibresource" @include
|
||||
glob: (curly_group_glob_pattern) @string.regex)
|
||||
|
||||
(graphics_include
|
||||
command: _ @keyword.control.import
|
||||
path: (curly_group_path) @string)
|
||||
(tikz_library_import
|
||||
command: _ @keyword.control.import
|
||||
paths: (curly_group_path_list) @string)
|
||||
|
@ -0,0 +1,13 @@
|
||||
[
|
||||
(generic_command)
|
||||
] @function.around
|
||||
|
||||
[
|
||||
(chapter)
|
||||
(part)
|
||||
(section)
|
||||
(subsection)
|
||||
(subsubsection)
|
||||
(paragraph)
|
||||
(subparagraph)
|
||||
] @class.around
|
@ -0,0 +1,39 @@
|
||||
;; From nvim-treesitter/nvim-treesitter
|
||||
[
|
||||
(code_span)
|
||||
(link_title)
|
||||
] @markup.raw.inline
|
||||
|
||||
[
|
||||
(emphasis_delimiter)
|
||||
(code_span_delimiter)
|
||||
] @punctuation.bracket
|
||||
|
||||
(emphasis) @markup.italic
|
||||
|
||||
(strong_emphasis) @markup.bold
|
||||
|
||||
(strikethrough) @markup.strikethrough
|
||||
|
||||
[
|
||||
(link_destination)
|
||||
(uri_autolink)
|
||||
] @markup.link.url
|
||||
|
||||
[
|
||||
(link_text)
|
||||
(image_description)
|
||||
] @markup.link.text
|
||||
|
||||
(link_label) @markup.link.label
|
||||
|
||||
[
|
||||
(backslash_escape)
|
||||
(hard_line_break)
|
||||
] @constant.character.escape
|
||||
|
||||
(image ["[" "]" "(" ")"] @punctuation.bracket)
|
||||
(image "!" @punctuation.special)
|
||||
(inline_link ["[" "]" "(" ")"] @punctuation.bracket)
|
||||
(shortcut_link ["[" "]"] @punctuation.bracket)
|
||||
|
@ -0,0 +1,2 @@
|
||||
|
||||
((html_tag) @injection.content (#set! injection.language "html"))
|
@ -1,54 +1,53 @@
|
||||
(setext_heading (heading_content) @markup.heading.1 (setext_h1_underline) @markup.heading.marker)
|
||||
(setext_heading (heading_content) @markup.heading.2 (setext_h2_underline) @markup.heading.marker)
|
||||
|
||||
(atx_heading (atx_h1_marker) @markup.heading.marker (heading_content) @markup.heading.1)
|
||||
(atx_heading (atx_h2_marker) @markup.heading.marker (heading_content) @markup.heading.2)
|
||||
(atx_heading (atx_h3_marker) @markup.heading.marker (heading_content) @markup.heading.3)
|
||||
(atx_heading (atx_h4_marker) @markup.heading.marker (heading_content) @markup.heading.4)
|
||||
(atx_heading (atx_h5_marker) @markup.heading.marker (heading_content) @markup.heading.5)
|
||||
(atx_heading (atx_h6_marker) @markup.heading.marker (heading_content) @markup.heading.6)
|
||||
(setext_heading (paragraph) @markup.heading.1 (setext_h1_underline) @markup.heading.marker)
|
||||
(setext_heading (paragraph) @markup.heading.2 (setext_h2_underline) @markup.heading.marker)
|
||||
|
||||
(atx_heading (atx_h1_marker) @markup.heading.marker (inline) @markup.heading.1)
|
||||
(atx_heading (atx_h2_marker) @markup.heading.marker (inline) @markup.heading.2)
|
||||
(atx_heading (atx_h3_marker) @markup.heading.marker (inline) @markup.heading.3)
|
||||
(atx_heading (atx_h4_marker) @markup.heading.marker (inline) @markup.heading.4)
|
||||
(atx_heading (atx_h5_marker) @markup.heading.marker (inline) @markup.heading.5)
|
||||
(atx_heading (atx_h6_marker) @markup.heading.marker (inline) @markup.heading.6)
|
||||
|
||||
[
|
||||
(indented_code_block)
|
||||
(code_fence_content)
|
||||
(fenced_code_block)
|
||||
] @markup.raw.block
|
||||
|
||||
(block_quote) @markup.quote
|
||||
|
||||
(code_span) @markup.raw.inline
|
||||
|
||||
(emphasis) @markup.italic
|
||||
|
||||
(strong_emphasis) @markup.bold
|
||||
(info_string) @label
|
||||
|
||||
(link_destination) @markup.link.url
|
||||
(link_label) @markup.link.label
|
||||
[
|
||||
(fenced_code_block_delimiter)
|
||||
] @punctuation.bracket
|
||||
|
||||
(info_string) @label
|
||||
[
|
||||
(link_destination)
|
||||
] @markup.link.url
|
||||
|
||||
[
|
||||
(link_text)
|
||||
(image_description)
|
||||
] @markup.link.text
|
||||
(link_label)
|
||||
] @markup.link.label
|
||||
|
||||
[
|
||||
(list_marker_plus)
|
||||
(list_marker_minus)
|
||||
(list_marker_star)
|
||||
] @markup.list.numbered
|
||||
] @markup.list.unnumbered
|
||||
|
||||
[
|
||||
(list_marker_dot)
|
||||
(list_marker_parenthesis)
|
||||
] @markup.list.unnumbered
|
||||
] @markup.list.numbered
|
||||
|
||||
(thematic_break) @punctuation.delimiter
|
||||
|
||||
[
|
||||
(backslash_escape)
|
||||
(hard_line_break)
|
||||
] @constant.character.escape
|
||||
(block_continuation)
|
||||
(block_quote_marker)
|
||||
] @punctuation.special
|
||||
|
||||
(thematic_break) @punctuation.delimiter
|
||||
[
|
||||
(backslash_escape)
|
||||
] @string.escape
|
||||
|
||||
(inline_link ["[" "]" "(" ")"] @punctuation.bracket)
|
||||
(image ["[" "]" "(" ")"] @punctuation.bracket)
|
||||
(fenced_code_block_delimiter) @punctuation.bracket
|
||||
(block_quote) @markup.quote
|
||||
|
@ -1,9 +1,13 @@
|
||||
; From nvim-treesitter/nvim-treesitter
|
||||
|
||||
(fenced_code_block
|
||||
(info_string) @injection.language
|
||||
(code_fence_content) @injection.content
|
||||
(#set! injection.include-children))
|
||||
|
||||
((html_block) @injection.content
|
||||
(#set! injection.language "html"))
|
||||
((html_tag) @injection.content
|
||||
(#set! injection.language "html"))
|
||||
(info_string
|
||||
(language) @injection.language)
|
||||
(code_fence_content) @injection.content (#set! injection.include-unnamed-children))
|
||||
|
||||
((html_block) @injection.content (#set! injection.language "html") (#set! injection.include-unnamed-children))
|
||||
|
||||
((minus_metadata) @injection.content (#set! injection.language "yaml") (#set! injection.include-unnamed-children))
|
||||
((plus_metadata) @injection.content (#set! injection.language "toml") (#set! injection.include-unnamed-children))
|
||||
|
||||
((inline) @injection.content (#set! injection.language "markdown.inline") (#set! injection.include-unnamed-children))
|
||||
|
@ -0,0 +1,44 @@
|
||||
;; Scopes
|
||||
|
||||
[
|
||||
(module)
|
||||
(function_definition)
|
||||
(lambda)
|
||||
] @local.scope
|
||||
|
||||
;; Definitions
|
||||
|
||||
; Parameters
|
||||
(parameters
|
||||
(identifier) @local.definition)
|
||||
(parameters
|
||||
(typed_parameter
|
||||
(identifier) @local.definition))
|
||||
(parameters
|
||||
(default_parameter
|
||||
name: (identifier) @local.definition))
|
||||
(parameters
|
||||
(typed_default_parameter
|
||||
name: (identifier) @local.definition))
|
||||
(parameters
|
||||
(list_splat_pattern ; *args
|
||||
(identifier) @local.definition))
|
||||
(parameters
|
||||
(dictionary_splat_pattern ; **kwargs
|
||||
(identifier) @local.definition))
|
||||
|
||||
(lambda_parameters
|
||||
(identifier) @local.definition)
|
||||
|
||||
; Imports
|
||||
(import_statement
|
||||
name: (dotted_name
|
||||
(identifier) @local.definition))
|
||||
|
||||
(aliased_import
|
||||
alias: (identifier) @local.definition)
|
||||
|
||||
;; References
|
||||
|
||||
(identifier) @local.reference
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue