Nathan Sobo and Max Brunsfeld
2bde54971e
Move all FoldMap query methods to FoldMapSnapshot
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2021-07-15 11:36:24 -06:00
Antonio Scandurra
be954872d0
Calculate an old_lines range in Edits iterator
2021-07-15 10:11:24 +02:00
Antonio Scandurra
a5edc14e3a
WIP: Start on WrapMap
2021-07-14 18:43:48 +02:00
Antonio Scandurra
e80439daaa
Merge branch 'main' into rpc
2021-06-29 10:25:42 +02:00
Max Brunsfeld
60ee97be24
Always represent anchor as a versioned offset
...
Remove the `Start` and `End` variants, and always
use the structure that was previously called `Middle`.
This makes Anchors simpler to serialize and deserialize.
2021-06-25 17:02:48 -07:00
Max Brunsfeld
04c80578bc
Start work on sending buffer operations
2021-06-25 13:46:36 -07:00
Nathan Sobo and Max Brunsfeld
a364839e93
Replace FileHandle with File entity that subscribes to Worktree update events
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2021-06-21 20:40:40 -06:00
Antonio Scandurra
742241a903
Rename Cursor::{start,end} to Cursor::{sum_start,sum_end}
2021-06-10 14:06:27 +02:00
Antonio Scandurra
dc2805bb14
Add Cursor::seek_end and audit the codebase to use seek_start more
2021-06-10 14:05:56 +02:00
Antonio Scandurra
e071d40058
Use a single Bias enum everywhere
2021-06-04 13:39:57 +02:00
Antonio Scandurra
311e1b0f5e
Supply a context when adding summary to Dimension
2021-06-01 12:50:10 +02:00
Antonio Scandurra
e8a9eee84f
WIP
2021-05-31 16:57:15 +02:00
Max Brunsfeld
16c6400145
Rename context parameters to cx in fold_map.rs
2021-05-28 15:08:38 -07:00
Antonio Scandurra
23d1d91414
Implement select_larger_syntax_node for buffer
2021-05-28 13:25:09 +02:00
Max Brunsfeld and Nathan Sobo
5d2ac3f4e4
Use new Tree-sitter captures API
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-05-25 16:02:43 -07:00
Antonio Scandurra
2e7593dd79
💄
2021-05-25 14:20:53 +02:00
Antonio Scandurra
aeb68867da
Move highlighted_text_in_range from Buffer to buffer::Snapshot
2021-05-25 11:51:29 +02:00
Max Brunsfeld
8340958b33
Convert query capture indices to style ids
...
* Introduce a Theme struct as a new part of the app's settings
* Store on each Language a ThemeMap, which converts the capture ids
from that language's highlight query into StyleIds, which identify
styles in the current Theme.
* Update `highlighted_chunks` methods to provide StyleIds instead of
capture ids.
2021-05-24 16:44:14 -07:00
Antonio Scandurra
d063ebdf9b
Correctly store current chunk offset in fold_map::HighlightedChunks
2021-05-24 16:52:01 +02:00
Antonio Scandurra
4ddf10967e
Introduce fold_map::HighlightedChunks
2021-05-24 15:39:22 +02:00
Antonio Scandurra
4ada5e0666
Rename rope::ChunksIter to rope::Chunks
...
This is consistent with how we name the other chunk iterators.
2021-05-24 15:05:11 +02:00
Antonio Scandurra
3a576f0b65
Don't clone visible_text for splicing edits into the parse tree
2021-05-22 12:34:35 +02:00
Max Brunsfeld
46e6b2cff4
Start maintaining a syntax tree on buffers
2021-05-22 12:34:35 +02:00
Antonio Scandurra and Nathan Sobo
b42f5142f7
Rename rightmost_{row,chars} to longest_{row,chars}
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-05-20 16:32:09 +02:00
Antonio Scandurra
6a0757ebf9
Don't store rightmost row/char-column as a Point
2021-05-20 12:52:58 +02:00
Antonio Scandurra
ed57ffe5fa
Replace rightmost_point with righmost_row
2021-05-20 12:47:08 +02:00
Antonio Scandurra
96538354b3
Express rightmost_point in terms of chars as opposed to bytes
2021-05-20 12:47:08 +02:00
Max Brunsfeld and Antonio Scandurra
510f20411a
Get cursor movement working with byte columns
...
Introduce `clip_point` and `clip_offset` methods on `Rope`, `Buffer`, and `FoldMap`.
Co-Authored-By: Antonio Scandurra <me@as-cii.com >
2021-05-20 12:47:08 +02:00
Max Brunsfeld
c62a679e12
Use chunk-wise DisplayMap iteration when laying out lines
2021-05-20 12:47:08 +02:00
Max Brunsfeld
a9583d0074
Introduce FoldMapSnapshot::chunks_at, use it in FoldMap::text
...
Get the FoldMap randomized tests passing. This also required adding
a test-only FoldMap::prev_char_boundary method.
2021-05-20 12:47:08 +02:00
Max Brunsfeld
b3d2a70834
Don't return Results from position methods in FoldMap and DisplayMap
2021-05-20 12:47:08 +02:00
Max Brunsfeld
72b98ad688
Get buffer tests passing after switching to byte coordinates
2021-05-20 12:47:08 +02:00
Max Brunsfeld
e860cacb9f
Get randomized tests passing in the presence of multibyte chars
2021-05-14 17:45:16 -07:00
Antonio Scandurra and Nathan Sobo
2cdf315d95
WIP: Replace ropey with our own Rope
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-05-14 18:30:47 +02:00
Max Brunsfeld and Nathan Sobo
9aeb35bfab
Get tests passing using a slow rightmost_point impl
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-05-13 11:54:29 -07:00
Antonio Scandurra and Max Brunsfeld
7b98fb33dd
WIP: Get the type checker passing...
...
...but not the borrow checker!
Co-Authored-By: Max Brunsfeld <max@zed.dev >
2021-05-13 19:24:03 +02:00
Antonio Scandurra and Nathan Sobo
0e9441e5cd
WIP
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-05-13 18:35:48 +02:00
Antonio Scandurra
1c2b381f74
Use gpui::test macro for synchronous tests in zed
2021-05-12 17:18:23 +02:00
Max Brunsfeld
e32b6bc8f8
Merge branch 'master' into new-file
2021-05-07 10:10:20 -07:00
Antonio Scandurra
1c2f549c82
Don't report folds that touch the endpoints of the given range
...
Fold ranges are exclusive, exactly like the query ranges. So if the end
of a fold coincides with the start of the query range, we shouldn't
report that fold. Analogously, if the start of a fold coincides with the
end of the query range, that fold shouldn't be reported.
2021-05-07 14:30:40 +02:00
Antonio Scandurra
6a2fe38d94
Verify FoldMap::unfold in randomized test
2021-05-07 09:39:55 +02:00
Antonio Scandurra and Nathan Sobo
6890a3d9fa
Batch fold insertion
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-05-06 19:50:51 +02:00
Antonio Scandurra and Nathan Sobo
2c1e4cae19
Merge FoldRange into Fold
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-05-06 19:36:19 +02:00
Antonio Scandurra and Nathan Sobo
e8179f7e3e
Always provide a context to sum tree's methods
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-05-06 19:29:38 +02:00
Antonio Scandurra and Nathan Sobo
65e92ac2f2
Ignore empty folds in FoldMap::fold
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-05-06 18:53:09 +02:00
Antonio Scandurra
178705f8f9
Add FoldMap::folds_in_range to randomized test and fix issues it found
2021-05-06 18:49:41 +02:00
Max Brunsfeld
490fb485fd
Merge branch 'master' into new-file
2021-05-06 09:19:16 -07:00
Antonio Scandurra
652fc9e4ec
Remove add_summary_with_ctx and always require a ctx in add_summary
2021-05-06 16:57:47 +02:00
Antonio Scandurra
901525bf77
Implement FoldMap's folds using a SumTree
...
This required passing a `Context` object to `Summary` and introducing a
new `SeekDimension` trait that allows comparing two dimensions and pass
an additional context object.
2021-05-06 16:20:23 +02:00
Antonio Scandurra
7fb7a6adfc
Add a Summary trait in preparation of passing a context struct
2021-05-06 09:32:14 +02:00