Commit Graph

223 Commits (26b3dc29be886c5a2ed1a5caaaf09eb730829c3e)

Author SHA1 Message Date
Nathan Vegdahl a77274e8bb Merge branch 'master' into great_line_ending_and_cursor_range_cleanup 2021-07-17 10:49:03 -07:00
Blaž Hrastnik dd2903ff10 Dynamically load grammar libraries at runtime 2021-07-14 10:00:05 +09:00
Kirawi 084a8a9522
Rewritten Rust `highlights.scm` (#425)
* rewrote Rust highlights.scm

* wip

* wip

* wip

* wip

* fixed type highlighting

* wip

* rewrite again

* moved operators

* missing newline

* missing newline

* update book

* fix constructor highlighting

* fix constructor highlighting

* fix const highlighting

* better constructor highlighting

* remove dup, bug was my locals.scm file

* fixed docs

* merge

* fixed for highlighting

* add yield

* remove yield

* added yield back

* fixed yield highlighting

* unecessary
2021-07-09 01:11:20 +09:00
Nathan Vegdahl 85d5b399de Merge branch 'master' into great_line_ending_and_cursor_range_cleanup 2021-07-05 20:27:49 -07:00
Nathan Vegdahl 22dca3b111 Allow last line in file to lack a line break character. 2021-07-01 23:36:09 -07:00
Perry Thompson e177b27baf Add missing import 2021-07-02 12:10:15 +09:00
Nathan Vegdahl 9f62ad0715 Fixed last `unused` warning. 2021-07-01 19:06:52 -07:00
Nathan Vegdahl c389f41f14 Fix one of the two remaining warnings.
One of them was a lot more obvious than I thought.
2021-07-01 19:06:52 -07:00
Nathan Vegdahl 220bc85821 Fix all remaining warnings in helix-core except for two.
I'm not sure how to address them, because they look like they
might be bugs, and code is involved.  Will poke the relevant people.
2021-07-01 19:06:52 -07:00
Nathan Vegdahl b571f28641 Remove #[allow(unused)] from helix-core, and fix unused imports.
Still a bunch more warnings to fix in core, but it's a start.
2021-07-01 19:06:52 -07:00
Blaž Hrastnik d4e1ec339e Don't crash if diagnostics span past EOF 2021-06-28 14:50:35 +09:00
Blaž Hrastnik 1b102d5532 Extract the merge "operator" into helix-core 2021-06-27 23:28:22 +09:00
Blaž Hrastnik 44566ea812 Release 0.3.0 2021-06-27 13:27:47 +09:00
Nathan Vegdahl e686c3e462 Merge branch 'master' of github.com:helix-editor/helix into line_ending_detection
Rebasing was making me manually fix conflicts on every commit, so
merging instead.
2021-06-20 16:09:14 -07:00
Nathan Vegdahl 4efd6713c5 Work on moving code over to LineEnding instead of assuming '\n'.
Also some general cleanup and some minor fixes along the way.
2021-06-20 15:33:02 -07:00
wojciechkepka 6825e19509 Only reconfiure highlights when setting theme 2021-06-20 00:07:13 +09:00
wojciechkepka ce97a2f05f Add ability to change theme on editor 2021-06-20 00:07:13 +09:00
Wojciech Kępka 716067ba05 Add more ways to detect runtime directory 2021-06-12 17:26:41 +08:00
Blaž Hrastnik 278361a086 Only auto-format for certain languages
Fixes #53
Fixes #207
2021-06-12 10:20:37 +09:00
Ivan Tham 7cc13fefe9 Derive debug without feature
Note that this also removed those `finish_non_exhaustive()`.
2021-06-10 22:00:08 +09:00
notoria 1a3a924634 Implement Debug for data structure as a feature 2021-06-10 22:00:08 +09:00
Blaž Hrastnik aebdef8257 Reuse a cursor from the pool if available (fixes #202) 2021-06-10 12:49:34 +09:00
Brian Dawn 5463a436a8 Return an error if we request an embedded file that does not exist.
This makes the load_runtime_file function behave like the non-embedded
one.
2021-06-06 10:49:17 +09:00
Brian Dawn e09b0f4eff Add a smoke test around loading runtime files.
This test makes sure we can read some amount of data from the runtime folder.
2021-06-06 10:49:17 +09:00
Brian Dawn f3db12e240 Simplify the load_runtime_file code.
Reduce the number of feature switches for the embed_runtime feature.
2021-06-06 10:49:17 +09:00
Brian Dawn 676719b361 Simplify creating pathbufs.
Co-authored-by: Ivan Tham <pickfire@riseup.net>
2021-06-06 10:49:17 +09:00
Brian Dawn ae105812d6 Apply suggestions from code review
Co-authored-by: Ivan Tham <pickfire@riseup.net>
2021-06-06 10:49:17 +09:00
Brian Dawn 62d181de78 Provide a feature flag to be able to embed the runtime folder.
These changes provide a new feature flag "embed_runtime" that when
enabled and built in release mode will embed the runtime folder into the
resulting binary.
2021-06-06 10:49:17 +09:00
Blaž Hrastnik 06d8d3f55f Try to detect language when document file path is set
Fixes #91
2021-06-04 11:03:40 +09:00
Blaž Hrastnik 094203c74e Update deps, introduce the new tree-sitter lifetimes 2021-05-28 00:00:51 +09:00
Blaž Hrastnik 4a9d1163e0 Hacky way to specify indent scopes per language via toml configs.
Can't do it via a scm query nicely because it returns an iterator over
all the matches, whereas we want to traverse the tree ourselves.

Can't extract the pattern data from a parsed query either.

Oh well, toml files for now.
2021-05-14 19:21:46 +09:00
Blaž Hrastnik cd1754f783 Fix runtime dir lookup. 2021-05-10 17:37:04 +09:00
Blaž Hrastnik 0f77f543e5 Determine runtime dir based on executable location or env override. 2021-05-10 01:02:53 +09:00
Blaž Hrastnik fd4fd12fa3 clippy lint 2021-05-06 17:20:00 +09:00
Blaž Hrastnik c1e5733b02 Remove the path specifier. 2021-04-09 18:57:46 +09:00
Blaž Hrastnik 71c06c11cb Import tree sitter queries. 2021-04-08 23:25:35 +09:00
Blaž Hrastnik f0d49d3ca4 hack: make queries load relative to source dir for now.
We want to provide a runtime dir later on.
2021-04-07 18:05:59 +09:00
Blaž Hrastnik 9eaef6e333 Fully drop State references. 2021-03-31 15:45:18 +09:00
Blaž Hrastnik b52474cf66 clippy lint 2021-03-27 12:14:58 +09:00
Blaž Hrastnik ad3325db8e minor: Remove a few unwraps. 2021-03-26 11:03:14 +09:00
Blaž Hrastnik 8b28bf2533 Fix broken test. 2021-03-25 16:53:32 +09:00
Blaž Hrastnik e3c4edae32 Add the machinery to load syntax config from TOML.
It's embedded into the binary at build time for now, but it's progress.
2021-03-25 15:26:25 +09:00
Blaž Hrastnik 06aca7691c clippy lint 2021-03-24 14:58:01 +09:00
Blaž Hrastnik 5e6716c89c Add tab_width and indent_unit config. 2021-03-22 13:53:36 +09:00
Blaž Hrastnik cbcacb1063 Merge some imports. 2021-03-22 12:40:07 +09:00
Blaž Hrastnik dbcc099f48 Move things out of state.rs. 2021-03-18 14:07:53 +09:00
Blaž Hrastnik 8eaf9a432d Make Transaction::change only rely on the rope. 2021-03-18 13:39:56 +09:00
Blaž Hrastnik 4f77d80e74 Clippy lint 2021-03-16 13:51:35 +09:00
Blaž Hrastnik 081e0ae8ae syntax: highlight_iter always returns Ok() 2021-03-16 13:51:35 +09:00
Blaž Hrastnik 71f899cb5b syntax: Highlight using ropes, avoiding dumping whole doc to string. 2021-03-16 13:47:06 +09:00
Blaž Hrastnik bb87b08fc9 Configure language servers via LanguageConfiguration. 2021-03-14 17:14:34 +09:00
Blaž Hrastnik 1cf887dea9 Cleanup: use doc.selection() instead of doc.state.selection(). 2021-03-14 17:14:34 +09:00
Blaž Hrastnik 3445abf88e syntax: Hide the TSParser internally, borrowing when needed. 2021-03-13 11:06:02 +09:00
Blaž Hrastnik b7dd7310c4 syntax: Reuse parser instances. highlight_iter() no longer needs &mut. 2021-03-12 14:46:23 +09:00
Blaž Hrastnik a16c6e2585 clippy lints 2021-03-01 17:37:31 +09:00
Blaž Hrastnik 87a6d4e736 minor: Simplify some code. 2021-02-24 16:07:39 +09:00
Blaž Hrastnik c9dd1c930e treewide: &RopeSlice -> RopeSlice. It's Copy so no reason to pass by ref 2021-02-18 18:34:22 +09:00
Blaž Hrastnik b4312c9492 transaction: Use builder methods to generate compact changesets. 2021-02-16 11:03:36 +09:00
Blaž Hrastnik a7869c728c wip 2020-12-03 13:12:07 +09:00
Blaž Hrastnik b39849dde1 Refactor: Document type as a wrapper around barebones State. 2020-12-03 13:10:35 +09:00
Blaž Hrastnik 6e658aae1c Auto-indent on enter based on tree-sitter scopes. 2020-10-14 18:07:42 +09:00
Blaž Hrastnik 00e661f600 Indent draft, linewise paste 2020-10-13 23:13:56 +09:00
Blaž Hrastnik 5392b48268 Drop Coords. 2020-10-07 13:59:19 +09:00
Blaž Hrastnik 3feb00283d clippy warnings 2020-09-29 18:07:05 +09:00
Blaž Hrastnik 36e7e2133f Split selection on regex, fix InputEdit generation. 2020-09-29 01:01:27 +09:00
Blaž Hrastnik 3020077da8 Extend selection commands. 2020-09-29 01:00:35 +09:00
Blaž Hrastnik eb639eb2e4 More robust syntax detection/grammar loading. 2020-09-22 18:27:37 +09:00
Blaž Hrastnik b120515613 Range based highlight_iter. Only works on limiting the start right now 2020-09-19 11:58:08 +09:00
Blaž Hrastnik 3859f6963d More work on the UI. 2020-09-19 11:58:08 +09:00
Blaž Hrastnik 088f8a82af Incremental parsing: rough draft. 2020-09-17 16:32:40 +09:00
Blaž Hrastnik 593f33dca6 Fix clippy warnings. 2020-09-13 11:36:48 +09:00
Blaž Hrastnik 9546164dc8 cargo fmt & clippy lint 2020-09-12 19:38:30 +09:00
Blaž Hrastnik a106be94f1 Refactor a little bit. 2020-09-12 17:44:57 +09:00