Commit Graph
39175 Commits
Author SHA1 Message Date
Antonio Scandurra 581ff37a12 Don't clone visible_text for splicing edits into the parse tree 2021-05-22 12:34:35 +02:00
Antonio Scandurra 926b7dc95a Restructure parsing to use edits_since 2021-05-22 12:34:35 +02:00
Antonio Scandurra 678aaf19f5 Reparse buffer on undo, redo and after applying a remote operation 2021-05-22 12:34:35 +02:00
Max Brunsfeld c85c5e3141 Add a unit test for reparsing a buffer 2021-05-22 12:34:35 +02:00
Max Brunsfeld 0e7fdcdab4 Start maintaining a syntax tree on buffers 2021-05-22 12:34:35 +02:00
Max Brunsfeld f4921ab1c1 Bump context-predicate grammar to the latest Tree-sitter 2021-05-22 12:34:35 +02:00
409298c7d7 Introduce LanguageRegistry object
* Include it, along with settings in `OpenParams` grouped under a new struct called `AppState`

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-05-22 12:34:35 +02:00
Nathan Sobo 90573ebff2 Merge pull request #71 from zed-industries/simplify-text-layout
Pass scalar lengths and include colors when specifying styling runs during text layout
2021-05-21 14:40:48 -06:00
Nathan Sobo d72dc9ff6a Fix test assertions 2021-05-21 14:36:52 -06:00
Nathan Sobo e393697a21 Fix typo 2021-05-21 14:36:44 -06:00
Nathan Sobo 7b840467ef Clarify variable name 2021-05-21 14:14:05 -06:00
Nathan Sobo 6a078c3281 Accept colors in styling runs passed to layout_str
Also move from the runs being expressed as ranges to the runs being expressed as a sequence of contiguous scalar lengths.
2021-05-21 14:10:38 -06:00
Antonio ScandurraandNathan Sobo af0cde4093 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 6374143612 Merge pull request #70 from zed-industries/optimizations
Structure buffer APIs in terms of strings and byte counts instead of chars and character counts
2021-05-20 13:02:46 +02:00
Antonio Scandurra c1ff7877fc Don't store rightmost row/char-column as a Point 2021-05-20 12:52:58 +02:00
Antonio Scandurra bd6bfaf06b Index into prefix or path depending on where the match was found
This fixes a couple of tests that were panicking due to an out-of-bound
access.
2021-05-20 12:47:08 +02:00
Antonio Scandurra 5ff6b763b7 Replace rightmost_point with righmost_row 2021-05-20 12:47:08 +02:00
Antonio Scandurra 6d3637dd62 Express rightmost_point in terms of chars as opposed to bytes 2021-05-20 12:47:08 +02:00
Antonio Scandurra 4e845a3003 Complete unit test for Label highlights 2021-05-20 12:47:08 +02:00
Max Brunsfeld 53867f6620 WIP - Adjust Label element to expect highlights as byte offsets 2021-05-20 12:47:08 +02:00
Max Brunsfeld d1d5506a3b Convert fuzzy match positions to byte offsets 2021-05-20 12:47:08 +02:00
Max Brunsfeld 853c50a2d2 Adjust layout_str to use byte coordinates
* Interpret ranges as byte ranges for incoming runs
* Return glyphs whose indices are byte offsets
2021-05-20 12:47:08 +02:00
Max Brunsfeld fc08127591 Fix bugs and add tests for move_{up,down} 2021-05-20 12:47:08 +02:00
Max BrunsfeldandAntonio Scandurra bc772b6988 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 a0063acb89 Start work on making row/columnwise movement work w/ byte columns 2021-05-20 12:47:08 +02:00
Max BrunsfeldandNathan Sobo 319cb4b344 Expand tabs correctly with multibyte characters
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-05-20 12:47:08 +02:00
Max Brunsfeld b134faf3d5 Use chunk-wise DisplayMap iteration when laying out lines 2021-05-20 12:47:08 +02:00
Max Brunsfeld c8a8d0eda7 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 2e55b0e850 Don't return Results from position methods in FoldMap and DisplayMap 2021-05-20 12:47:08 +02:00
Max Brunsfeld 585458031c Get buffer tests passing after switching to byte coordinates 2021-05-20 12:47:08 +02:00
Antonio ScandurraandNathan Sobo bd98e4fe35 WIP: Switch to byte-oriented indexing
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-05-20 12:47:08 +02:00
Antonio Scandurra 2143fc8acf Introduce Rope::chunks_in_range 2021-05-20 12:47:08 +02:00
Antonio Scandurra b7ea506936 Merge pull request #69 from zed-industries/fix-flaky-test
Try fixing flaky tests
2021-05-19 16:39:36 +02:00
Antonio Scandurra ec3a4c4819 Always flush historical events in fsevent tests 2021-05-19 16:03:30 +02:00
Antonio Scandurra 03cff19339 Don't use condition to wait for spawn_search to complete
Instead, return a `Task` from `spawn_search` that can either be
awaited or detached.
2021-05-19 15:36:24 +02:00
Antonio Scandurra bd47511d07 Revert "Temporary: ensure CI env variable is being set"
This reverts commit b2c006d4cf.
2021-05-19 15:20:33 +02:00
Antonio Scandurra b2c006d4cf Temporary: ensure CI env variable is being set 2021-05-19 15:19:07 +02:00
Antonio Scandurra 164fbb6759 Increase timeout to 2s for fsevents tests 2021-05-19 15:01:11 +02:00
Antonio Scandurra b85fe83751 Remove condition_with_duration for ModelHandle
Also, use a 2s timeout on CI for both `ModelHandle::condition` and
`ViewHandle::condition`.
2021-05-19 14:50:28 +02:00
Antonio Scandurra a5167177d5 Increase condition timeout on CI and remove condition_with_duration
`condition_with_duration` wasn't really being used, as the default
timeout was `500ms` and the only places that did use it specified
`500ms` as well.
2021-05-19 14:42:10 +02:00
Antonio Scandurra 795f07a24d Enable backtrace for tests on CI 2021-05-19 14:24:23 +02:00
Max Brunsfeld d475c971b7 Merge pull request #68 from zed-industries/optimizations-2
Introduce a few optimizations to `SumTree` and `Buffer`
2021-05-18 09:14:23 -07:00
Antonio Scandurra 29705ae02f Implement time::Global using a SmallVec
Version vectors are going to be small most of the time, especially
as soon as we introduce an optimization that will let us only
track concurrent versions, thus preventing the version vector from
growing indefinitely over time in the tree.
2021-05-18 17:34:48 +02:00
Antonio Scandurra 88f2b18f8b Save a few allocations when pushing to a SumTree 2021-05-18 17:34:36 +02:00
Antonio Scandurra 02b0959e28 Don't summarize unnecessary information when resolving anchor 2021-05-18 17:34:28 +02:00
Nathan Sobo c9c854d08c Try a diff upload action 2021-05-17 23:39:01 -06:00
Nathan Sobo c3b45d4354 Merge pull request #66 from zed-industries/upload-release
Add a release upload action
2021-05-17 23:04:55 -06:00
Nathan Sobo 1c7c21764a Try not cleaning on checkout 2021-05-17 22:46:33 -06:00
Nathan Sobo b79cb96f55 Reenable tests 2021-05-17 21:57:07 -06:00
Nathan Sobo 6570516a1a 🤦‍♂️ 2021-05-17 21:33:08 -06:00