aboutsummaryrefslogtreecommitdiffstats
path: root/queries/python
Commit message (Collapse)AuthorAgeFilesLines
* fix(python): highlight all types of docstrings (#7788)Jakob Zahn2025-04-031-21/+3
|
* Use order instead of prioritydcho2025-03-211-13/+12
|
* fix(python): prioritize builtin functionsdcho2025-03-211-1/+2
|
* fix(python): don't highlight parameter name as builtin (#7732)Salomon Popp2025-03-131-61/+61
|
* fix(python): highlight function calls correctly (#7728)Salomon Popp2025-03-121-42/+42
|
* fix(python): don't highlight attribute name as builtin (#7712)Salomon Popp2025-03-111-24/+25
| | | | | | | | | | | | | | | * fix(python): don't highlight attribute name as builtin * fix(python): highlight `@variable.member` correctly for member access context * test: add test * test: expand test * docs: update comment * refactor: change order, remove priority override * style: remove extra newline
* feat(snakemake): add rules to locals (#7698)patricorgi2025-03-061-3/+3
|
* feat(python): highlight modulesOmar Valdez2024-11-211-1/+20
|
* feat(highlights): capture wildcard patterns as `@character.special` (#7153)Omar Valdez2024-09-201-1/+1
|
* feat(highlights): capture wildcard imports as `@character.special`Omar Valdez2024-08-011-0/+3
|
* refactor(queries): Remove quotes from properties in set! directiveOmar Valdez2024-07-281-1/+1
|
* feat(python): Improved python indentation (#6859)Grace Petryk2024-07-161-4/+35
| | | | | | | | | | | | | * feat: improve python indentation * use lua-match * revert concatenated_string changes, handle function def hanging indents * lint * add delimiters to param query * add test cases
* refactor(python): merge docstring queriesObserverOfTime2024-06-281-22/+3
|
* feat(awk,cmake,python,r,starlark): deactivate spelling in shebangsKai Moschcau2024-05-011-1/+1
|
* feat: import statement folds for common languagesRiley Bruins2024-05-011-0/+5
|
* feat: more `@keyword.type` capturesRiley Bruins2024-05-011-2/+5
|
* fix(python): captures inner string contents with spell Colin Kennedy2024-04-171-3/+25
|
* fix(python): add staticmethod to builtin decoratorsvsajko2024-03-301-1/+1
|
* refactor(format): drop extra indentation for fieldPhạm Huy Hoàng2024-03-214-108/+78
|
* feat(format-scripts): linewrap predicates再生花2024-02-231-17/+23
| | | "format-ignore".kick()
* fix(python): better try-except indentation (#6097)Riley Bruins2024-02-151-2/+13
|
* feat(python): allow comments before module docstringJongwook Choi2024-01-251-0/+2
| | | | | | | | | | | | | | | | | | | Example: ```python #!/usr/bin/env/python # some comment before module docstring # Copyright (c) LICENSE foo bar """module docstring.""" ``` Python indeed recognizes it: ``` $ python -c 'import testfile; print(testfile.__doc__)' module docstring. ```
* chore(python): update member lua patternAmaan Qureshi2024-01-241-2/+2
|
* chore: format queriesPhạm Huy Hoàng2024-01-211-2/+2
|
* fix(python): add support for typed (kw)args (PEP 484) (#5875)Zeb Nicholls2024-01-191-4/+14
|
* chore: query formattingPham Huy Hoang2024-01-195-195/+326
|
* refactor: manual pre-cleanupPham Huy Hoang2024-01-191-25/+22
| | | | | Moving comments, adding `format-ignore` to lines that will be better with it
* feat!: align standard captures with upstreamChristian Clason2024-01-191-32/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Sharing highlight queries with upstream tree-sitter and Helix is difficult. Solution: Where reasonable, use capture names in tree-sitter's standard list or Helix's Atom-style hierarchy. Specifically: * tree-sitter "standard capture names" (https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72): - `@parameter` -> `@variable.parameter` - `@field` -> `@variable.member` - `@namespace` -> `@module` - `@float` -> `@number.float` - `@symbol` -> `@string.special.symbol` - `@string.regex` -> `@string.regexp` - `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below) - `@text.title` -> `@markup.heading` - `@text.literal` -> `@markup.raw` - `@text.reference` -> `@markup.link` - `@text.uri` -> `@markup.link.url` (in markup links) - `@string.special` -> `@markup.link.label` (non-url links) - `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`) * Helix captures (https://docs.helix-editor.com/master/themes.html#syntax-highlighting): - `@method` -> `@function.method` - `@method.call` -> `@function.method.call` - `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}` - `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}` - `@text.uri` -> `@string.special.url` (outside markup) - `@preproc` -> `@keyword.directive` - `@define` -> `@keyword.directive`(`.define`?) - `@storageclass` -> `@keyword.storage` - `@conditional` -> `@keyword.conditional` - `@debug` -> `@keyword.debug` - `@exception` -> `@keyword.exception` - `@include` -> `@keyword.import` - `@repeat` -> `@keyword.repeat` * cleanup - remove some redundant `@conceal` (but still allow it for conceal-only patterns) - remove obsolete `@error` (syntax linting is out of scope for this repo) - sort, cleanup capture list in `CONTRIBUTING.md`
* feat(injections): add printf format stringsObserverOfTime2024-01-191-0/+5
|
* feat(locals)!: switch to upstream capturesChristian Clason2024-01-191-32/+32
|
* fix(python): restrict typed parameter highlightObserverOfTime2023-12-141-1/+1
| | | | Only the name is a parameter and not the value
* fix(python): highlight variadic lambda parametersObserverOfTime2023-12-141-0/+6
|
* feat(python): `@string.regex` capture, injection improvements (#5697)Riley Bruins2023-11-212-3/+10
| | | | | | | | | | | | | | | * feat(python): `@string.regex` capture, injection improvements * fix(python): match regex only for first argument of re module * chore(python): remove unneeded capture Co-authored-by: Santos Gallegos <stsewd@proton.me> * fix(python): only highlight string content itself as regex --------- Co-authored-by: Santos Gallegos <stsewd@proton.me>
* refactor: Remove all `(ERROR) @error` capturesPham Huy Hoang2023-10-251-3/+0
| | | | | | | | | | | | As discussed in PR#5421, capturing `@error` is inconsistent, requiring deep nesting (or priority) in order to correctly have red backgrounds to it. Some queries has this capture, some don't. For consistency purposes, removing all of them is more preferable. For re-enabling error, either add `(ERROR) @error` or `(ERROR _ @error)` to your custom queries.
* feat(python): update parser & highlightsAmaan Qureshi2023-08-161-0/+3
|
* fix(python): right content for regex injectionTheLeoP2023-08-161-6/+7
|
* fix(python,starlark): update parsers & add escape_interpolationAmaan Qureshi2023-08-161-1/+4
|
* chore(injections)!: update injection syntax to 0.9Pham Huy Hoang2023-08-121-3/+5
| | | | | | | | | Since 0.9, @lang syntax is still available as fallback but will soon be deprecated. Because of that, new syntax should be adopted once 0.9 becomes the baseline requirements for nvim-treesitter - update health check - update doc
* fix(python): fields should not match uppercase-beginning namesAmaan Qureshi2023-04-291-1/+1
|
* Add Python else elif dedent (#4618)Pham Huy Hoang2023-04-291-0/+8
| | | | | | | * feat(python): add interactive else/elif dedent * fixup * add test
* fix(python,starlark): builtin types should come after typesAmaan Qureshi2023-04-251-18/+18
|
* feat(python,starlark): highlight type conversions as `@function.macro`Amaan Qureshi2023-04-251-0/+2
|
* fix(python,starlark): update field match patternAmaan Qureshi2023-04-251-3/+3
|
* perf: remove match where possibleAmaan Qureshi2023-04-211-6/+6
|
* feat(python): add break/continue dedentPham Huy Hoang2023-03-251-0/+5
|
* feat(python): add match-case indentsPham Huy Hoang2023-03-251-0/+4
|
* use indent.X syntax for captures and properties of set directivesGeorge Harker2023-03-241-66/+60
| | | | | | | | update CONTRIBUTING.md adjust indents for bass fix doc capture comment
* split delimiter into open_delimiter and close_delimiterGeorge Harker2023-03-241-13/+29
|
* refactor(indent)!: Rework indent, aligned indentGeorge Harker2023-03-241-19/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | indents now use @indent.X style captures, and indent.PROP for properties to set on those captures, as documented in the help. Captures are: indent.auto indent.begin indent.end indent.dedent indent.branch indent.ignore indent.align indent.zero Properties are: indent.immediate indent.start_at_same_line indent.open_delimiter indent.close_delimiter indent.increment indent.avoid_last_matching_next Multiple opening delims on one line and multiple closing on a line are collapsed so as not to over indent, The final line of @indent.align blocks which must in some cases be treated specially to avoid clashing with the next line is treated the same regardless of whether the @indent.align capture actually uses aligned indentation or just normal indentation. The indent.avoid_last_matching_next property controls this. Adjust python to use these. List, set, dict and tuple all use @indent.align which permits both hanging and aligned styles. Finally, try: on it’s own will indent when typing live but make no guaranteeds about whole-file formatting. Includes lucario387:fix-align-indent
* fix(python): add object as `@type.builtin`Anthony Shi2023-03-221-1/+1
|