helix
helix copied to clipboard
compilation-mode or vim :make
Idea
Have an emacs-like compilation-mode or a :make command like in vim (we should change the make command)
This is too young to consider integrating any time soon but Build Server Protocol (BSP) looks like a possible way to support this similar to LSP/DAP. From what I can tell, it's primarily meant to help the Language Server but editors can be clients as well.
Please
This would be a gamechanger for me
Build Server Protocol support would be huge for me as well. Bazel is a popular build tool, and BSP support would let me have error-underlines in Bazel projects that are incompatible with the LSPs for whatever languages the projects use.
It still seems that BSP is immature. Their implementations page only lists servers for JVM languages and an inactive repo for working with Rust.
I think it would be premature to select a solution before it is shown to work broadly as is the case with tree-sitter and LSP.
A good measure of maturity, in my opinion, is if the solution can integrate with Bazel, make, cmake, and a good handful of languages that use individual build tools, such as Rust, Go, and Haskell.
I presume the BSP solution would only work for build tools that support it, but that rules out environments where there is only a small build tool that won't add support for it, or none at all. For example: command runners, script-based builds and one-line build commands. In these cases, the only solution is what Emacs does: parsing the build output with Regex. This might not be as bad as it first sounds, especially since many languages use the "Unix" style of error messages. For reference, the Emacs compilation error regex list has 65 entries in total, which is not completely unreasonable to implement in the first place, but many of them can be dropped, added later, added through configuration, etc...
I've been working on a prototype of how something like a make command could be implemented, its still pretty basic and for now only supports gcc/clang output formatting, its not done using regex, but i dont think it would be really hard to switch to regex based parsing
for now it works like this :make --format clang your-command
it then parses the ouput and puts it in a picker list i also plan to implement a lsp diagnostic like display for the errors from the list
heres the repo https://github.com/szulf/helix/tree/make-list
(its entirely possible that this code is shit, since im a junior, and have almost no rust experience)