aboutsummaryrefslogtreecommitdiff
path: root/helix-core
Commit message (Collapse)AuthorAge
...
* Add next paragraphIvan Tham2022-04-02
|
* Add (prev) paragraph motionIvan Tham2022-04-02
| | | | | | Also improved testing facility. Fix #1580
* Jump to the next number on the line before incrementing (#1778)antoyo2022-04-01
| | | | | | | * Jump to the next number on the line before incrementing Partially fix #1645 * Refactor to avoid duplicating find_nth_next
* Fix an issue that caused an empty indentation query to be used instead of ↵Triton1712022-04-01
| | | | | using the fallback method of copying the indentation from the current line. (#1908) Co-authored-by: Triton171 <triton0171@gmail.com>
* Indentation rework (#1562)Triton1712022-03-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * WIP: Rework indentation system * Add ComplexNode for context-aware indentation (including a proof of concept for assignment statements in rust) * Add switch statements to Go indents.toml (fixes the second half of issue #1523) Remove commented-out code * Migrate all existing indentation queries. Add more options to ComplexNode and use them to improve C/C++ indentation. * Add comments & replace Option<Vec<_>> with Vec<_> * Add more detailed documentation for tree-sitter indentation * Improve code style in indent.rs * Use tree-sitter queries for indentation instead of TOML config. Migrate existing indent queries. * Add documentation for the new indent queries. Change xtask docgen to look for indents.scm instead of indents.toml * Improve code style in indent.rs. Fix an issue with the rust indent query. * Move indentation test sources to separate files. Add `#not-kind-eq?`, `#same-line?` and `#not-same-line` custom predicates. Improve the rust and c indent queries. * Fix indent test. Improve rust indent queries. * Move indentation tests to integration test folder. * Improve code style in indent.rs. Reuse tree-sitter cursors for indentation queries. * Migrate HCL indent query * Replace custom loading in indent tests with a designated languages.toml * Update indent query file name for --health command. * Fix single-space formatting in indent queries. * Add explanation for unwrapping. Co-authored-by: Triton171 <triton0171@gmail.com>
* build(deps): bump smartstring from 1.0.0 to 1.0.1 (#1873)dependabot[bot]2022-03-29
| | | | | | | | | | | | | | | | | Bumps [smartstring](https://github.com/bodil/smartstring) from 1.0.0 to 1.0.1. - [Release notes](https://github.com/bodil/smartstring/releases) - [Changelog](https://github.com/bodil/smartstring/blob/master/CHANGELOG.md) - [Commits](https://github.com/bodil/smartstring/compare/v1.0.0...v1.0.1) --- updated-dependencies: - dependency-name: smartstring dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Fix typo in query parsing error message (#1856)Slin Lee2022-03-22
|
* ropey 1.4.1 fixes the issueBlaž Hrastnik2022-03-17
|
* Temporarily turn on unicode-linesBlaž Hrastnik2022-03-17
| | | | Ropey's non-unicode lines impl has some bugs still
* ropey 1.4.0 is out!Blaž Hrastnik2022-03-17
|
* Put esoteric line endings behind a feature flagBlaž Hrastnik2022-03-17
|
* Configure ropey to only use CR/CRLF line breaks by defaultBlaž Hrastnik2022-03-17
| | | | Fixes #1643
* Optimize rendering by using Ropey::byte_sliceBlaž Hrastnik2022-03-17
| | | | | | | This avoids costly conversions via byte_to_char (which are then reversed back into bytes internally in Ropey). Reduces time spent in slice/byte_to_char from ~24% to ~5%.
* Refactor :set to parse by deserializing values (#1799)Gokul Soumya2022-03-15
| | | | | * Refactor :set to parse by deserializing values * Implement serialize for idle_timeout config
* rename '--fetch/build-grammars' flags into '--grammar fetch/build'Michael Davis2022-03-10
| | | | | The old flags were a bit long. --grammar is also aliased to -g to make it even easier.
* migrate grammar fetching/building code into helix-loader crateMichael Davis2022-03-10
| | | | | | | | | 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.
* add 'use-grammars' to languages.tomlMichael Davis2022-03-10
| | | | | | | | The vision with 'use-grammars' is to allow the long-requested feature of being able to declare your own set of grammars that you would like. A simple schema with only/except grammar names controls the list of grammars that is fetched and built. It does not (yet) control which grammars may be loaded at runtime if they already exist.
* ensure rust grammar is available in CIMichael Davis2022-03-10
|
* replace all submodule documentation with flags documentationMichael Davis2022-03-10
|
* rename tree_sitter_library in LanguageConfig to 'grammar'Michael Davis2022-03-10
| | | | | | | | This is not strictly speaking necessary. tree_sitter_library was used by just one grammar: llvm-mir-yaml, which uses the yaml grammar. This will make the language more consistent, though. Each language can explicitly say that they use Some(grammar), defaulting when None to the grammar that has a grammar_id matching the language's language_id.
* migrate helix-syntax crate into helix-core and helix-termMichael Davis2022-03-10
| | | | | | | | | | | | helix-syntax mostly existed for the sake of the build task which checks and compiles the submodules. Since we won't be relying on that process anymore, it doesn't end up making much sense to have a very thin crate just for some functions that we could port to helix-core. The remaining build-related code is moved to helix-term which will be able to provide grammar builds through the --build-grammars CLI flag.
* add tree-sitter sources to languages.tomlMichael Davis2022-03-10
| | | | | | | | | | | | | | | | | | | | | | | | | Here we add syntax to the languages.toml languge [[grammar]] name = "<name>" source = { .. } Which can be used to specify a tree-sitter grammar separately of the language that defines it, and we make this distinction for two reasons: * In later commits, we will separate this code from helix-core and bring it to a new helix-loader crate. Using separate schemas for language and grammar configurations allows for a nice divide between the types needed to be declared in helix-loader and in helix-core/syntax * Two different languages may use the same grammar. This is currently the case with llvm-mir-yaml and yaml. We could accomplish a config that works for this with just `[[languages]]`, but it gets a bit dicey with languages depending on one another. If you enable llvm-mir-yaml and disable yaml, does helix still need to fetch and build tree-sitter-yaml? It could be a matter of interpretation.
* Add --health command for troubleshooting (#1669)Gokul Soumya2022-03-08
| | | | | | | | | | | | | | | * Move runtime file location definitions to core * Add basic --health command * Add language specific --health * Show summary for all langs with bare --health * Use TsFeature from xtask for --health * cargo fmt Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
* build(deps): bump once_cell from 1.9.0 to 1.10.0 (#1768)dependabot[bot]2022-03-08
| | | | | | | | | | | | | | | | | Bumps [once_cell](https://github.com/matklad/once_cell) from 1.9.0 to 1.10.0. - [Release notes](https://github.com/matklad/once_cell/releases) - [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md) - [Commits](https://github.com/matklad/once_cell/compare/v1.9.0...v1.10.0) --- updated-dependencies: - dependency-name: once_cell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Fix tab rendering to use dynamic tab widthBlaž Hrastnik2022-03-04
| | | | | | Each tab is just wide enough to round to the nearest tab stop. Refs #1243
* Reuse visual_coords_at_pos function in viewBlaž Hrastnik2022-03-04
|
* core: transaction: Resolve some TODOsBlaž Hrastnik2022-03-03
|
* Ensure non empty grouped nodes in textobject queriesGokul Soumya2022-03-01
|
* Allow capturing multiple nodes in textobject queriesGokul Soumya2022-03-01
| | | | | | | | | | | | | | Treesitter captures can contain multiple nodes like so: ``` (line_comment)+ @comment ``` This would match each line in a comment as a separate `@comment` capture when what we actually want is the whole set of contiguous `line_comment` nodes to be captured under the `@comment` capture. This commit enables this behaviour.
* build(deps): bump smartstring from 0.2.10 to 1.0.0 (#1722)dependabot[bot]2022-03-01
| | | | | | | | | | | | | | | | | Bumps [smartstring](https://github.com/bodil/smartstring) from 0.2.10 to 1.0.0. - [Release notes](https://github.com/bodil/smartstring/releases) - [Changelog](https://github.com/bodil/smartstring/blob/master/CHANGELOG.md) - [Commits](https://github.com/bodil/smartstring/compare/v0.2.10...v1.0.0) --- updated-dependencies: - dependency-name: smartstring dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Show surround delete and replace errors in editor (#1709)Gokul Soumya2022-02-28
| | | | | * Refactor surround commands to use early returns * Show surround delete and replace errors in editor
* Configurable auto pairs (#1624)Skyler Hawthorne2022-02-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * impl auto pairs config Implements configuration for which pairs of tokens get auto completed. In order to help with this, the logic for when *not* to auto complete has been generalized from a specific hardcoded list of characters to simply testing if the next/prev char is alphanumeric. It is possible to configure a global list of pairs as well as at the language level. The language config will take precedence over the global config. * rename AutoPair -> Pair * clean up insert_char command * remove Rc * remove some explicit cloning with another impl * fix lint * review comments * global auto-pairs = false takes precedence over language settings * make clippy happy * print out editor config on startup * move auto pairs accessor into Document * rearrange auto pair doc comment * use pattern in Froms
* build(deps): bump smartstring from 0.2.9 to 0.2.10 (#1692)dependabot[bot]2022-02-22
| | | | | | | | | | | | | | | | | Bumps [smartstring](https://github.com/bodil/smartstring) from 0.2.9 to 0.2.10. - [Release notes](https://github.com/bodil/smartstring/releases) - [Changelog](https://github.com/bodil/smartstring/blob/master/CHANGELOG.md) - [Commits](https://github.com/bodil/smartstring/compare/v0.2.9...v0.2.10) --- updated-dependencies: - dependency-name: smartstring dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Add object.movement for tree-sitter navigationGokul Soumya2022-02-15
|
* Add tree-sitter based function, class navigationGokul Soumya2022-02-15
|
* Refactor language config loading (#1658)Gokul Soumya2022-02-14
|
* Merge remote-tracking branch 'origin/master' into debugBlaž Hrastnik2022-02-13
|\
| * Replace tendril with smartstringBlaž Hrastnik2022-02-10
| | | | | | | | Slightly smaller API surface, less dependencies.
| * Show infobox with register contentsGokul Soumya2022-02-10
| |
| * build(deps): bump unicode-segmentation from 1.8.0 to 1.9.0 (#1632)dependabot[bot]2022-02-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bumps [unicode-segmentation](https://github.com/unicode-rs/unicode-segmentation) from 1.8.0 to 1.9.0. - [Release notes](https://github.com/unicode-rs/unicode-segmentation/releases) - [Commits](https://github.com/unicode-rs/unicode-segmentation/commits) --- updated-dependencies: - dependency-name: unicode-segmentation dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
| * build(deps): bump unicode-general-category from 0.4.0 to 0.5.1 (#1609)dependabot[bot]2022-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bumps [unicode-general-category](https://github.com/yeslogic/unicode-general-category) from 0.4.0 to 0.5.1. - [Release notes](https://github.com/yeslogic/unicode-general-category/releases) - [Commits](https://github.com/yeslogic/unicode-general-category/compare/0.4.0...0.5.1) --- updated-dependencies: - dependency-name: unicode-general-category dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
| * Allow specifying file start position (#445)Ivan Tham2022-01-23
| | | | | | Like helix-term/src/commands.rs:3426:15
| * Fix Clippy lints in tests (#1563)Omnikar2022-01-23
| | | | | | Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
| * cargo fmt + clippy lintBlaž Hrastnik2022-01-23
| |
| * Remove some TODOsBlaž Hrastnik2022-01-23
| |
| * cleanupBlaž Hrastnik2022-01-23
| |
| * fix: ensure_grapheme_boundary_next_byte needs to index at valid charBlaž Hrastnik2022-01-23
| |
| * Speed up ensure_next_boundary during renderBlaž Hrastnik2022-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | This code: let start = ensure_grapheme_boundary_next(text, text.byte_to_char(start)); let end = ensure_grapheme_boundary_next(text, text.byte_to_char(end)); Would convert byte to char index, but then internally immediately convert back to byte index, operate on it, then convert it to char index. This change reduces the amount of time spent in ensure_grapheme_boundary from 29% to 2%.
| * Make Layer::parse take &mut tree_sitter::ParserBlaž Hrastnik2022-01-23
| |
| * Use filter_map rather than flat_mapBlaž Hrastnik2022-01-23
| |