Commit Graph

938 Commits (92469b431a5eae70fd500f5469b1b07eec3f6d23)

Author SHA1 Message Date
Nikita Revenco 56dedd10a7 fix: add `regex` to ignored layer configs 2025-03-25 14:41:27 +00:00
Nikita Revenco d451077978 feat: add typable command to get injection layer for current range 2025-03-25 14:41:27 +00:00
Nikita Revenco 99d16170dc fix: commenting full lines 2025-03-25 14:41:27 +00:00
Nikita Revenco e9683381b6 refactor: extract a separate toggle_comment_impl function 2025-03-25 14:41:27 +00:00
Nikita Revenco 093805b62c perf: get rid of a `.clone()` 2025-03-25 14:41:27 +00:00
Nikita Revenco 63fb49c1b4 chore: clean up code
chore: remove comment
2025-03-25 14:41:27 +00:00
Nikita Revenco 13b52e9d97 refactor: rename variables ,use iterator methods, separate vars for added and removed chars 2025-03-25 14:41:27 +00:00
Nikita Revenco 7a39fb8164 refactor: rename variable 2025-03-25 14:41:27 +00:00
Nikita Revenco bbd7cb7bfb fix: incorrect order of index additions 2025-03-25 14:41:27 +00:00
Nikita Revenco 76b3e6778d chore: remove log statement 2025-03-25 14:41:27 +00:00
Nikita Revenco 31e2f739ee fix: panic as no ranges were inserted 2025-03-25 14:41:27 +00:00
Nikita Revenco b94d3a70e7 fix: multiple selections having incorrect range and not properly accounting for comment tokens 2025-03-25 14:41:27 +00:00
Nikita Revenco 0a882107ed fix: restore selections when created comment 2025-03-25 14:41:27 +00:00
Nikita Revenco de7884c7dd test: uncomment previosly skipped tests 2025-03-25 14:41:27 +00:00
Nikita Revenco 371dec3774 feat: block comment toggle and single line comment toggle 2025-03-25 14:41:27 +00:00
Nikita Revenco 544e460ac4 feat: implement toggle comment funcitonality for multiple comment tokens 2025-03-25 14:41:27 +00:00
Nikita Revenco 29e0a00eb0 feat: implement toggle comment for the simplest case 2025-03-25 14:41:27 +00:00
Nikita Revenco d719f1572b feat: gain access to injection-specific line and block comment tokens 2025-03-25 14:41:27 +00:00
Nikita Revenco b10fc21169 chore: clean up code 2025-03-25 14:41:27 +00:00
Nikita Revenco 8fe3f90cbb feat: use FnMut 2025-03-25 14:41:27 +00:00
Nikita Revenco 38bede20ef feat: add new params 2025-03-25 14:41:27 +00:00
Nikita Revenco 70f27b390d feat: add function to get LanguageConfiguration from a LayerId
Co-authored-by: the-mikedavis <mcarsondavis@gmail.com>
2025-03-25 14:41:27 +00:00
Michael Davis 0efa8207d8
Rewrite command line parsing, add flags and expansions (#12527)
Co-authored-by: Pascal Kuthe <pascalkuthe@pm.me>
2025-02-26 19:50:15 -06:00
dependabot[bot] 48194825b9
build(deps): bump the rust-dependencies group with 3 updates (#12903)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-17 17:36:50 -06:00
Michael Davis ed3bc2b294
Remove unused dependencies
The dependabot file was matching on tree-sitter crates - that's a relic
from v0.6.0 and lower where grammars were regular dependencies.

The remaining changes are unused crates that were forgotten about during
shuffles like moving path canonicalization from helix-core to
helix-loader (and then again from helix-loader to helix-stdx).
2025-02-13 08:41:46 -05:00
Niklas Wallgren 1258111394
Print full error chain when failing to load grammar (#12744) 2025-02-04 08:18:54 -06:00
dependabot[bot] 8995ccaae2
build(deps): bump the rust-dependencies group with 4 updates (#12766)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-03 17:37:46 -06:00
Michael Davis 5952d564d1
Reverse highlight precedence ordering (#9458)
Co-authored-by: postsolar <120750161+postsolar@users.noreply.github.com>
Co-authored-by: Iorvethe <58810330+Iorvethe@users.noreply.github.com>
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
Co-authored-by: gabydd <gabydinnerdavid@gmail.com>
2025-02-02 18:17:10 -06:00
Michael Davis 70d452db3e
core: Make completion item documentation optional
Path completion items always have documentation but future core (i.e.
non-LSP) completions may not always have documentation - for example
word completion from the current buffer.
2025-02-01 21:24:25 -05:00
Pascal Kuthe 018081a5b1
core: Add a provider type to track the origin of a completion 2025-02-01 19:32:37 -05:00
rhogenson 17ffa38a5a
Use the first char in a grapheme for classification (#12483)
Co-authored-by: Rose Hogenson <rosehogenson@posteo.net>
2025-02-01 17:09:45 -06:00
RoloEdits 025719c1d8
perf(ropey): enable `simd` feature for `stdx` (#12735) 2025-01-30 19:51:34 -05:00
Michael Davis 20151a5594
Move rope grapheme iterators from core to stdx 2025-01-27 09:24:40 -05:00
Michael Davis 51832b02c9
core: Remove unused byte index grapheme functions 2025-01-27 09:24:40 -05:00
Michael Davis 39b72329b4
stdx: Add floor/ceil/is grapheme boundary functions to RopeSliceExt
These functions are the equivalent of 23b424a46 for grapheme clusters.
In order to add the `is_grapheme_boundary` function we also need to
query whether a byte index lies on a character boundary, so this change
also adds `is_char_boundary`.
2025-01-27 09:24:40 -05:00
RoloEdits 4ded712dbd
perf(syntax): short-circuit if name matches `language_id` (#12407) 2025-01-23 17:49:14 -06:00
Rolo 650af50c13 fix: typos 2025-01-23 15:18:16 -05:00
Rolo c1d382a532 fix(lints): clippy 1.84 2025-01-23 15:18:16 -05:00
Nikita Revenco 168b11e091
feat: passing multile of the same files in the arguments places a cursor at each position (#12192)
Co-authored-by: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2025-01-23 14:04:02 -06:00
Michael Davis cb0f201d0e
snippets: Discard placeholder text for the `$0` tabstop 2025-01-23 09:50:19 -05:00
Michael Davis 032dadaf37
snippets: Add a test case for parsing `${0:placeholder}`
This is an example snippet sent by older versions of clangd.
2025-01-23 09:50:19 -05:00
Michael Davis 76a8682c4d syntax: Prefer `RopeSlice` for non-id language injection markers
The `Name` variant's inner type can be switched to `RopeSlice` since
the parent commit removed the usage of `&str`. In doing this we need to
switch from a regular `Regex` to a `rope::Regex`, which is mostly a
matter of renaming the type.

The `Filename` and `Shebang` variants can also switch to `RopeSlice`
which avoids allocations in cases where the text doesn't reside on
different chunks of the rope. Previously `Filename`'s `Cow` was always
the owned variant because of the conversion to a `PathBuf`.
2025-01-23 11:01:35 +09:00
Michael Davis 060255344c syntax: Lookup up `(#set! injection.language "name")` props by ID
This splits the `InjectionLanguageMarker::Name` into two: one that
preforms the previous behavior (using the language configurations'
`injection_regex` fields and performing a match) and a new variant that
looks up directly by `language_id` with equality.

The old variant is used when capturing the injection language like we
do in the markdown queries for codefences. That captured text is part of
the document being highlighted so we might need a regex to recognize a
language like JavaScript as either "js" or "javascript". But the text
passed in the `(#set! injection.language "name")` property can be
looked up directly. This property is in the query code so there's no
need to be flexible in what we accept: we can require that the
`(#set! injection.language ..)` properties refer to languages by their
configured ID. This should save a noticeable amount of work for the
common case of injections: `(#set! injection.language)` is used much
more often than `@injection.language`.
2025-01-23 11:01:35 +09:00
Michael Davis 27bb2447db
Use a workspace dependency for bitflags 2025-01-13 18:26:31 -05:00
dependabot[bot] 3d772afc8b
build(deps): bump the rust-dependencies group with 6 updates
Bumps the rust-dependencies group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [thiserror](https://github.com/dtolnay/thiserror) | `2.0.9` | `2.0.11` |
| [bitflags](https://github.com/bitflags/bitflags) | `2.6.0` | `2.7.0` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.134` | `1.0.135` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.42.0` | `1.43.0` |
| [rustix](https://github.com/bytecodealliance/rustix) | `0.38.42` | `0.38.43` |
| [cc](https://github.com/rust-lang/cc-rs) | `1.2.7` | `1.2.9` |


Updates `thiserror` from 2.0.9 to 2.0.11
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/2.0.9...2.0.11)

Updates `bitflags` from 2.6.0 to 2.7.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.6.0...2.7.0)

Updates `serde_json` from 1.0.134 to 1.0.135
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.134...v1.0.135)

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

Updates `rustix` from 0.38.42 to 0.38.43
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Changelog](https://github.com/bytecodealliance/rustix/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.42...v0.38.43)

Updates `cc` from 1.2.7 to 1.2.9
- [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.7...cc-v1.2.9)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: bitflags
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: serde_json
  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: rustix
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-13 23:09:54 +00:00
Michael Davis 217818681e
Revert "refactor(shellwords)!: change arg handling strategy (#11149)"
This reverts commit 64b38d1a28.
2025-01-06 12:39:53 -05:00
RoloEdits 64b38d1a28
refactor(shellwords)!: change arg handling strategy (#11149) 2025-01-05 12:18:30 -06:00
Michael Davis 4817bfa003
minor: fix syntax tree pretty print test
This case needs to be adjusted for the escaping added in 38e8382b
2025-01-02 15:44:04 -05:00
Michael Davis 38e8382b01
Escape double quotes for anonymous nodes in :tree-sitter-subtree
If the anonymous node contained a double quote it would throw off the
highlighting.
2025-01-02 15:33:48 -05:00
Pascal Kuthe c8c0d04168
add snippet system to helix core 2024-12-17 13:34:39 -05:00