Antonio Scandurra
71128d2ee6
Compute diffs based on characters rather than lines
...
Previously, a change on a given line would cause that whole line to be
replaced. In turn, this caused anchors on that line to go to the start
of that line because they would lie inside of a deleted region after applying
the diff.
By switching to a character-wise diff, we perform smaller edits to the buffer
which stabilizes anchor positions.
2022-08-02 16:52:37 +02:00
Max Brunsfeld
868c460620
🎨 Rename and simplify some autoindent stuff
2022-07-28 22:40:30 -07:00
Max Brunsfeld
7a26fa18c7
Record start columns when writing to the clipboard from Zed
2022-07-28 22:13:32 -07:00
Max Brunsfeld
2d05f906f1
Start work on adjusting pasted text based on old start column
2022-07-28 17:29:42 -07:00
Max Brunsfeld
fa5af4383d
Introduce AutoindentMode parameter to Buffer::edit
...
This controls whether or not we preserve the relative indentation
of inserted text blocks.
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
2022-07-28 14:03:31 -07:00
Max Brunsfeld
cdf6ae25bb
Remove indent_size
parameter from Buffer::edit_with_autoindent
...
Instead, compute the indent size by reading the settings inside that method.
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
2022-07-28 13:00:05 -07:00
Max Brunsfeld
b1b252ee45
Fix error in autoindent range calculation
2022-07-28 11:51:03 -07:00
Max Brunsfeld
f547c268ce
Restructure autoindent to preserve relative indentation of inserted text
2022-07-26 17:43:43 -07:00
Max Brunsfeld
537530bf76
🎨 compute_autoindents
2022-07-26 17:09:30 -07:00
Max Brunsfeld
09ed149184
Improve calculation of which lines are new when auto-indenting
2022-07-26 17:09:30 -07:00
Antonio Scandurra
ca3e73106c
Merge branch 'main' into ime-support-2
2022-07-25 10:47:49 +02:00
Antonio Scandurra
d3567e381c
Coalesce IME compositions into a single edit
2022-07-25 09:53:51 +02:00
Antonio Scandurra
0fc7308932
Allow grouping local transactions even if remote peer edits in between
2022-07-23 09:27:21 +02:00
Max Brunsfeld
7c3421e041
Remove versioned offset ranges from transactions and undo operations
...
Now, instead of using these versioned offset ranges, we locate the
fragments associated with a transaction using the transaction's
edit ids. To make this possible, buffers now store a new map called
`insertion_slices`, which lets you look up the ranges of insertions
that were affected by a given edit.
Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2022-07-22 17:28:55 -07:00
K Simmons
02a47d962e
add test coverage for diagnostic popover
2022-07-20 19:02:33 -07:00
Antonio Scandurra
0aafc78eb7
Merge pull request #1385 from zed-industries/fix-lifetime-error
...
Fix spurious borrow checker error
2022-07-18 12:22:54 +02:00
Antonio Scandurra
07d269234f
Differentiate among tabs with the same name
...
This commit introduces a new, optional `Item::tab_description` method
that lets implementers define a description for the tab with a certain
`detail`. When two or more tabs match the same description, we will
increase the `detail` until tabs don't match anymore or increasing the
`detail` doesn't disambiguate tabs any further.
As soon as we find a valid `detail` that disambiguates tabs enough, we
will pass it to `Item::tab_content`. In `Editor`, this is implemented by
showing more and more of the path's suffix as `detail` is increased.
2022-07-14 11:54:11 +02:00
Max Brunsfeld
2a478462b6
Fix association of 'json' lsp language id with JSON language
2022-07-12 15:43:59 -07:00
Antonio Scandurra
afc8e9050c
Merge pull request #1252 from zed-industries/plugin
...
Language Server WebAssembly Plugin Integration (Part 2)
2022-07-12 11:04:20 +02:00
Isaac Clayton
d8b22a200e
Rename LspAdapterTrait to LspAdapter and LspAdapter to CachedLspAdapter
2022-07-12 09:29:38 +02:00
Isaac Clayton
ec327a30c3
Fix minor issues pointed out in the review
2022-07-11 15:54:03 +02:00
Isaac Clayton
3ad8d5363c
Remove the blocking call and inline on_lsp_diagnostics_published
2022-07-11 12:11:00 +02:00
Max Brunsfeld
1f16c68e6b
Upgrade Tree-sitter and limit query cursors' concurrently-buffered matches
2022-07-08 14:09:34 -07:00
Isaac Clayton
8931218dc6
Remove debug statements
2022-07-08 21:28:35 +02:00
Isaac Clayton
3e8b230567
Highlight languages as languages load
2022-07-08 21:19:07 +02:00
Antonio Scandurra
9d06b15d92
Fix spurious borrow checker error
...
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-07-08 19:03:25 +02:00
Isaac Clayton
988f388165
Added theme to language
2022-07-08 18:11:28 +02:00
Isaac Clayton
6f99d59d38
Require theme directly when creating language
2022-07-08 16:08:40 +02:00
Isaac Clayton
73620dad06
Add channel to notify project when languages are added
2022-07-08 14:37:27 +02:00
Isaac Clayton
5cb59dfdab
Fix errors resulting from rebase
2022-07-07 18:14:16 +02:00
Isaac Clayton
895747476f
Done! Finish transition to async, very close to merging
2022-07-07 16:21:20 +02:00
Isaac Clayton
d009e10a46
Fix all residual errors, need to polish off warnings and TODOS
2022-07-07 16:17:03 +02:00
Isaac Clayton
4f016d5fc4
Switch LspAdapter to struct and revert some async/await
2022-07-07 16:12:10 +02:00
Isaac Clayton
602fe14aa4
Going to move LspAdapter from trait to struct
2022-07-07 15:44:21 +02:00
Isaac Clayton
7d128e81aa
Add lsp_settings_changed: Task to Project, need to resolve cx in Project::on_settings_changed
2022-07-07 15:39:59 +02:00
Isaac Clayton
2c637b83bf
Work on updating code to be async
2022-07-07 15:32:41 +02:00
Isaac Clayton
841a9bd2a7
Make into async trait, will refactor everything Monday
2022-07-07 15:25:49 +02:00
Isaac Clayton
71e0555763
Add JSON LSP plugin
2022-07-07 15:22:16 +02:00
Isaac Clayton
7dd3114a7a
Start switching JSON LSP adapter to plugin (take 2)
2022-07-07 15:16:59 +02:00
Antonio Scandurra
c6254247c3
Allow providing an external format in format_on_save
setting
2022-07-07 11:04:03 +02:00
Antonio Scandurra
2c1906d710
Normalize line endings when parsing completions
...
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-07-06 19:32:45 +02:00
Antonio Scandurra
d3db700db4
Fix panic on paste when editing with auto-indent
...
Instead of accepting text as it's input by the user, we will read it
out of the edit operation after it gets sanitized by the buffer.
2022-07-06 19:00:11 +02:00
Max Brunsfeld
7e9beaf4bb
Strip carriage returns from all text in text::Buffer
...
* Moving the logic from Rope to text::Buffer makes it easier
to keep the Rope in sync with the fragment tree.
* Removing carriage return characters is lossier, but is much
simpler than incrementally maintaining the invariant that
there are no carriage returns followed by newlines. We may
want to do something smarter in the future.
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-07-05 17:25:09 -07:00
Max Brunsfeld
116fa92e84
Change Buffer constructors to construct the History internally
2022-07-05 14:51:52 -07:00
Antonio Scandurra
eac76df0ac
Transmit new line ending when buffer is reloaded
2022-07-05 08:01:14 +02:00
Max Brunsfeld
9804c683c0
Rename NewlineStyle -> LineEnding
2022-07-04 12:47:40 -07:00
Max Brunsfeld
0ba12eab22
Handle a file's line endings changing on disk
2022-07-04 12:30:28 -07:00
Antonio Scandurra
d80ecb6f98
Ignore carriage returns when reloading buffer
2022-07-04 17:40:35 +02:00
Antonio Scandurra
3480b50920
Detect buffer newline style and honor it when saving
2022-07-04 17:40:26 +02:00
Max Brunsfeld
fae1cc36d6
In most languages, use prev non-empty line as basis for preserving indent
2022-06-28 12:21:54 -07:00