aboutsummaryrefslogtreecommitdiffstats
path: root/queries/python/highlights.scm
Commit message (Collapse)AuthorAgeFilesLines
* feat!: drop modules, general refactor and cleanupChristian Clason2025-05-121-443/+0
|
* 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(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
|
* 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: 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-211-50/+37
|
* feat(format-scripts): linewrap predicates再生花2024-02-231-17/+23
| | | "format-ignore".kick()
* 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
|
* fix(python): add support for typed (kw)args (PEP 484) (#5875)Zeb Nicholls2024-01-191-4/+14
|
* chore: query formattingPham Huy Hoang2024-01-191-94/+162
|
* 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`
* 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-211-0/+8
| | | | | | | | | | | | | | | * 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,starlark): update parsers & add escape_interpolationAmaan Qureshi2023-08-161-1/+4
|
* fix(python): fields should not match uppercase-beginning namesAmaan Qureshi2023-04-291-1/+1
|
* 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
|
* fix(python): add object as `@type.builtin`Anthony Shi2023-03-221-1/+1
|
* feat: add `@string.documentation` where applicableAmaan Qureshi2023-03-051-1/+12
|
* feat!: add `@keyword.coroutine` captureAmaan Qureshi2023-03-031-2/+5
|
* Update highlights.scm for PythonAnthony Shi2023-03-021-0/+2
| | | Added new keywords "is not" and "not in"
* python(highlights): adapt query to parser changeChristian Clason2023-02-281-5/+1
|
* highlights(python): fix capturesObserverOfTime2022-11-261-9/+38
|
* highlights(python): add "except*"Stephan Seitz2022-10-251-0/+1
| | | | | | Added in https://github.com/tree-sitter/tree-sitter-python/pull/176 About the feature https://realpython.com/python311-exception-groups/#exception-groups-and-except-in-python-311
* highlights: use @preproc where appropriateObserverOfTime2022-10-151-0/+4
|
* feat(spell): support more languagesLewis Russell2022-09-261-2/+1
|
* feat(spell): upstream spell queries from spellsitterLewis Russell2022-09-061-0/+4
|
* Split func/method definition from calls in python highlighting querylfenzo2022-08-031-2/+2
|
* fix: keep cls variable highlighting consistent in class methodsRyan Barth2022-06-141-10/+2
|
* Python: highlight future import (#2936)Santos Gallegos2022-05-131-0/+1
| | | | | * Python: highlight future import * Use constant.builtin
* Python: highlight raise from statementSantos Gallegos2022-05-011-0/+2
|
* fixup! highlights(python): highlight exception keywordsFerdinand Ratajczak2022-04-071-4/+0
|