Commit Graph

109 Commits

Author SHA1 Message Date
Nathan Sobo
1e7184ea07 Get selections rendering again when local selections are owned by Editor 2021-12-11 13:42:46 -07:00
Nathan Sobo
4dd0752e80 More messy progress towards selections in editors 2021-12-11 00:29:34 -07:00
Nathan Sobo
8432daef6a WIP: Start on removing selections from buffer in favor of editor 2021-12-10 19:23:34 -07:00
Nathan Sobo
f35c419f43 Return optional transaction ids from undo/redo
This will allow the editor to restore selections that it associated with the start or end of a transaction.
2021-12-10 18:08:26 -07:00
Nathan Sobo
77defe6e28 Return optional transaction ids when starting/ending a transaction
If the transaction was nested, we return None. Otherwise we return the transaction id in preparation for editors to maintain their own selection state.
2021-12-10 18:00:09 -07:00
Nathan Sobo
c8b43e3078 Move multi_buffer to editor crate 2021-12-10 17:37:53 -07:00
Max Brunsfeld
6caf016df9 Get tests passing w/ multibuffer in editor
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-10 15:54:25 -08:00
Max Brunsfeld
75dd37d873 Update multibuffer when buffers' syntax trees or diagnostics change
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-10 15:54:06 -08:00
Max Brunsfeld
ceff57d02f Don't append a trailing newline in singleton MultiBuffer 2021-12-10 14:27:58 -08:00
Max Brunsfeld
a758bd4f8d Fill in some missing methods on MultiBuffer, MultiBufferSnapshot 2021-12-10 14:27:04 -08:00
Antonio Scandurra
5b31c1ba4e Start making MultiBuffer work with a singleton buffer
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-10 18:04:11 +01:00
Antonio Scandurra
7524974f19 Get everything compiling again
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-10 17:15:16 +01:00
Antonio Scandurra
da09247e5e WIP
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-10 16:14:12 +01:00
Antonio Scandurra
9c74deb9ec Finish removing anchor collections from MultiBuffer
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-10 15:58:37 +01:00
Antonio Scandurra
c8d5e19492 Merge branch 'fragment-locators' into project-diagnostics 2021-12-10 14:01:17 +01:00
Antonio Scandurra
cb97b7cd1d Fix diagnostic unit test 2021-12-10 09:43:21 +01:00
Max Brunsfeld
5e516f59c0 Merge branch 'fragment-locators' into HEAD 2021-12-09 14:49:04 -08:00
Antonio Scandurra
91a7bbbba2 Fix some of the diagnostic tests and make DiagnosticEntry generic
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-09 17:53:08 +01:00
Antonio Scandurra
65711b2256 Remove anchor collections
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-09 17:28:27 +01:00
Nathan Sobo
98f726974e WIP 2021-12-08 20:04:30 -07:00
Nathan Sobo
4ee404a0af Take a cx in MultiBuffer::start_transaction 2021-12-08 19:30:52 -07:00
Nathan Sobo
87d16c271e Get Editor compiling with MultiBuffer as its buffer
There's a bunch of unimplemented methods in MultiBuffer, but everything compiles.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-08 19:23:04 -07:00
Max Brunsfeld
daedf179b2 Implement Anchor, AnchorRangeMap, SelectionSet in multi_buffer
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-08 12:56:09 -08:00
Max Brunsfeld
a7634ccd5f Rename ExcerptList to MultiBuffer
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-08 10:07:15 -08:00
Max Brunsfeld
5f8e406c18 Fill out ExcerptList API
This restores the improvements that we had made on the `project-diagnostics-generic` branch.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-08 10:04:22 -08:00
Max Brunsfeld
fa379885f1 Give more specific names to all snapshot and text iterator types 2021-12-08 09:24:00 -08:00
Max Brunsfeld
ad33111a22 Fix assertion in excerpt unit test after fixing edits 2021-12-06 17:40:32 -08:00
Max Brunsfeld
39cc0cac93 Fix Subscription re-export after moving it into its own module 2021-12-06 17:40:17 -08:00
Max Brunsfeld
102926d171 Implement and randomized test excerpt list point translation and clipping 2021-12-06 17:39:31 -08:00
Max Brunsfeld
09c0c3a0e7 🎨 excerpt_list::Chunks::next 2021-12-06 16:28:44 -08:00
Max Brunsfeld
416033a01c Get random excerpts test passing w/ text in range, edits 2021-12-06 16:17:31 -08:00
Nathan Sobo
02f42f2877 WIP
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-06 14:51:23 -07:00
Nathan Sobo
88e3d87098 Get randomized test passing on basic excerpt list features
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-06 13:48:07 -07:00
Nathan Sobo
4578938ea1 Implement ExcerptList::subscribe
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-06 13:37:17 -07:00
Nathan Sobo
a02a29944c Get the basic ExcerptList unit test passing again
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-06 13:01:09 -07:00
Nathan Sobo
cff610e1ec Rename FragmentList to ExcerptList
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-06 11:59:32 -07:00
Antonio Scandurra
42eba7268d Introduce Buffer::edits_since_in_range
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-12-06 19:48:45 +01:00
Antonio Scandurra
e37908cf3b Start on a simple randomized test for FragmentList 2021-12-06 16:08:17 +01:00
Antonio Scandurra
8354d1520d 🎨 2021-12-06 14:03:38 +01:00
Antonio Scandurra
45d6f5ab04 Start on maintaining edits in FragmentList 2021-12-06 12:10:25 +01:00
Antonio Scandurra
8f90d42723 Merge branch 'main' into project-diagnostics 2021-12-06 09:39:03 +01:00
Max Brunsfeld
026c3476db Upgrade tree-sitter to 0.20.1 2021-12-05 21:37:08 -08:00
Nathan Sobo
0be897d5ac WIP: Edit one of the excerpted buffers and add an assertion
We'll need to detect edits on the child buffers and understand their impact on the tree.
2021-12-04 07:19:30 -07:00
Nathan Sobo
811696670a Start on a new FragmentList
Here I'm exploring a new approach to the project-wide diagnostics view that can exactly mirror the contents of cargo check. The `FragmentList` composes an arbitrary list of fragments from other buffers and presents them as if they were a single buffer.
2021-12-04 06:57:56 -07:00
Antonio Scandurra
e668ff8bcd Avoid allocating a Patch just to check if there are no edits
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-01 16:47:04 +01:00
Antonio Scandurra
733e0cb21b Use the new buffer subscription API to keep DisplayMap in sync
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-01 16:08:53 +01:00
Antonio Scandurra
3b536f153f Introduce text::Buffer::subscribe
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-01 15:55:05 +01:00
Antonio Scandurra
47c467dafc Bump FoldMap's version in FoldMap::sync (and not in DisplayMap) 2021-12-01 12:05:02 +01:00
Max Brunsfeld
faba276fdc WIP - maintain foldmap with Buffer::edits_since
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-30 17:23:02 -08:00
Max Brunsfeld
924e1578ea Use &Snapshot directly instead of impl Into<Content<'a>>
The text::Buffer and its snapshot already used the same representation
for their content, so we can just make Buffer deref to a Snapshot.
2021-11-30 13:32:11 -08:00