Commit graph

11 commits

Author SHA1 Message Date
Bruno BELANYI
d10e856c11 feat(beancount): add comment injection 2024-02-19 08:18:15 +09:00
Pham Huy Hoang
57a8acf0c4 chore: query formatting 2024-01-19 16:58:37 +01:00
Christian Clason
1ae9b0e455 feat!: align standard captures with upstream
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"
  (3f44b89685/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`
2024-01-19 16:58:37 +01:00
ShellCode33
d9e75a1736 queries/*/highlights.scm : remove @spell for strings 2023-08-07 16:39:40 +01:00
Brian Ryall
5812ae26f7 highlights(beancount): update on latest updates 2023-01-28 15:03:55 +01:00
PolarMutex
b8459df74d
feat(beancount): support folding org headers (#3078)
requires beancount parser update

Co-authored-by: Brian Ryall <brian@brianryall.xyz>
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2022-06-28 10:44:38 +02:00
Stephen Bolton
e0e6d1b263
Add headers as an option to fold on (#1873)
* Add headers as an option to fold on

treesitter-beancount added grammar rules around orgmode and markdown
headers so that they are recognized in beancount documents. This change
makes it so that they will be taken into consideration when folding
text.

Commit: 79ae7c1f26

* Fix node name for headers

The correct name for the header nodes is heading.
2021-10-02 00:08:44 -05:00
Stephan Seitz
c7313ffd10 Fix beancount queries 2021-03-30 22:27:50 +02:00
Brian Ryall
600509aad6 delete locals queries for beancount 2021-03-22 07:11:10 +01:00
Brian Ryall
900222e1ad fix invalid annotation in beancount query 2021-03-22 07:11:10 +01:00
Brian Ryall
fb75f01941 add support for beancount files 2021-03-22 07:11:10 +01:00