Commit Graph

982 Commits (a0abf8b94d77a8be5339765c41a0b85a6c854365)

Author SHA1 Message Date
Nik Revenco a0abf8b94d
Merge ed80c33ad1 into b01fbb4a22 2025-07-21 13:37:26 -07:00
Michael Davis 727758e068
Add syntax symbol pickers based on tags.scm queries 2025-07-18 11:16:42 -04:00
Michael Davis 2d5826d194
Complete words from open buffers (#13206) 2025-07-18 09:51:00 -05:00
dependabot[bot] ab668c2dfc
build(deps): bump toml from 0.8.23 to 0.9.2 in the rust-dependencies group (#13955)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2025-07-16 08:18:17 -05:00
Pascal Kuthe 205e7ece70
update imara-diff (#13722) 2025-06-14 16:14:27 -04:00
Michael Davis f4b488e380
Remove unused `helix_core::graphemes::is_grapheme_boundary`
This function was never used and will be superseded by
`RopeSliceExt::is_grapheme_boundary` (which accepts a byte index rather
than a character index) once we transition to Ropey v2. In the meantime
any callers should convert to byte index and use the `RopeSliceExt`
extension rather than form new dependencies on this.
2025-06-06 18:24:44 -04:00
Michael Davis 7410fe35a3
Update tree-house and bindings to v0.2.0 2025-06-06 17:14:08 -04:00
Michael Davis b1f4717356
Allow multiple `#not-kind-eq?` predicates in indent queries
This fixes a regression from the switch to tree-house with one of the
custom predicates in indent queries: `#not-kind-eq?`. This predicate
should be allowed to be written multiple times in a pattern. For example
in the Go indents:

    ; Switches and selects aren't indented, only their case bodies are.
    ; Outdent all closing braces except those closing switches or selects.
    (
        (_ "}" @outdent) @outer
        (#not-kind-eq? @outer "select_statement")
        (#not-kind-eq? @outer "type_switch_statement")
        (#not-kind-eq? @outer "expression_switch_statement")
    )

So instead of an `Option<T>` of one we need a `Vec<T>` and we need to
check that all of these predicates are individually satisfied (basically
`iter().all(/* node kind is not expected kind for that capture */)`).
2025-06-06 12:14:43 -04:00
Michael Davis 8961ae1dc6
Consistently use `helix_core::config::default_{lang,config}_loader`
This avoids using any custom configuration in a user-defined
`languages.toml` config for the syntax test cases. The test cases should
only use the builtin `languages.toml` config.

Also the xtask crate reimplemented `default_lang_loader` and
`default_lang_config`. These functions are replaced with calls into
`helix_core`.
2025-05-29 09:55:26 -04:00
Michael Davis 5a1dcc2429
syntax: Reset query cursor byte range for textobjects
`InactiveQueryCursor::new` might reuse a query cursor from a
thread-local cache if one is available, rather than create a new cursor.
Currently tree-house does not reset cached cursors back to defaults
(i.e. byte range and match limit). For now we can patch around this here
but eventually this should be fixed in `tree-house` upstream. Then this
patch can be reverted.

In practice this caused textobjects like `]f` to get "stuck" trying to
move to the next function if it was out of the current view. This is
because the highlight query cursor sets the range of the cursor to the
current viewport. We can reset the byte range to defaults to fix the
textobject behavior.
2025-05-17 10:30:30 -04:00
Michael Davis 09bc67ad6d
syntax: Fix language detection by shebang
The switch to tree-house accidentally dropped some shebang parsing code
from the loader's function to detect by shebang. This change restores
that. The new code is slightly different as it's using a `regex_cursor`
regex on the Rope rather than eagerly converting the text to a
`Cow<str>` and running a regular regex across it.
2025-05-14 16:30:29 -04:00
Michael Davis aea53523dd
Replace tree-sitter with tree-house 2025-05-13 18:43:43 -04:00
Michael Davis 24e3ccc31b
Add the `syn_loader` to `Document`
This type also exists on `Editor`. This change brings it to the
`Document` as well because the replacement for `Syntax` in the child
commits will eliminate `Syntax`'s copy of `syn_loader`. `Syntax` will
also be responsible for returning the highlighter and query iterators
(which will borrow the loader), so the loader must be separated from
that type.

In the long run, when we make a larger refactor to have
`Document::apply` be a function of the `Editor` instead of the
`Document`, we will be able to drop this field on `Document` - it is
currently only necessary for `Document::apply`. Once we make that
refactor, we will be able to eliminate the surrounding `Arc` in
`Arc<ArcSwap<syntax::Loader>>` and use the `ArcSwap` directly instead.
2025-05-13 18:30:21 -04:00
Michael Davis c94fde8d1c
syntax: Move config types to a separate module 2025-05-13 18:30:21 -04:00
dependabot[bot] 447a6d3299
build(deps): bump the rust-dependencies group with 6 updates (#13518)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-13 08:26:46 -05:00
Joffrey Bluthé 949d9e4433
feat: give formatters access to filename (#13429)
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2025-04-28 17:34:05 -05:00
dependabot[bot] 5d16aae58e
build(deps): bump the rust-dependencies group across 1 directory with 5 updates (#13301)
Bumps the rust-dependencies group with 5 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [smallvec](https://github.com/servo/rust-smallvec) | `1.14.0` | `1.15.0` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.44.1` | `1.44.2` |
| [rustix](https://github.com/bytecodealliance/rustix) | `1.0.3` | `1.0.5` |
| [indexmap](https://github.com/indexmap-rs/indexmap) | `2.8.0` | `2.9.0` |
| [cc](https://github.com/rust-lang/cc-rs) | `1.2.17` | `1.2.18` |



Updates `smallvec` from 1.14.0 to 1.15.0
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.14.0...v1.15.0)

Updates `tokio` from 1.44.1 to 1.44.2
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.44.1...tokio-1.44.2)

Updates `rustix` from 1.0.3 to 1.0.5
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Changelog](https://github.com/bytecodealliance/rustix/blob/main/CHANGES.md)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v1.0.3...v1.0.5)

Updates `indexmap` from 2.8.0 to 2.9.0
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/main/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.8.0...2.9.0)

Updates `cc` from 1.2.17 to 1.2.18
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.17...cc-v1.2.18)

---
updated-dependencies:
- dependency-name: smallvec
  dependency-version: 1.15.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: tokio
  dependency-version: 1.44.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: rustix
  dependency-version: 1.0.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: indexmap
  dependency-version: 2.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: cc
  dependency-version: 1.2.18
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 21:33:46 -05:00
Rolo 5b72b59448 perf: use `next_back` on `DoubleEndedIterator` 2025-04-06 12:03:14 -05:00
Nik Revenco ed80c33ad1 style: fmt 2025-03-25 18:41:52 +00:00
Nik Revenco d6c067106a docs: add documentation comments 2025-03-25 17:49:03 +00:00
Nik Revenco 13fa575429 test: improved test syntax
_

_

_
2025-03-25 17:33:35 +00:00
Nik Revenco b0251ef715 feat: `switch_to_sentence_case` (`` `S ``)
_
2025-03-25 16:26:09 +00:00
Nik Revenco 2cc5222226 refactor: remove unused function 2025-03-25 16:06:47 +00:00
Nik Revenco bf788f5f00 fix: use `to_{uppercase,lowercase}` instead of `to_ascii*`variants 2025-03-25 16:04:35 +00:00
Nik Revenco fd83cf7870 refactor: use macro to create functional versions of case converters 2025-03-25 15:56:37 +00:00
Nik Revenco 0ee5850016
Color swatches ( 🟩 green 🟥 #ffaaaa ) (#12308) 2025-03-23 16:07:02 -05:00
Michael Davis 2cc33b5c47
Add pull diagnostics `identifier` to LSP diagnostic provider
This includes a change to lsp-types to store the identifier as an Arc
since it will be cloned for each diagnostic.
2025-03-22 09:25:29 -04:00
Michael Davis 683fac65e7
Refactor DiagnosticProvider as an enum
This resolves a TODO in the core diagnostic module to refactor this
type. It was originally an alias of `LanguageServerId` for simplicity.
Refactoring as an enum is a necessary step towards introducing
"internal" diagnostics - diagnostics emitted by core features such as
a spell checker. Fully supporting this use-case will require further
larger changes to the diagnostic type, but the change to the provider
can be made first.

Note that `Copy` is not derived for `DiagnosticProvider` (as it was
previously because `LanguageServerId` is `Copy`). In the child commits
we will add the `identifier` used in LSP pull diagnostics which is a
string - not `Copy`.
2025-03-22 09:25:29 -04:00
Michael Davis 3a63e85b6a
Support EditorConfig (#13056) 2025-03-22 16:06:41 +09:00
Michael Davis b47c9da3a1
minor: Use a workspace dependency for parking_lot 2025-03-13 12:34:40 -04:00
dependabot[bot] ff558f9105
build(deps): bump the rust-dependencies group with 5 updates (#13070)
Bumps the rust-dependencies group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [tempfile](https://github.com/Stebalien/tempfile) | `3.17.1` | `3.18.0` |
| [once_cell](https://github.com/matklad/once_cell) | `1.20.3` | `1.21.0` |
| [serde](https://github.com/serde-rs/serde) | `1.0.218` | `1.0.219` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.43.0` | `1.44.0` |
| [indexmap](https://github.com/indexmap-rs/indexmap) | `2.7.1` | `2.8.0` |


Updates `tempfile` from 3.17.1 to 3.18.0
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.17.1...v3.18.0)

Updates `once_cell` from 1.20.3 to 1.21.0
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.20.3...v1.21.0)

Updates `serde` from 1.0.218 to 1.0.219
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.218...v1.0.219)

Updates `tokio` from 1.43.0 to 1.44.0
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.43.0...tokio-1.44.0)

Updates `indexmap` from 2.7.1 to 2.8.0
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/main/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.7.1...2.8.0)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: indexmap
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-11 08:29:38 -05:00
Alexander Brassel 82f8ac208f
Improve %% escaping error message (#13018) 2025-03-04 10:03:11 -06:00
dependabot[bot] 9440feae7c
build(deps): bump the rust-dependencies group with 11 updates (#13017)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 18:09:43 -06:00
Nikita Revenco 90884f0588 fix: use char::to_{lower_uppercase} instead of their ascii variants 2025-02-28 15:19:25 +00:00
Nikita Revenco 917e8057dc fix: remove extra allocs from alternate case impl 2025-02-28 15:16:25 +00:00
Nikita Revenco fdd1a1c78f refactor: remove 1 layer of nesting 2025-02-28 15:07:44 +00:00
Nikita Revenco 2a1bff5648 refactor: remove unneeded type annotation 2025-02-28 15:07:44 +00:00
Nikita Revenco cec122e1ca refactor: rename variable 2025-02-28 15:07:44 +00:00
Nikita Revenco ac3722a74d refactor: extract has_camel_transition function 2025-02-28 15:07:44 +00:00
Nikita Revenco 2c1af76fb0 refactor: do not create new function on each loop 2025-02-28 15:07:44 +00:00
Nikita Revenco 5420ef5f63 refactor: remove unneeded loop, replace with map instead 2025-02-28 15:07:44 +00:00
Nikita Revenco d7a3ffa2d8 refactor: simplify code 2025-02-28 15:07:44 +00:00
Nikita Revenco e073a2eb7b refactor: rename variable 2025-02-28 15:07:44 +00:00
Nikita Revenco ea920b82eb docs: remove comment for consistency 2025-02-28 15:07:44 +00:00
Nikita Revenco f8b9497dbc feat: do not introduce breaking changes 2025-02-28 15:07:44 +00:00
Nikita Revenco e6da544a71 refactor: variable name 2025-02-28 15:07:44 +00:00
Nikita Revenco ef2b035e01 refactor: increase readability
split logic into variables and add comments
2025-02-28 15:07:44 +00:00
Nikita Revenco d4e4049ab7 fix: add extra separator character if at camelCase boundary 2025-02-28 15:07:44 +00:00
Nikita Revenco 28b77e2ae3 fix: trim leading whitespace 2025-02-28 15:07:44 +00:00
Nikita Revenco 58177afb2a refactor: remove complex test helper definition, use for loop instead 2025-02-28 15:07:44 +00:00