aboutsummaryrefslogtreecommitdiff
path: root/helix-core
Commit message (Collapse)AuthorAge
* Remove unnecessary `Err` from `get_canonicalized_path` (#8009)nkitsaini2023-08-20
| | | | Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Update tree-sitter to latest master (#7998)Michael Davis2023-08-19
|
* build(deps): bump bitflags from 2.3.3 to 2.4.0 (#7943)dependabot[bot]2023-08-15
| | | | | | | | | | | | | | | | Bumps [bitflags](https://github.com/bitflags/bitflags) from 2.3.3 to 2.4.0. - [Release notes](https://github.com/bitflags/bitflags/releases) - [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md) - [Commits](https://github.com/bitflags/bitflags/compare/2.3.3...2.4.0) --- updated-dependencies: - dependency-name: bitflags 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>
* Prevent GraphemeStrs created from Strings from leaking (#7920)Dillard Robertson2023-08-13
|
* Run indentation tests on a part of the Helix source code.Daniel Ebert2023-08-11
| | | | Add C++ indent test file.
* Implement @align (and @anchor) indent query.Daniel Ebert2023-08-11
|
* Fix YAML auto indentSkyler Hawthorne2023-08-10
| | | | | | | | | YAML indents queries are tweaked to fix auto indent behavior. A new capture type `indent.always` is introduced to address use cases where combining indent captures on a single line is desired. Fixes #6661
* add node boundary movementSkyler Hawthorne2023-08-01
|
* Use refactored Registers typeMichael Davis2023-07-31
| | | | | | | This is an unfortunately noisy change: we need to update virtually all callsites that access the registers. For reads this means passing in the Editor and for writes this means handling potential failure when we can't write to a clipboard register.
* Add '#' and '.' special registersMichael Davis2023-07-31
| | | | | | | | | | | | | | | | | | These come from Kakoune: * '#' is the selection index register. It's read-only and produces the selection index numbers, 1-indexed. * '.' is the selection contents register. It is also read-only and mirrors the contents of the current selections when read. We switch the iterators returned from Selection's `fragments` and `slices` methods to ExactSizeIterators because: * The selection contents register can simply return the fragments iterator. * ExactSizeIterator is already implemented for iterators over Vecs, so it's essentially free. * The `len` method can be useful on its own.
* Reformat with nightly rustfmt for better let-else formatting (#7721)Philipp Mildenberger2023-07-27
|
* pin TS to unreleased git revision to fix freezes (#7737)Pascal Kuthe2023-07-27
|
* Prefer RopeSlice to &Rope in helix_core::syntaxMichael Davis2023-07-27
| | | | | | | | | | | | | | | Pascal and I discussed this and we think it's generally better to take a 'RopeSlice' rather than a '&Rope'. The code block rendering function in the markdown component module is a good example for how this can be useful: we can remove an allocation of a rope and instead directly turn a '&str' into a 'RopeSlice' which is very cheap. A change to prefer 'RopeSlice' to '&Rope' whenever the rope isn't modified would be nice, but it would be a very large diff (around 500+ 500-). Starting off with just the syntax functions seems like a nice middle-ground, and we can remove a Rope allocation because of it. Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
* build(deps): bump indoc from 2.0.2 to 2.0.3 (#7663)dependabot[bot]2023-07-18
| | | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* use a single query for injectionsPascal Kuthe2023-07-17
| | | | In the past we used two separate queries for combined and normal injections. There was no real reason for this (except historical/slightly easier implementation). Instead, we now use a single query and simply check if an injection corresponds to a combined injection or not.
* fix crash when encountering overlapping injectionsPascal Kuthe2023-07-17
|
* Fix crash when cwd is deleted (#7185)Yomain2023-07-11
|
* search buffer contents during global search (#5652)Pascal Kuthe2023-07-11
|
* build(deps): bump smallvec from 1.10.0 to 1.11.0 (#7597)dependabot[bot]2023-07-11
| | | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps): bump indoc from 2.0.1 to 2.0.2 (#7529)dependabot[bot]2023-07-04
| | | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* correctly map unsorted positions (#7471)Pascal Kuthe2023-06-28
| | | | | | | | | | | * correctly map unsorted positions * Fix typo Co-authored-by: Michael Davis <mcarsondavis@gmail.com> --------- Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* move normalize fastpath into normalize functionPascal Kuthe2023-06-25
|
* map positions through changes in O(N)Pascal Kuthe2023-06-25
|
* Allow any indent size from 1 to 16 (#7429)Scott Driggers2023-06-23
|
* make TS matching fallback to plaintextPascal Kuthe2023-06-22
|
* Avoid false positives in non-fuzzy bracket matchPascal Kuthe2023-06-22
|
* match pairs which don't form a standalone TS nodePascal Kuthe2023-06-22
|
* Fix tree sitter chunking (#7417)A-Walrus2023-06-21
| | | | | Call as bytes before slicing, that way you can take bytes that aren't aligned to chars. Should technically also be slightly faster since you don't have to check alignment...
* Add config for default line ending (#5621)Alex2023-06-16
|
* Fix next/prev tree-sitter inconsistency (#7332)A-Walrus2023-06-13
| | | | | | | | | * Fix next/prev tree-sitter inconsistency Before there where different results going to next or previous due to sorting not dealing with multiple captures that start/end at the same pos. I chose to prefer longer matches. * Revert unnecessary change
* add move_prev_long_word_end and extend_prev_long_word_end (#6905)vwkd2023-06-07
|
* Add check for a non-zero value for tab width (#7178)Ilya Sovtsov2023-06-07
|
* build(deps): bump once_cell from 1.17.2 to 1.18.0 (#7248)dependabot[bot]2023-06-06
| | | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps): bump hashbrown from 0.13.2 to 0.14.0 (#7246)dependabot[bot]2023-06-06
| | | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* feat(core): add plaintext matching fallback to tree-sitter matching (#4288)Alex Vinyals2023-06-05
|
* Fix typo in syntax.rs (#7114)Ikko Eltociear Ashimine2023-05-26
| | | seperator -> separator
* build(deps): bump bitflags from 2.2.1 to 2.3.1 (#7117)dependabot[bot]2023-05-23
| | | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Add command to merge non-consecutive ranges (#7053)Szabin2023-05-19
| | | | | | | | | | | * Add command for merging non-consecutive ranges * Add `merge_selections` command to book * Simplify `merge_ranges` Heeded the advice of @the-mikedavis to stop iterating over all ranges and simply merge the first and the last range, as the invariants of `Selection` guarantee that the list of ranges is always sorted and never empty. * Clarify doc comment of `merge_ranges`
* Refactor doc language servers to a HashMap, and the config to use a Vec to ↵Philipp Mildenberger2023-05-18
| | | | retain order
* Simplify Display implementation for LanguageServerFeaturePhilipp Mildenberger2023-05-18
|
* Refactored doc.language_servers and doc.language_servers_with_feature to ↵Philipp Mildenberger2023-05-18
| | | | | | return an iterator and refactor LanguageServerFeature handling to a HashMap (language server name maps to features) Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
* Simplify Display implementation of LanguageServerFeaturePhilipp Mildenberger2023-05-18
| | | | Co-authored-by: Ivan Tham <pickfire@riseup.net>
* Adds support for multiple language servers per language.Philipp Mildenberger2023-05-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Language Servers are now configured in a separate table in `languages.toml`: ```toml [langauge-server.mylang-lsp] command = "mylang-lsp" args = ["--stdio"] config = { provideFormatter = true } [language-server.efm-lsp-prettier] command = "efm-langserver" [language-server.efm-lsp-prettier.config] documentFormatting = true languages = { typescript = [ { formatCommand ="prettier --stdin-filepath ${INPUT}", formatStdin = true } ] } ``` The language server for a language is configured like this (`typescript-language-server` is configured by default): ```toml [[language]] name = "typescript" language-servers = [ { name = "efm-lsp-prettier", only-features = [ "format" ] }, "typescript-language-server" ] ``` or equivalent: ```toml [[language]] name = "typescript" language-servers = [ { name = "typescript-language-server", except-features = [ "format" ] }, "efm-lsp-prettier" ] ``` Each requested LSP feature is priorized in the order of the `language-servers` array. For example the first `goto-definition` supported language server (in this case `typescript-language-server`) will be taken for the relevant LSP request (command `goto_definition`). If no `except-features` or `only-features` is given all features for the language server are enabled, as long as the language server supports these. If it doesn't the next language server which supports the feature is tried. The list of supported features are: - `format` - `goto-definition` - `goto-declaration` - `goto-type-definition` - `goto-reference` - `goto-implementation` - `signature-help` - `hover` - `document-highlight` - `completion` - `code-action` - `workspace-command` - `document-symbols` - `workspace-symbols` - `diagnostics` - `rename-symbol` - `inlay-hints` Another side-effect/difference that comes with this PR, is that only one language server instance is started if different languages use the same language server.
* automatically disable TS when parsing takes longer than 500msPascal Kuthe2023-05-18
|
* don't move cursor while forward deleting in append modePascal Kuthe2023-05-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, when forward deleting (`delete_char_forward` bound to `del`, `delete_word_forward`, `kill_to_line_end`) the cursor is moved to the left in append mode (or generally when the cursor is at the end of the selection). For example in a document `|abc|def` (|indicates selection) if enter append mode the cursor is moved to `c` and the selection becomes: `|abcd|ef`. When deleting forward (`del`) `d` is deleted. The expectation would be that the selection doesn't shrink so that `del` again deletes `e` and then `f`. This would look as follows: `|abcd|ef` `|abce|f` `|abcf|` `|abc |` This is inline with how other editors like kakoune work. However, helix currently moves the selection backwards leading to the following behavior: `|abcd|ef` `|abc|ef` `|ab|ef` `ef` This means that `delete_char_forward` essentially acts like `delete_char_backward` after deleting the first character in append mode. To fix the problem the cursor must be moved to the right while deleting forward (first fix in this commit). Furthermore, when the EOF char is reached a newline char must be inserted (just like when entering appendmode) to prevent the cursor from moving to the right
* fix panic when deleting overlapping rangesPascal Kuthe2023-05-18
| | | | | | | | | | | | | Some deletion operations (especially those that use indentation) can generate overlapping deletion ranges when using multiple cursors. To fix that problem a new `Transaction::delete` and `Transaction:delete_by_selection` function were added. These functions merge overlapping deletion ranges instead of generating an invalid transaction. This merging of changes is only possible for deletions and not for other changes and therefore require its own function. The function has been used in all commands that currently delete text by using `Transaction::change_by_selection`.
* Fix warnings from clippy (#7013)ZJPzjp2023-05-11
| | | | | * Fix warnings from clippy * revert MAIN_SEPARATOR_STR
* build(deps): bump etcetera from 0.7.1 to 0.8.0 (#6931)dependabot[bot]2023-05-02
| | | | | | | | | | | | | | | Bumps [etcetera](https://github.com/lunacookies/etcetera) from 0.7.1 to 0.8.0. - [Release notes](https://github.com/lunacookies/etcetera/releases) - [Commits](https://github.com/lunacookies/etcetera/compare/v0.7.1...v0.8.0) --- updated-dependencies: - dependency-name: etcetera 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>
* inject language based on file extension & shebang (#3970)Timothy DeHerrera2023-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * inject language based on file extension Nodes can now be captured with "injection.filename". If this capture contains a valid file extension known to Helix, then the content will be highlighted as that language. * inject language by shebang Nodes can now be captured with "injection.shebang". If this capture contains a valid shebang line known to Helix, then the content will be highlighted as the language the shebang calls for. * add documentation for language injection * nix: fix highlights The `@` is now highlighted properly on either side of the function arg. Also, extending the phases with `buildPhase = prev.buildPhase + ''''` is now highlighted properly. Fix highlighting of `''$` style escapes (requires tree-sitter-nix bump) Fix `inherit` highlighting. * simplify injection_for_match Split out injection pair logic into its own method to make the overall flow easier to follow. Also transform the top-level function into a method on a HighlightConfiguration. * markdown: add shebang injection query
* feat(commands): add clear-register typable command (#5695)jorge2023-04-27
| | | Co-authored-by: Jorge <chorcheus@tutanota.com>