Commit Graph

6198 Commits

Author SHA1 Message Date
Nikita Revenco
076d8bd173
fix: surprising behaviour when changing line above a comment (#12575)
Co-authored-by: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com>
2025-01-17 15:29:39 -06:00
Michael Davis
343397391f
Remove unused variant from FormatterError
This seems to be a relic from the change which added external formatting
commands - initially it worked by writing the file in place and
reloading it. Now this error type is not possible and can be removed.
2025-01-17 11:00:37 -05:00
Michael Davis
69068770c8
Add extra logging for external formatters and formatting errors
This should help debug formatting failures when using external
formatters in the future. Previously we didn't log anything when an
external formatter failed despite having a custom error type for it.
2025-01-17 11:00:34 -05:00
Michael Davis
4c41c5250c
Eliminate an unnecessary clone in insert_newline 2025-01-17 10:23:36 -05:00
Michael Davis
ffdfb59033
Fix slicing panic in path completion variable expansion (#12556) 2025-01-16 18:10:30 -06:00
janos-r
d4ee22b483
Generate a .deb file (#12453) 2025-01-16 17:37:53 -06:00
Valentin B.
29dda1403f
chore(solidity): update to newest grammar and fix queries (#12457) 2025-01-16 09:11:18 -06:00
Michael Davis
19f7bc9ecb
book: Add missing TOC entries to editor config page 2025-01-16 08:14:09 -05:00
Michael Davis
3318953bf6
minor: Use more exact allocations in insert_newline
This is partially a style commit:

* Pull more bindings out the `change_by_selection` closure like the
  line-ending string and the comment tokens used for continuation.
* Prefer `Editor::config` to `Document`'s config.

The rest is changes to places where `insert_newline` may allocate.

The first is to move `new_text` out of the `change_by_selection`
closure, reusing it between iterations. This is not necessarily always
an improvement as we need to clone the text for the return type of the
closure. `SmartString`'s `From<String>` implementation reuses the
allocation when the string is too long to inline and drops it if it is
short enough to inline though which can be wasteful. `From<&String>`
clones the string's allocation only when it is too long to be inlined,
so we save on allocations for any `new_text` short enough to be inlined.

The rest is changes to `new_text.reserve_exact`. Previously calls to
this function in this block mixed up character and byte indexing by
treating the length of the line-ending as 1. `reserve_exact` takes a
number of bytes to reserve and that may be 2 when `line_ending` is a
CRLF. A call to `reserve_exact` is also added to the branch used when
continuing line comments.
2025-01-15 10:57:03 -05:00
Michael Davis
4bd17e542e
Fix offset tracking in insert_newline
#12177 changed `insert_newline`'s behavior to trim any trailing
whitespace on a line which came before a cursor. `insert_newline` would
previously never delete text. Even the whitespace stripping behavior in
#4854 worked by inserting text - a line ending at the beginning of the
line. `global_offs`, a variable that tracks the number of characters
inserted between iterations over the existing selection ranges, was not
updated to also account for text deleted by the trimming behavior,
causing cursors to be offset by the amount of trailing space deleted
and causing panics in some cases.

To fix this we need to subtract the number of trimmed whitespace
characters from `global_offs`. `global_offs` must become an `isize`
(was a `usize`) because it may become negative in cases where a lot of
trailing whitespace is trimmed. Integration tests have been added for
each of these cases.

Fixes #12461
Fixes #12495
Fixes #12539
2025-01-15 10:36:29 -05:00
Michael Davis
99d33c741a
Add '///' to Dart comment-token configuration
Fixes #12537
2025-01-15 08:33:33 -05:00
David Else
ca19496eed
Improve dark_plus theme: Change special, ui.text.directory and ui.virtual.wrap (#12530) 2025-01-14 12:55:01 -06:00
Robin Heggelund Hansen
f69659c5be
Add support for the Gren programming language (#12525) 2025-01-14 08:26:56 -06: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
TornaxO7
60bff8feee
Fix open_{below, above} behaviour with multiple cursors (#12465) 2025-01-13 08:14:30 -06:00
Taylor C. Richberger
134aebf8cc
add rockspec to lua file types (#12516) 2025-01-13 07:45:38 -06:00
Álan Crístoffer
367ccc1c64
Fix a bug in matlab indentation and updates the grammar commit hash to latest (#12518) 2025-01-13 07:43:02 -06:00
Nikita Revenco
e01775a667
fix: unable to detect Color completion item hex code for some LSPs (#12501)
Co-authored-by: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com>
2025-01-12 09:40:19 -06:00
Michael Davis
0f2ce303c5
Add directory name to :cd errors
For example `:cd README.md` would say "Not a directory" but would not
print the directory name. Now the error message includes some context
about the operation and requested directory.
2025-01-11 20:39:44 -05:00
meator
b05971f178
Add .clang-tidy highlighting (#12498) 2025-01-11 15:12:46 -06:00
Nikita Revenco
a539199666
feat(highlights): add more built-in functions for ecma, rust and haskell (#12488)
Co-authored-by: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com>
2025-01-11 14:59:03 -06:00
Kirawi
e440e54e79
pin to ubuntu-22.04 for releases (#12464) 2025-01-11 10:52:13 -06:00
Nikita Revenco
8f5f818c88
fix(highlights): recognize ! as the never type (#12485)
Co-authored-by: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com>
2025-01-11 10:49:39 -06:00
Michael Davis
b26903cd13
Add comment tokens for JSONC
Fixes #12491
2025-01-11 08:42:17 -05:00
Evan Richter
9721144e03
language support: CodeQL (#12470) 2025-01-10 09:03:04 -06:00
Rob Gonnella
a83c23bb03
Run formatter from Document directory (#12315)
Co-authored-by: Rob Gonnella <rob.gonnella@papayapay.com>
2025-01-08 12:36:40 -06:00
rhogenson
931dd9c1dc
Fix a typo in join_selections (#12452)
Co-authored-by: Rose Hogenson <rosehogenson@posteo.net>
2025-01-08 08:42:41 -06:00
Michael Davis
917174e546
Fix blank buffer picker preview on doc with no views
Reproduction:

* `hx`
* Open any file in a split (`<space>f` and choose anything with `<C-v>`)
* Close the split with `<C-w>q`
* Open up the buffer picker and look the file you opened previously

Previously the preview was empty in this case because the Document's
`selections` hashmap was empty and we returned early, giving `None`
instead of a FileLocation. Instead when the Document is not currently
open in any view we can show the document but with no range highlighted.
2025-01-07 15:11:15 -05:00
Michael Davis
a0bd39d40e
book: Document editor.lsp.display-progress-messages config option
Connects #5535
2025-01-07 09:17:59 -05:00
dependabot[bot]
e698b20245
build(deps): bump the rust-dependencies group with 3 updates (#12437) 2025-01-06 19:34:21 -05:00
Michael Davis
5616f1d66d
changelog: Add missing breaking change for display-messages config 2025-01-06 14:18:26 -05:00
Michael Davis
217818681e
Revert "refactor(shellwords)!: change arg handling strategy (#11149)"
This reverts commit 64b38d1a28.
2025-01-06 12:39:53 -05:00
Michael Davis
03f35af9c1
Format '--version' calendar version as 'YY.0M'
We use calendar versioning which isn't supported by Cargo, so we need
to add an extra leading zero to the month for releases between January
and September to match our usual 'YY.0M' formatting.

Closes #12414
2025-01-06 10:34:25 -05:00
uncenter
6c9619d094
Improve markdown heading highlights (#12417) 2025-01-05 16:35:09 -06:00
uncenter
e856dde738
Use @attribute scope for JSX attributes (#12416) 2025-01-05 16:33:08 -06:00
RoloEdits
f80ae997f2
perf: cache Documents relative path (#12385) 2025-01-05 16:29:16 -06:00
RoloEdits
64b38d1a28
refactor(shellwords)!: change arg handling strategy (#11149) 2025-01-05 12:18:30 -06:00
Seigo Mori
377e36908a
Add cursorline color to iceberg theme (#12404) 2025-01-05 10:58:31 -06:00
Nikita Revenco
fa4aa0fb42
docs: catppuccin themes should not be directly edited here (#12400)
Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
2025-01-05 10:55:28 -06:00
Nikita Revenco
2b8f8df1af
feat: correct Swift highlights (#12409)
- Adds injections for the `comment` language
- Correct highlight of the `nil` value. Same highlight as `null` in javascript, java and others
- Recognize `<` and `>` as punctuation, used in generics (same color as the syntax used in other languages)
- `protocol` function methods are recognized
- When accessing object properties, like `hello.world`, the `world` is properly recognized as being a member
- Recognize the `\` as an operator
2025-01-05 10:54:45 -06:00
Nikita Revenco
eed052e86b
feat: highlight : as a delimiter in Rust (#12408) 2025-01-05 10:51:33 -06:00
Erasin Wang
0654a1f058
Update onelight theme (#12399) 2025-01-05 10:27:38 -06:00
RoloEdits
353176082e
doc: generate lang-support.md for teal (#12402) 2025-01-05 01:11:10 +09:00
André L. Alvares
b47b946c47
Fix Teal LSP name. (#12395) 2025-01-04 11:49:44 +09:00
Will Faught
827deba74c
Change Cwd to Cmd (#12396) 2025-01-03 20:23:21 -05:00
Michael Davis
dabfb6ceea
Add changelog notes for 25.01 (#12347) 2025-01-03 13:50:51 -06:00
Niza Toshpulatov
9dcc1f06b0
Add dim modifier to diagnostic.unnecessary in catppuccin_mocha.toml (#12391) 2025-01-03 08:13:44 -06:00
David Crespo
eaa7c8e9f6
docs: fix typo in usage.md (#12390) 2025-01-03 08:11:37 -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