This PR is a complete rewrite of gleam-mode from scratch, under the ~Apache-2.0 License~ GPLv3 with copyright to @lpil (should he ever want to relicense it).
Imenu (find item—e.g. type def, functinon def—within file)
Formatting (by way of the gleam-format command which runs gleam format)
Compilation error recognition and jump-to-line
It also has the following limitations:
Indentation is best described as "meh", largely in part due to the tree-sitter-indent library being immature.
Requires a recursive git clone which may (?) prohibit it from being included in Melpa as-is. Since it relies on tree-sitter-gleam, it requires a compiled library version of that to be present somewhere. The current methodology is to incorporate tree-sitter-gleam as a git submodule, which gleam-mode will compile with cc if it does not find a compiled library asset. Another project with similar functionality, tree-sitter-langs, has a repository of compiled library assets which the mode will download and extract if they are missing. The downside of using this approach for gleam-mode is that someone would have to maintain a repository of compiled tree-sitter-gleam library assets for every platform that we'd want to support, which likely—at minimum—includes x86 Linux, x86 macOS, aarch64 macOS, x86 FreeBSD, and x86 Windows. I may be able to automate the building of all those library assets using GitHub Actions, nascent work for which has begun.
This PR is a complete rewrite of gleam-mode from scratch, under the ~Apache-2.0 License~ GPLv3 with copyright to @lpil (should he ever want to relicense it).
It is built upon tree-sitter-gleam, and has these features:
gleam-format
command which runsgleam format
)It also has the following limitations:
tree-sitter-indent
library being immature.tree-sitter-gleam
, it requires a compiled library version of that to be present somewhere. The current methodology is to incorporatetree-sitter-gleam
as a git submodule, which gleam-mode will compile withcc
if it does not find a compiled library asset. Another project with similar functionality, tree-sitter-langs, has a repository of compiled library assets which the mode will download and extract if they are missing. The downside of using this approach for gleam-mode is that someone would have to maintain a repository of compiledtree-sitter-gleam
library assets for every platform that we'd want to support, which likely—at minimum—includes x86 Linux, x86 macOS, aarch64 macOS, x86 FreeBSD, and x86 Windows. I may be able to automate the building of all those library assets using GitHub Actions, nascent work for which has begun.