Skip to content

[ new ] Add support for Idris 2 programming language#3150

Merged
keith-hall merged 1 commit intosharkdp:masterfrom
buzden:add-idris-syntax
Jan 27, 2025
Merged

[ new ] Add support for Idris 2 programming language#3150
keith-hall merged 1 commit intosharkdp:masterfrom
buzden:add-idris-syntax

Conversation

@buzden
Copy link
Contributor

@buzden buzden commented Dec 24, 2024

Idris 2 is a pretty big and well-known programming language among purely functional languages supporting dependent types. But it still lacks support by bat, and thus by other tools like delta and typst. I suggest to add support for it with this PR.

@buzden buzden force-pushed the add-idris-syntax branch 3 times, most recently from 0c76381 to 12c583b Compare January 20, 2025 14:06
@keith-hall
Copy link
Collaborator

Hi, thanks for this. It would be nice to get some indication of how popular Idris 2 is, to help us decide whether it meets our criteria for inclusion by default.
Otherwise the next step could be to try get a curated list of packages going and add it there: trishume/syntect#168

@buzden
Copy link
Contributor Author

buzden commented Jan 27, 2025

It would be nice to get some indication of how popular Idris 2 is

Well, maybe some statistics from GitHub may help.

There are ~1600 repositories using this language solely on GitHub, around 10000 issues and PRs in these projects, GitHub has its syntax highlighting for its comments (it also has strong requirements on language popularity).

criteria for inclusion by default.

Well, this criterion is valid for popular languages in Sublime text editor, as far as I understand. Sublime is not supported by Idris (Idris language has interactive compiler and closely works with the editor, supporting only vim, emacs and vscode). Thus, sublime highlighting was created specially to be supported by bat/syntect from scratch based on ideas from existing highlighting, e.g. for Haskell, with which Idris shares a lot of common syntax, but still differs significantly.

Additionally, I dared to suggest to include Idris while formally not meeting this criterion because I checked some already added languages and they also did not meet it formally, thus I thought that it is not valid anymore.

Otherwise the next step could be to try get a curated list of packages going and add it there: trishume/syntect#168

Am I right that you suggest adding my syntax definitions here and here (interestingly, the second one seems to use tmLanguage formal instead of sublime-syntax)? It looks feasible, at least the first onem since it uses the same format of config files.

Copy link
Collaborator

@keith-hall keith-hall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idris (Idris language has interactive compiler and closely works with the editor, supporting only vim, emacs and vscode). Thus, sublime highlighting was created specially to be supported by bat/syntect from scratch based on ideas from existing highlighting

Ah, good to know, thanks for the context.

Additionally, I dared to suggest to include Idris while formally not meeting this criterion because I checked some already added languages and they also did not meet it formally, thus I thought that it is not valid anymore.

We have indeed unofficially relaxed the requirements a bit since lazy loading of syntaxes was implemented, to reduce the startup cost of having many languages. (#2181)

Considering this, and that it was written especially for bat and friends, then let's merge it 🎉

auto-merge was automatically disabled January 27, 2025 20:47

Head branch was pushed to by a user without write access

@buzden
Copy link
Contributor Author

buzden commented Jan 27, 2025

Oh, seems I have unintentnially broken the merge process. I saw that auto-merge was not working seemingly because master branch has already moved forward, I rebased it, and this has disabled auto-merge.

@keith-hall keith-hall enabled auto-merge January 27, 2025 20:56
@keith-hall keith-hall merged commit 487ac3b into sharkdp:master Jan 27, 2025
24 checks passed
@buzden buzden deleted the add-idris-syntax branch January 27, 2025 21:01
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Oct 22, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [sharkdp/bat](https://github.com/sharkdp/bat) | minor | `v0.25.0` -> `v0.26.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>sharkdp/bat (sharkdp/bat)</summary>

### [`v0.26.0`](https://github.com/sharkdp/bat/blob/HEAD/CHANGELOG.md#v0260)

[Compare Source](sharkdp/bat@v0.25.0...v0.26.0)

#### Features

- Add build for windows/ARM64 platform. [#&#8203;3190](sharkdp/bat#3190) ([@&#8203;alcroito](https://github.com/alcroito))
- Add paging to `--list-themes`, see MR [#&#8203;3239](sharkdp/bat#3239) ([@&#8203;einfachIrgendwer0815](https://github.com/einfachIrgendwer0815))
- Support negative relative line ranges, e.g. `bat -r :-10` / `bat -r='-10:'`, see [#&#8203;3068](sharkdp/bat#3068) ([@&#8203;ajesipow](https://github.com/ajesipow))
- Support context in line ranges, e.g. `bat -r 30::5` /  `bat -r 30:40:5`, see [#&#8203;3345](sharkdp/bat#3345) ([@&#8203;cavanaug](https://github.com/cavanaug))
- Add built-in 'minus' pager, e.g. `bat --pager=builtin` see MR [#&#8203;3402](sharkdp/bat#3402) ([@&#8203;academician](https://github.com/academician))

#### Bugfixes

- Fix UTF-8 BOM not being stripped for syntax detection, see [#&#8203;3314](sharkdp/bat#3314) ([@&#8203;krikera](https://github.com/krikera))
- Fix `BAT_THEME_DARK` and `BAT_THEME_LIGHT` being ignored, see issue [#&#8203;3171](sharkdp/bat#3171) and MR [#&#8203;3168](sharkdp/bat#3168) ([@&#8203;bash](https://github.com/bash))
- Prevent `--list-themes` from outputting default theme info to stdout when it is piped, see [#&#8203;3189](sharkdp/bat#3189) ([@&#8203;einfachIrgendwer0815](https://github.com/einfachIrgendwer0815))
- Rename some submodules to fix Dependabot submodule updates, see issue [#&#8203;3198](sharkdp/bat#3198) and MR [#&#8203;3201](sharkdp/bat#3201) ([@&#8203;victor-gp](https://github.com/victor-gp))
- Make highlight tests fail when new syntaxes don't have fixtures MR [#&#8203;3255](sharkdp/bat#3255) ([@&#8203;dan-hipschman](https://github.com/dan-hipschman))
- Fix crash for multibyte characters in file path, see issue [#&#8203;3230](sharkdp/bat#3230) and MR [#&#8203;3245](sharkdp/bat#3245) ([@&#8203;HSM95](https://github.com/HSM95))
- Add missing mappings for various bash/zsh files, see MR [#&#8203;3262](sharkdp/bat#3262) ([@&#8203;AdamGaskins](https://github.com/AdamGaskins))
- Send all bat errors to stderr by default, see [#&#8203;3336](sharkdp/bat#3336) ([@&#8203;JerryImMouse](https://github.com/JerryImMouse))
- Make --map-syntax target case insensitive to match --language, see [#&#8203;3206](sharkdp/bat#3206) ([@&#8203;keith-hall](https://github.com/keith-hall))
- Correctly determine the end of the line in UTF16LE/BE input [#&#8203;3369](sharkdp/bat#3369) ([@&#8203;keith-hall](https://github.com/keith-hall))
- `--style=changes` no longer prints a two-space indent when the file is unmodified, see issue [#&#8203;2710](sharkdp/bat#2710) and MR [#&#8203;3406](sharkdp/bat#3406) ([@&#8203;jyn514](https://github.com/jyn514))
- Add missing shell completions, see [#&#8203;3411](sharkdp/bat#3411) ([@&#8203;keith-hall](https://github.com/keith-hall))
- Execute help/version/diagnostic commands even with invalid config/arguments present, see [#&#8203;3414](sharkdp/bat#3414) ([@&#8203;keith-hall](https://github.com/keith-hall))
- Fixed line numbers (`-n`) and style components not printing when piping output, see issue [#&#8203;2935](sharkdp/bat#2935) and MR [#&#8203;3438](sharkdp/bat#3438) ([@&#8203;lmmx](https://github.com/lmmx))

#### Other

- Update base16 README links to community driven base16 work [#&#8203;2871](sharkdp/bat#2871) ([@&#8203;JamyGolden](https://github.com/JamyGolden))
- Work around build failures when building `bat` from vendored sources [#&#8203;3179](sharkdp/bat#3179) ([@&#8203;dtolnay](https://github.com/dtolnay))
- CICD: Stop building for x86\_64-pc-windows-gnu which fails [#&#8203;3261](sharkdp/bat#3261) (Enselic)
- CICD: replace windows-2019 runners with windows-2025 [#&#8203;3339](sharkdp/bat#3339) ([@&#8203;cyqsimon](https://github.com/cyqsimon))
- Build script: replace string-based codegen with quote-based codegen [#&#8203;3340](sharkdp/bat#3340) ([@&#8203;cyqsimon](https://github.com/cyqsimon))
- Improve code coverage of `--list-languages` parameter [#&#8203;2942](sharkdp/bat#2942) ([@&#8203;sblondon](https://github.com/sblondon))
- Only start offload worker thread when there's more than 1 core [#&#8203;2956](sharkdp/bat#2956) ([@&#8203;cyqsimon](https://github.com/cyqsimon))
- Update terminal-colorsaurus (the library used for dark/light detection) to 1.0, see [#&#8203;3347](sharkdp/bat#3347) ([@&#8203;bash](https://github.com/bash))
- Update console dependency to 0.16, see [#&#8203;3351](sharkdp/bat#3351) ([@&#8203;musicinmybrain](https://github.com/musicinmybrain))
- Fixed some typos [#&#8203;3244](sharkdp/bat#3244) ([@&#8203;ssbarnea](https://github.com/ssbarnea))
- Update onig\_sys dependency to 69.9.1 to fix a gcc build failure [#&#8203;3400](sharkdp/bat#3400) ([@&#8203;CosmicHorrorDev](https://github.com/CosmicHorrorDev))
- Add a cargo feature (`vendored-libgit2`) to build with vendored libgit2 version without depending on the system's one [#&#8203;3426](sharkdp/bat#3426) ([@&#8203;0x61nas](https://github.com/0x61nas))
- Update syntect dependency to v5.3.0 to fix a few minor bugs, see [#&#8203;3410](sharkdp/bat#3410) ([@&#8203;keith-hall](https://github.com/keith-hall))

#### Syntaxes

- Add syntax mapping for `paru` configuration files [#&#8203;3182](sharkdp/bat#3182) ([@&#8203;cyqsimon](https://github.com/cyqsimon))
- Add support for [Idris 2 programming language](https://www.idris-lang.org/) [#&#8203;3150](sharkdp/bat#3150) ([@&#8203;buzden](https://github.com/buzden))
- Add syntax mapping for `nix`'s '`flake.lock` lockfiles [#&#8203;3196](sharkdp/bat#3196) ([@&#8203;odilf](https://github.com/odilf))
- Improvements to CSV/TSV highlighting, with autodetection of delimiter and support for TSV files, see [#&#8203;3186](sharkdp/bat#3186) ([@&#8203;keith-](https://github.com/keith-)
- Improve (Sys)log error highlighting, see [#&#8203;3205](sharkdp/bat#3205) ([@&#8203;keith-hall](https://github.com/keith-hall))
- Map `ndjson` extension to JSON syntax, see [#&#8203;3209](sharkdp/bat#3209) ([@&#8203;keith-hall](https://github.com/keith-hall))
- Map files with `csproj`, `vbproj`, `props` and `targets` extensions to XML syntax, see [#&#8203;3213](sharkdp/bat#3213) ([@&#8203;keith-hall](https://github.com/keith-hall))
- Add debsources syntax to highlight `/etc/apt/sources.list` files, see [#&#8203;3215](sharkdp/bat#3215) ([@&#8203;keith-hall](https://github.com/keith-hall))
- Add syntax definition and test file for GDScript highlighting, see [#&#8203;3236](sharkdp/bat#3236) ([@&#8203;chetanjangir0](https://github.com/chetanjangir0))
- Add syntax test file for Odin highlighting, see [#&#8203;3241](sharkdp/bat#3241) ([@&#8203;chetanjangir0](https://github.com/chetanjangir0))
- Update quadlet syntax mapping rules to cover quadlets in subdirectories [#&#8203;3299](sharkdp/bat#3299) ([@&#8203;cyqsimon](https://github.com/cyqsimon))
- Add syntax Typst [#&#8203;3300](sharkdp/bat#3300) ([@&#8203;cskeeters](https://github.com/cskeeters))
- Map `.mill` files to Scala syntax for Mill build tool configuration files [#&#8203;3311](sharkdp/bat#3311) ([@&#8203;krikera](https://github.com/krikera))
- Add syntax highlighting for VHDL, see [#&#8203;3337](sharkdp/bat#3337) ([@&#8203;JerryImMouse](https://github.com/JerryImMouse))
- Add syntax mapping for certbot certificate configuration [#&#8203;3338](sharkdp/bat#3338) ([@&#8203;cyqsimon](https://github.com/cyqsimon))
- Update Lean syntax from Lean 3 to Lean 4 [#&#8203;3322](sharkdp/bat#3322) ([@&#8203;YDX-2147483647](https://github.com/YDX-2147483647))
- Map `.flatpakref` and `.flatpakrepo` files to INI syntax [#&#8203;3353](sharkdp/bat#3353) ([@&#8203;Ferenc-](https://github.com/Ferenc-))
- Update hosts syntax [#&#8203;3368](sharkdp/bat#3368) ([@&#8203;keith-hall](https://github.com/keith-hall))
- Map `.kshrc` files to Bash syntax [#&#8203;3364](sharkdp/bat#3364) ([@&#8203;ritoban23](https://github.com/ritoban23))
- Map `/var/log/dmesg` files to Syslog syntax [#&#8203;3412](sharkdp/bat#3412) ([@&#8203;keith-hall](https://github.com/keith-hall))
- Add syntax definition and test file for Go modules(`go.mod` and `go.sum`) highlighting, see [#&#8203;3424](sharkdp/bat#3424) ([@&#8203;DarkMatter-999](https://github.com/DarkMatter-999))
- Syntax highlighting for typescript code blocks within Markdown files, see [#&#8203;3435](sharkdp/bat#3435) ([@&#8203;MuntasirSZN](https://github.com/MuntasirSZN))

#### Themes

- Add Catppuccin, see [#&#8203;3317](sharkdp/bat#3317) ([@&#8203;SchweGELBin](https://github.com/SchweGELBin))
- Updated Catppuccin, see [#&#8203;3333](sharkdp/bat#3333) ([@&#8203;SchweGELBin](https://github.com/SchweGELBin))
- Updated gruvbox, see [#&#8203;3372](sharkdp/bat#3372) ([@&#8203;Nicholas42](https://github.com/Nicholas42))
- Updated GitHub theme, see [#&#8203;3382](sharkdp/bat#3382) ([@&#8203;CosmicHorrorDev](https://github.com/CosmicHorrorDev))
- Updated ANSI theme to highlight JSON object keys differently from values, see [#&#8203;3413](sharkdp/bat#3413) ([@&#8203;keith-hall](https://github.com/keith-hall))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNTEuMSIsInVwZGF0ZWRJblZlciI6IjQxLjE1Mi45IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants