aboutsummaryrefslogtreecommitdiffstats
path: root/queries/nim
Commit message (Collapse)AuthorAgeFilesLines
* feat!: drop modules, general refactor and cleanupChristian Clason2025-05-124-1374/+0
|
* refactor(queries): Remove quotes from properties in set! directiveOmar Valdez2024-07-282-9/+9
|
* feat: more `@keyword.type` capturesRiley Bruins2024-05-011-3/+6
|
* refactor(format): drop extra indentation for fieldPhạm Huy Hoàng2024-03-213-534/+453
|
* feat(highlights)!: keyword `@type.qualifier` → `@keyword.modifier`Jaehwang Jung2024-03-161-11/+11
|
* fix: typosdundargoc2024-02-191-1/+1
|
* chore: format queriesPhạm Huy Hoàng2024-01-211-2/+2
|
* chore: query formattingPham Huy Hoang2024-01-194-491/+717
|
* feat!: align standard captures with upstreamChristian Clason2024-01-191-66/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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(locals)!: switch to upstream capturesChristian Clason2024-01-191-108/+108
|
* fix(nim): minor improvements to queries and parser (#5784)aMOPel2023-12-193-51/+54
| | | | | | | | * fix(nim): bump parser again to include minor fix * fix(nim): shifting around for precedence * fix(nim): added new fields from recent parser version, improved support for (conditional_declaration) and (variant_declaration)
* feat(nim): added some captures and fixed some bugs (#5664)aMOPel2023-12-011-25/+78
| | | | | | | | | | | | | | | | * fix(nim): literals in pragmas in types would be falsly highlighted as `@variable` * style(nim): removed trailing whitespace * fix(nim): identifiers in (type_expression (pragma_expression)) would be captured as `@type` * fix(nim): changed generic parameters when declaring from @type to @parameter * feat(nim): added @constant capture for (identifier)s x, y in `array[x..y, type]` * feat(nim): added @function.call capture for (identifier)s in second argument to `varargs[type, routine]`
* feat(nim): added nim parser and queries (#5556)aMOPel2023-10-304-0/+1170
* feat(nim): added nim parser and queries * correct scanner.cc to scanner.c Co-authored-by: Christian Clason <c.clason@uni-graz.at> * fix(nim): corrected capture for @function.macro * feat(nim highlights): added @field capture for discriminator field in object variant * bumped parser version, adapted highlights.scm and condensed injections.scm * improved nim_format_string highlights.scm * bump nim parser version again * removed overlap between queries for generalized strings in injections.scm * improved formattin] in nim_format_string/injections.scm Co-authored-by: ObserverOfTime <chronobserver@disroot.org> * corrected asm parser name in injections.scm Co-authored-by: ObserverOfTime <chronobserver@disroot.org> * improved formatting in highlights.scm Co-authored-by: ObserverOfTime <chronobserver@disroot.org> * removed @error capture from highlights.scm Co-authored-by: ObserverOfTime <chronobserver@disroot.org> * improved wording in comment in highlights.scm Co-authored-by: ObserverOfTime <chronobserver@disroot.org> * removed priority from (dot_expression left: @none) capture, since it's at the end of the file anyways * removed comments listing unused captures * reverted @error capture in nim_format_string/highlights.scm back to @none * condensed string alternatives in injections.scm Co-authored-by: ObserverOfTime <chronobserver@disroot.org> * condensed string alternatives in injections.scm (second part) Co-authored-by: ObserverOfTime <chronobserver@disroot.org> * added comment to explain reasoning behind priority use * swapped order of @punctuation.delimiter and @operator to get rid of superfluous comment * moved macro and template keywords to @preproc capture * removed priorities in highlights.scm and shifted @parameter capture behind @type capture * improved formatting in locals.scm * added queries for missing cases of @definition.namespace capture in locals.scm * removed some trailing whitespace * added @namespace queries for highlights.scm * bumped parser version again * removed superfluous @type capture * removed `@type`s `has-ancestor` and removed `(_ (_ ...` structures, but added priorities * added missing @constant capture to some queries in highlights.scm * fixed priority numbers so they work when injecting nim (in markdown) * added @none captures back to injection targets * added (assembly_statement) injection query * added indent queries * removed indents.scm again * added some missing queries for dot_generic_call, concept_declaration and pragma_statement --------- Co-authored-by: Christian Clason <c.clason@uni-graz.at> Co-authored-by: ObserverOfTime <chronobserver@disroot.org>