aboutsummaryrefslogtreecommitdiff
path: root/helix-core
Commit message (Collapse)AuthorAge
* Fix shellwords delimiter handling (#4098)A-Walrus2022-10-21
| | | | | | | | | * Fix shellwords delimiter handling This allows commands such as `:set statusline.center ["file-type"]` to work. Before the quotes within the list would mess it up. Also added a test to ensure correct behavior * Rename Delimiter -> OnWhitespace
* Fix multi byte auto pairs (#4024)Skyler Hawthorne2022-10-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix test::print for Unicode The print function was not generating correct translations when the input has Unicode (non-ASCII) in it. This is due to its use of String::len, which gives the length in bytes, not chars. * Fix multi-code point auto pairs The current code for auto pairs is counting offsets by summing the length of the open and closing chars with char::len_utf8. Unfortunately, this gives back bytes, and the offset needs to be in chars. Additionally, it was discovered that there was a preexisting bug where the selection was not computed correctly in the case that the cursor was: 1. a single grapheme in width 2. this grapheme was more than one char 3. the direction of the cursor is backwards 4. a secondary range In this case, the offset was not being added into the anchor. This was fixed. * migrate auto pairs tests to integration * review comments
* Allow using path suffixes to associate language file-types (#2455)midnightexigent2022-10-20
| | | | | | | | | | | | | | | | | | | | | | | | * feat(syntax): add strategy to associate file to language through pattern File path will match if it ends with any of the file types provided in the config. Also used this feature to add support for the .git/config and .ssh/config files * Add /etc/ssh/ssh_config to languages.toml * cargo xtask docgen * Update languages.md * Update languages.md * Update book/src/languages.md Co-authored-by: Ivan Tham <pickfire@riseup.net> * Update book/src/languages.md Co-authored-by: Ivan Tham <pickfire@riseup.net> Co-authored-by: Ivan Tham <pickfire@riseup.net>
* Merge pull request #2267 from dead10ck/fix-write-failBlaž Hrastnik2022-10-20
|\ | | | | Write path fixes
| * document should save even if formatter failsSkyler Hawthorne2022-10-19
| |
| * add conditional noop render backSkyler Hawthorne2022-10-19
| | | | | | | | It makes it much slower without stubbing this out
* | Pretty print `tree-sitter-subtree` expression (#4295)Fisher Darling2022-10-19
|/
* Log failures to load tree-sitter parsers as error (#4315)Michael Davis2022-10-16
| | | | | | | Info logs don't show up in the log file by default, but this line should: failures to load tree-sitter parser objects are useful errors. A parser might fail to load it is misconfigured (https://github.com/helix-editor/helix/pull/4303#discussion_r996448543) or if the file does not exist.
* Rename extend indent captures.Daniel Ebert2022-10-11
| | | | Clarify comments in indent code.
* Slightly change the behavior of the `@stop-extend` capture.Daniel Ebert2022-10-11
| | | | This improves the behavior in case of multiple nested extensions.
* Improve code style for tree-sitter indentation.Daniel Ebert2022-10-11
| | | | Split extend logic into a separate file.
* Fix a bug that caused the indent for the line below to also be added in rare ↵Triton1712022-10-11
| | | | cases at the beginning of a file.
* Fix clippy warning.Triton1712022-10-11
|
* Add `extend-indented` and `stop-extend` captures for indent queries.Triton1712022-10-11
| | | | Improve and re-enable python indent queries.
* do not reparse unmodified injections (#4146)Pascal Kuthe2022-10-11
|
* build(deps): bump smallvec from 1.9.0 to 1.10.0 (#4093)dependabot[bot]2022-10-03
| | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Use requested direction for new textobject selection rangeMichael Davis2022-10-03
| | | | | | | | | | | | | | | | | | This changes the behavior of operations like `]f`/`[f` to set the direction of the new range to the direction of the action. The original behavior was to always use the head of the next function. This is inconsistent with the behavior of goto_next_paragraph and makes it impossible to create extend variants of the textobject motions. This causes a behavior change when there are nested functions. The behavior in the parent commit is that repeated uses of `]f` will select every function in the file even if nested. With this commit, functions are skipped. It's notable that it's possible to emulate the original behavior by using the `ensure_selections_forward` (A-:) command between invocations of `]f`.
* build(deps): bump unicode-general-category from 0.5.1 to 0.6.0 (#3990)dependabot[bot]2022-09-26
| | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps): bump once_cell from 1.14.0 to 1.15.0 (#3987)dependabot[bot]2022-09-26
| | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Split helix_core::find_root and helix_loader::find_local_config_dirs (#3929)Riccardo Binetti2022-09-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Split helix_core::find_root and helix_loader::find_local_config_dirs The documentation of find_root described the following priority for detecting a project root: - Top-most folder containing a root marker in current git repository - Git repository root if no marker detected - Top-most folder containing a root marker if not git repository detected - Current working directory as fallback The commit contained in https://github.com/helix-editor/helix/pull/1249 extracted and changed the implementation of find_root in find_root_impl, actually reversing its result order (since that is the order that made sense for the local configuration merge, from innermost to outermost ancestors). Since the two uses of find_root_impl have different requirements (and it's not a matter of reversing the order of results since, e.g., the top repository dir should be used by find_root only if there's not marker in other dirs), this PR splits the two implementations in two different specialized functions. In doing so, find_root_impl is removed and the implementation is moved back in find_root, moving it closer to the documented behaviour thus making it easier to verify it's actually correct * helix-core: remove Option from find_root return type It always returns some result, so Option is not needed
* diagnostics: Use Vec<Tag> instead of Option<Vec<Tag>>Blaž Hrastnik2022-09-20
|
* Track source and tags in diagnostics (#3898)Luke Cycon2022-09-20
|
* build(deps): bump textwrap from 0.15.0 to 0.15.1 (#3906)dependabot[bot]2022-09-19
| | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps): bump unicode-segmentation from 1.9.0 to 1.10.0 (#3903)dependabot[bot]2022-09-19
| | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Fix typos (#3858)taupiqueur2022-09-17
|
* fix: map_err()? instead of unwrap (#3826)Alexander Brevig2022-09-13
|
* build(deps): bump once_cell from 1.13.1 to 1.14.0 (#3715)dependabot[bot]2022-09-05
| | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Fix cargo doc warnings, and add GitHub action to ensure it (#3650)A-Walrus2022-09-03
|
* Add query-check xtaskMichael Davis2022-08-31
|
* tree-sitter: Prevent panic on loading queriesMichael Davis2022-08-31
|
* tree-sitter: Refactor lazy query loadingMichael Davis2022-08-31
| | | | | | The code for loading queries can be shared between indent and textobjects queries. In both cases we want to kick an error message out to the logs.
* Fix extra selection with regex anchors (^,$) (#3598)A-Walrus2022-08-31
| | | Also added a bunch of tests to ensure correct behaviour
* Adjust `m` textobject description and minor code clarification (#3343)Daniel S Poulin2022-08-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update description of `m` textobject to its actual functionality Sometime recently the functionality of `m` was changed to match the nearest pair to the cursor, rather than the former functionality of matching the pair only if the cursor was on one of the brace characters directly. * Rename surround methods to reflect that they work on pairs The current naming suggests that they may work generally on any textobject, whereas their implementation really focuses on pairs. * Change description of m textobject to match actual functionality The current implementation of `m` no longer merely looks at the pair character the cursor is on, but actually will search for the pair (defined in helix-core/src/surround.rs) that encloses the cursor, and not the entire selection. * Accept suggested wording change Co-authored-by: Michael Davis <mcarsondavis@gmail.com> * Prefix pair surround for consistency Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Fix failing test with unicode-lines feature (#3455)A-Walrus2022-08-17
|
* Fix nondeterministic highlighting (#3275)A-Walrus2022-08-05
| | | | | | | | | | | | | | | | | * Fix nondeterministic highlighting This is done by prefering matches in the begining, ie for `keyword.function`, `keyword` is a better match than `function`. * Use all positions and not just leftmost Fixes possible edgecase with something like `function.method.builtin` and the queries `function.builtin` and `function.method` * Switch to bitmask for slightly better performance * Make matches from the start of string Also change comments to match new behaviour
* Avoid copying fragments (#3136)Matthias Deiml2022-08-04
| | | | | | | * Avoid copying fragments * Add slice / slices method * Better documentation for fragment and slice methods
* Resolve clippy lints (#3307)Omnikar2022-08-04
|
* Change default formatter for any language (#2942)PiergiorgioZagaria2022-08-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change default formatter for any language * Fix clippy error * Close stdin for Stdio formatters * Better indentation and pattern matching * Return Result<Option<...>> for fn format instead of Option * Remove unwrap for stdin * Handle FormatterErrors instead of Result<Option<...>> * Use Transaction instead of LspFormatting * Use Transaction directly in Document::format * Perform stdin type formatting asynchronously * Rename formatter.type values to kebab-case * Debug format for displaying io::ErrorKind (msrv fix) * Solve conflict? * Use only stdio type formatters * Remove FormatterType enum * Remove old comment * Check if the formatter exited correctly * Add formatter configuration to the book * Avoid allocations when writing to stdin and formatting errors * Remove unused import Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
* Exclude only named children without injection.include-children (#3129)Matthias Deiml2022-08-03
| | | | | * Exclude only named children without injection.include-children * Add injection.include-unnamed-children parameter
* build(deps): bump similar from 2.1.0 to 2.2.0 (#3293)dependabot[bot]2022-08-02
| | | | | | | | | | | | | | | | | Bumps [similar](https://github.com/mitsuhiko/similar) from 2.1.0 to 2.2.0. - [Release notes](https://github.com/mitsuhiko/similar/releases) - [Changelog](https://github.com/mitsuhiko/similar/blob/main/CHANGELOG.md) - [Commits](https://github.com/mitsuhiko/similar/compare/2.1.0...2.2.0) --- updated-dependencies: - dependency-name: similar 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>
* Suport diagnostic code (#3096)Erasin2022-07-26
| | | | | | | * add code for diagnostic. This PR provides a solution to resolve #2994. missing Code Actions for lsp * remote unused import
* Replace '; inherits <language>' in treesitter queries with <language> ↵Philipp Mildenberger2022-07-22
| | | | | queries instead of appending them (#2470) Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
* respect count in treesitter movement (#3058)Bob2022-07-14
|
* Fix some typos (#2978)A-Walrus2022-07-06
|
* build(deps): bump smallvec from 1.8.1 to 1.9.0 (#2976)dependabot[bot]2022-07-05
| | | | | | | | | | | | | | | | Bumps [smallvec](https://github.com/servo/rust-smallvec) from 1.8.1 to 1.9.0. - [Release notes](https://github.com/servo/rust-smallvec/releases) - [Commits](https://github.com/servo/rust-smallvec/compare/v1.8.1...v1.9.0) --- updated-dependencies: - dependency-name: smallvec 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 once_cell from 1.12.0 to 1.13.0 (#2969)dependabot[bot]2022-07-05
| | | | | | | | | | | | | | | | | Bumps [once_cell](https://github.com/matklad/once_cell) from 1.12.0 to 1.13.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.12.0...v1.13.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>
* Add workspace and document diagnostics picker (#2013)Falco Hirschenberger2022-06-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add workspace and document diagnostics picker fixes #1891 * Fix some of @archseer's annotations * Add From<&Spans> impl for String * More descriptive parameter names. * Adding From<Cow<str>> impls for Span and Spans * Add new keymap entries to docs * Avoid some clones * Fix api change * Update helix-term/src/application.rs Co-authored-by: Bjorn Ove Hay Andersen <bjrnove@gmail.com> * Fix a clippy hint * Sort diagnostics first by URL and then by severity. * Sort diagnostics first by URL and then by severity. * Ignore missing lsp severity entries * Add truncated filepath * Typo * Strip cwd from paths and use url-path without schema * Make tests a doctest * Better variable names Co-authored-by: Falco Hirschenberger <falco.hirschenberger@itwm.fraunhofer.de> Co-authored-by: Bjorn Ove Hay Andersen <bjrnove@gmail.com>
* Fix edge-case in tree-sitter expand_selection selection command (#2877)Triton1712022-06-25
| | | Co-authored-by: Triton171 <triton0171@gmail.com>
* fixes showing the last prompt on empty input (#2870)Saber Haj Rabiee2022-06-24
|
* Merge pull request #2359 from dead10ck/test-harnessBlaž Hrastnik2022-06-21
|\ | | | | Integration testing harness