Commit Graph

23 Commits (a1c969012d0b3824c04257918edb3abe41d190fe)

Author SHA1 Message Date
Philipp Mildenberger 235237ddc4
Refactor 'helix-loader::merge_toml_values' to use a 'merge-depth' instead of 'merge_toplevel_arrays' (#3080)
- This ensures that other values than just the arrays are overridden, like nested objects, where it makes sense
- merge_depth is set to 3 so that top-level language features are merged (like 'scope'), but everything deeper is overridden with the user-config
2 years ago
bootra b7fa9ba601
Fix non-msvc grammar compile on Windows (#3190) 2 years ago
Skyler Hawthorne 0f3c10a021 Fix initial selection of Document in new view
When a new View of a Document is created, a default cursor of 0, 0 is
created, and it does not get normalized to a single width cursor until
at least one movement of the cursor happens. This appears to have no
practical negative effect that I could find, but it makes tests difficult
to work with, since the initial selection is not what you expect it to be.

This changes the initial selection of a new View to be the width of the
first grapheme in the text.
2 years ago
Skyler Hawthorne 502d3290fb improve test harness
* Use new macro syntax for encoding sequences of keys
* Make convenience helpers for common test pattern
* Use indoc for inline indented raw strings
* Add feature flag for integration testing to disable rendering
2 years ago
Michael Davis 0035c29fc1
Use a minimal binary to fetch grammar sources in release CI (#2557)
This is an optimization for the release CI. The release CI can take
a while since it compiles release builds for all operating systems.
We cut down on duplicate work and overall time by fetching
tree-sitter grammar repositories and then using those repositories
in all later steps. Previously we built all of helix just to run

    helix_loader::grammar::fetch_grammars()

which is wasteful on time. With this change we only build the
helix-loader crate.
2 years ago
Frojdholm f7c27b604f
Ignore SendErrors when handling grammars (#2641)
When handling grammars, fetching and building is done in a thread
pool.  Results are communicated over channels and the receiving
channel is closed on first error. This causes subsequent sends to
fail causing a mess in stderr. This ignores all SendErrors causing
only the first error to be printed.
2 years ago
Michael Zeller b43074dad3
illumos linker doesn't currently have -z relro (#2602) 2 years ago
Michael Davis 93e6eac15a
mention the C++ compiler in the grammar build failure message (#2597)
Earlier in the builder we enable C++ (`.cpp(true)`) but only mention
the C compiler in the build failure message. Some grammars that have
C++ external scanners can provoke build failures in this step if a
C++ compiler isn't installed, so mentioning it in the error message
should help out debugging.
2 years ago
Blaž Hrastnik 9191af3f8d
helix-loader + helix-core now compile for WASM 3 years ago
Michael Davis 2c7f770aa9
Only merge top-level array when merging `languages.toml` (#2215)
* Revert "Revert "override nested arrays when merging TOML (#2145)""

This reverts commit 35d2693630.

* flip top-level table merging flag
3 years ago
Blaž Hrastnik 35d2693630
Revert "override nested arrays when merging TOML (#2145)"
Looks like there's some follow-up issues

This reverts commit c8cfd0b1a0.
3 years ago
Michael Davis c8cfd0b1a0
override nested arrays when merging TOML (#2145)
We merge the elements of arrays for the top-level array. For
`languages.toml`, this is the array of languages. For any nested
arrays, we simply take the `right` array as-is instead of using
the union of `left` and `right`.

closes #1000
3 years ago
Ben Lee-Cohen 2bddec02e7
Fixing (in two ways) a small typo (#2156) 3 years ago
Kirawi c2a40d9d52
Add support for local language configuration (#1249)
* add local configuration

* move config loading to Application::new

* simplify find_root_impl
3 years ago
Michael Davis b03421a8c0
remove hardcoded '/' from grammar source path (#1986) 3 years ago
Marcin Puc f2dd3d4469
Avoid using the format ident Rust feature (#1881) 3 years ago
Michael Davis c6bd105484
fix enum definition for use-grammars selections (#1818)
See https://github.com/helix-editor/helix/discussions/1817

It looks like we need the enums to have the `only`/`except` fields in order
to deserialize correctly.
3 years ago
Michael Davis 98851d1594
remove stray 'println!' from grammar building function (#1785) 3 years ago
Michael Davis 7044d7d804 rename '--fetch/build-grammars' flags into '--grammar fetch/build'
The old flags were a bit long. --grammar is also aliased to -g to make
it even easier.
3 years ago
Michael Davis 6fcab90d16 only fetch git-sourced grammars
This is a bit of a micro-optimization: in the current setup we waste
a thread in the pool for a local grammar only to println! a message
saying we're skipping fetching because it's a local grammar.
3 years ago
Skyler Hawthorne a229f405cc shallow clone 3 years ago
Skyler Hawthorne 31b7596f09 fix context in error 3 years ago
Michael Davis 4fc991fdec migrate grammar fetching/building code into helix-loader crate
This is a rather large refactor that moves most of the code for
loading, fetching, and building grammars into a new helix-loader
module. This works well with the [[grammars]] syntax for
languages.toml defined earlier: we only have to depend on the types
for GrammarConfiguration in helix-loader and can leave all the
[[language]] entries for helix-core.
3 years ago