Commit Graph

732 Commits

Author SHA1 Message Date
Max Brunsfeld
cbd9e186b5 Store selections with a right start bias so that autoindent moves them
Previously, cursors at column 0 had to be explicitly moved when those lines
were autoindented. This behavior was lost when we moved selections from
the buffer to the editor. Now, with the right bias, we get this behavior automatically.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-27 15:33:57 -08:00
Max Brunsfeld
43db9e826b Clear autoindent requests when applying autoindent
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-27 13:33:48 -08:00
Nathan Sobo
13ed9dc1f1 Document database setup and fix issue in script/seed-db
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-27 12:52:15 -08:00
Nathan Sobo
63238a2938 Destroy access tokens before destroying users and word-smith method names 2021-12-25 17:46:02 -07:00
Nathan Sobo
b949b30f24 Add delete user endpoint 2021-12-25 11:57:37 -07:00
Nathan Sobo
56930972fe Add endpoints for listing, creating, and updating users 2021-12-25 11:55:10 -07:00
Nathan Sobo
fe5465a265 Enable authentication via the NextJS site 2021-12-25 11:55:10 -07:00
Nathan Sobo
e9a750be71 Don't merge keymap contexts from containing elements
Co-Authored-By: Aaron Hillegass <charmedliferaft@gmail.com>
2021-12-24 16:44:35 -07:00
Nathan Sobo
9fc2ddb8da
Merge pull request #293 from zed-industries/project-diagnostics
Project diagnostics: First pass
2021-12-24 16:42:00 -07:00
Nathan Sobo
cf81f5a555 Update tests to reflect that we no longer attempt to recycle group ids 2021-12-24 16:36:21 -07:00
Nathan Sobo
ce4142eab3 Remove special handling of multi-line primary diagnostic messages and fix tests 2021-12-24 13:47:45 -07:00
Nathan Sobo
a3df597155 Make diagnostics disk-based in test 2021-12-24 13:33:11 -07:00
Antonio Scandurra
adeea9da66 Parse children from cargo check output to provide hints
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-24 17:06:18 +01:00
Antonio Scandurra
a85e400b35 Start on a DiagnosticProvider implementation for Rust
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-24 16:22:22 +01:00
Antonio Scandurra
393009a05c Implement Buffer::diagnostic_group 2021-12-24 12:08:55 +01:00
Antonio Scandurra
11e3874b4a Remove duplication when assigning diagnostics and hardcode provider names 2021-12-24 12:07:26 +01:00
Antonio Scandurra
3149a4297c Add API_TOKEN environment variable to manifest 2021-12-24 10:02:24 +01:00
Max Brunsfeld
4f774e2bde wip 2021-12-23 23:10:28 -08:00
Nate Butler
78564dcc68 Add job post to Zed.dev 2021-12-23 23:22:57 -05:00
Max Brunsfeld
d5a17053df Get code compiling with some todos 2021-12-23 14:21:10 -08:00
Nathan Sobo
e3ecd87081 WIP
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-23 11:24:35 -07:00
Antonio Scandurra
7b453beebc WIP: Use cargo check for on-disk diagnostics
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-12-23 18:35:50 +01:00
Antonio Scandurra
b9d1ca4341 Show only disk-based diagnostics in ProjectDiagnosticsEditor
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-23 16:47:54 +01:00
Antonio Scandurra
304afc1813 Only preserve excerpts for invalid diagnostics if they contain cursors
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-23 16:33:50 +01:00
Antonio Scandurra
dcf26acaac Use a different invalidation strategy for project-wide diagnostics 2021-12-23 15:41:43 +01:00
Antonio Scandurra
da460edb8b Remove BufferState when the last buffer's excerpt is removed 2021-12-23 09:59:39 +01:00
Antonio Scandurra
9164c5f239 Emit an UpdateDiagnostics from Worktree when buffer diagnostics change 2021-12-23 09:57:50 +01:00
Max Brunsfeld
c47340000d Fix remove_excerpts when removing the last N excerpts, N > 1
Also, generalize the randomized test to remove multiple excerpts at a time
2021-12-22 21:02:20 -08:00
Max Brunsfeld
3e59c61a34 Use MultiBuffer::insert_excerpt_after to update project diagnostics view 2021-12-22 18:00:53 -08:00
Max Brunsfeld
435d405d10 Implement MultiBuffer::insert_excerpt_after 2021-12-22 17:59:44 -08:00
Max Brunsfeld
a86ba57983 Add Editor::remove_blocks 2021-12-22 17:30:14 -08:00
Max Brunsfeld
5d8ed535be Clear out old disk-based diagnostics after 2 seconds 2021-12-22 15:51:51 -08:00
Max Brunsfeld
b9551ae8b1 Preserve group ids when updating diagnostics 2021-12-22 14:50:51 -08:00
Max Brunsfeld
06d2cdc20d Remove unused multi_buffer::FromAnchor trait 2021-12-22 13:27:43 -08:00
Max Brunsfeld
0faf5308ac Add a unit test for preserving disk-based diagnostics 2021-12-22 13:27:43 -08:00
Max Brunsfeld
1544da887e Start work on preserving continuity of disk-based diagnostics 2021-12-22 12:52:50 -08:00
Max Brunsfeld
e31205c95e Revert "Implement MultiBuffer::remove_excerpts by inserting tombstones"
This reverts commit 275b7e8d4f.
2021-12-22 10:18:33 -08:00
Antonio Scandurra
275b7e8d4f Implement MultiBuffer::remove_excerpts by inserting tombstones
This will make it easier to use anchors in the presence of deletes.
2021-12-22 17:57:36 +01:00
Max Brunsfeld
2c3efdea8c WIP - Start work on updating project diagnostics view 2021-12-21 16:39:23 -08:00
Max Brunsfeld
a888620e5f Implement MultiBuffer::remove_excerpts
We'll need this for updating project diagnostics
2021-12-21 15:25:57 -08:00
Max Brunsfeld
a93f5e5fb4 Avoid repeated subscriptions + clones when adding another excerpt for same buffer 2021-12-21 14:28:23 -08:00
Max Brunsfeld
3c26f67ea3 Minor cleanup in Buffer::update_diagnostics 2021-12-21 14:07:50 -08:00
Max Brunsfeld
bc906fef9c Store worktree's diagnostics summaries ordered by path 2021-12-21 14:07:09 -08:00
Max Brunsfeld
699dafbbd4 Avoid cloning diagnostic messages from language server 2021-12-21 14:06:17 -08:00
Max Brunsfeld
8492c6e7ac Fix maintenance of MultiBuffer's buffer states 2021-12-21 13:07:43 -08:00
Max Brunsfeld
13ecd16685 Index max buffer row on MultiBuffer 2021-12-21 12:36:46 -08:00
Nathan Sobo
61b806e485 Add an endpoint for creating an access token for a GitHub login 2021-12-21 13:05:32 -07:00
Max Brunsfeld
04d577e326 Fix context line handline in project diagnostic view 2021-12-21 11:46:47 -08:00
Max Brunsfeld
60f7169008 Remove header heights from multibuffer randomized test 2021-12-21 10:24:01 -08:00
Antonio Scandurra
eec1748dc7 Render excerpt headers using DisplayMap::insert_blocks
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-12-21 18:32:27 +01:00
Antonio Scandurra
91c786a8db WIP: Insert blocks in BlockMap for MultiBuffer headers 2021-12-21 17:38:03 +01:00
Antonio Scandurra
8534a9cc41 Don't insert headers in MultiBuffer
This lays the groundwork to insert headers in the block map instead.
2021-12-21 16:38:18 +01:00
Antonio Scandurra
99317bbd62 Delete unit test
Sharing/unsharing is already exercised via the integration tests.
2021-12-21 14:51:09 +01:00
Antonio Scandurra
89c0b358a7 Allow sharing/unsharing of projects 2021-12-21 12:45:20 +01:00
Antonio Scandurra
17094ec542 Allow opening of remote projects via the contacts panel 2021-12-21 12:05:38 +01:00
Antonio Scandurra
5d2c4807db Fix invalid theme variables 2021-12-21 10:25:37 +01:00
Antonio Scandurra
c6dd797f4e Drop project instead of worktree to simulate client leaving 2021-12-21 10:20:05 +01:00
Antonio Scandurra
afec4152f4 Update contacts as projects/worktrees get registered/unregistered 2021-12-21 10:17:26 +01:00
Antonio Scandurra
40da3b233f Get more integration tests passing 2021-12-21 09:50:11 +01:00
Antonio Scandurra
1e8ef8a4c1 Register local worktrees after acquiring a project remote id 2021-12-21 09:49:13 +01:00
Antonio Scandurra
4053d683d9 Re-enable commented out worktree test 2021-12-21 08:35:08 +01:00
Max Brunsfeld
788bb4a368 Get some RPC integration tests passing 2021-12-20 18:08:53 -08:00
Max Brunsfeld
636931373e Add missing RPC handlers for local projects 2021-12-20 18:08:06 -08:00
Max Brunsfeld
870b73aa36 Send a LeaveProject message when dropping a remote project 2021-12-20 18:07:51 -08:00
Max Brunsfeld
a138955943 Fix logic for waiting for project's remote id 2021-12-20 18:07:34 -08:00
Max Brunsfeld
5d8d7de68d Fix accidental usages of local worktree id instead of remote id 2021-12-20 18:06:58 -08:00
Max Brunsfeld
55910c0d79 Get the server and integration tests compiling 2021-12-20 16:30:29 -08:00
Max Brunsfeld
466a377e1d Merge branch 'main' into share-project
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-20 11:42:59 -08:00
Max Brunsfeld
614ee4eac7 Send worktree info only when sharing worktree
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-20 11:36:59 -08:00
Antonio Scandurra
697e641e8e Get back to a compiling state for client
This temporarily disables some tests and there are still some server-side
compiler errors.
2021-12-20 16:08:34 +01:00
Nathan Sobo
323e1f7367 Add the fetching of user JSON by github login with a token header 2021-12-19 09:43:13 -07:00
Nathan Sobo
f4b9772ec2 Relocate admin routes to make room for API
I want to use the top-level /users route for the API that we'll access from the front-end site running on Vercel, and this is the easiest way to make space. Eventually we won't have admin pages, but I want to be additive for now.
2021-12-19 09:06:57 -07:00
Nathan Sobo
29bc2db6e8 Fix journal format strings 2021-12-18 12:15:07 -07:00
Nathan Sobo
0a37d40fad Pad single-digit months, days, and minutes with a leading zero 2021-12-18 11:11:04 -07:00
Nathan Sobo
ab5db0bc1e Fix warnings and tests 2021-12-18 11:06:07 -07:00
Nathan Sobo
e4f18947de Insert a time heading when creating a journal entry 2021-12-18 10:38:54 -07:00
Nathan Sobo
9e8ef31452 Return item handles when opening items
This will support interacting with the opened item. Although I think I should probably return the ItemView rather than the Item. Next commit.
2021-12-18 08:26:57 -07:00
Nathan Sobo
ca0d7e5e1f Add journal crate and move supporting logic into workspace crate
I needed to interact with the workspace to open a file from the journal crate, so I moved a bunch of logic out of main related to opening new workspaces and paths.
2021-12-18 08:12:59 -07:00
Nathan Sobo
cd65031cda Halt keystroke dispatch immediately when we call a global action handler
Someday, we may want to define a global action context that allows us to propagate the action, but this isn't currently supported. Previous to this commit, we were invoking the same global action handler multiple times, once for each view in the responder chain.
2021-12-18 08:12:08 -07:00
Max Brunsfeld
c41b958829 WIP - start restructuring collaboration around entire projects
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-17 22:00:39 -08:00
Antonio Scandurra
88d663a253 Allow saving of all buffers contained in project diagnostics editor
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-17 16:48:16 +01:00
Antonio Scandurra
f0fe346e15 Gracefully degrade diagnostics_in_range, diagnostic_group and file
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-17 16:37:12 +01:00
Antonio Scandurra
6685d5aa7d Implement MultiBuffer::save
This is still not integrated with `workspace::ItemView`.
2021-12-17 16:11:18 +01:00
Antonio Scandurra
7d2b74a93b Implement MultiBuffer::{is_dirty,has_conflict} 2021-12-17 15:33:09 +01:00
Antonio Scandurra
5f819b6edc Implement MultiBuffer::enclosing_bracket_ranges 2021-12-17 15:05:05 +01:00
Antonio Scandurra
c9cbc2fe1e Implement MultiBuffer::range_for_syntax_ancestor 2021-12-17 14:57:42 +01:00
Antonio Scandurra
a2ee38f37b Make MultiBuffer::is_parsing a test-only method 2021-12-17 14:57:24 +01:00
Antonio Scandurra
3914d1d072 Display filename on the first excerpt's header for a group 2021-12-17 13:49:21 +01:00
Antonio Scandurra
63f171200e Enhance diagnostic unit test and correctly display primary diagnostic
That is, if the diagnostic has more than one line we will display the
first line in the header and all the other message lines at the error
location.
2021-12-17 12:16:09 +01:00
Max Brunsfeld
528d64d3cc WIP - Improve project diagnostic context rendering 2021-12-16 18:34:29 -08:00
Max Brunsfeld
fb492a9fb8 Correctly incorporate editor settings into diagnostic header rendering 2021-12-16 16:36:33 -08:00
Max Brunsfeld
ae147a379d Don't terminate on an empty input chunk in ExcerptChunks 2021-12-16 16:05:28 -08:00
Max Brunsfeld
31eeffa5a7 Autoscroll after inserting blocks 2021-12-16 14:20:01 -08:00
Max Brunsfeld
9cd4e5ba04 Transfer focus from ProjectDiagnostics view to its editor 2021-12-16 14:14:22 -08:00
Max Brunsfeld
6444fcd442 Integrate MultiBuffer::buffer_rows into the display map 2021-12-16 13:53:32 -08:00
Max Brunsfeld
db33e4935a Implement MultiBuffer::buffer_rows 2021-12-16 12:17:47 -08:00
Max Brunsfeld
a293e9c0c5 Suppress unused field warnings 2021-12-16 11:17:06 -08:00
Max Brunsfeld
38df091b06 Fix up/down movement across excerpt headers
Implement these movements in terms of clipping, instead of with explicit loops
2021-12-16 11:16:48 -08:00
Max Brunsfeld
dcd05ef96b Resolve Anchor::min and ::max to valid positions
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-12-16 10:25:09 -08:00
Max Brunsfeld
80f3173fbd Always panic if invalid point is passed to {prev,next}_row_boundary
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2021-12-16 10:23:45 -08:00
Antonio Scandurra
0fc2db6d6e Account for folds when inserting/removing block decorations 2021-12-16 16:44:15 +01:00
Antonio Scandurra
7660159164 Test blocks in display map randomized tests
This highlighted some errors in the implementation.
2021-12-16 16:15:14 +01:00
Antonio Scandurra
de679cae78 Re-enable creating multiple blocks at once in BlockMap tests 2021-12-16 12:41:48 +01:00
Antonio Scandurra
abf96e6ad6 Fix movement tests in DisplayMap 2021-12-16 12:36:27 +01:00
Antonio Scandurra
64e2f6d506 Ensure BlockMap::clip_point always yield a valid buffer location 2021-12-16 12:29:37 +01:00
Antonio Scandurra
ec39c9d335 Allow specifying MAX_EXCERPTS via an env variable in random tests 2021-12-16 12:28:54 +01:00
Max Brunsfeld
3e2f684545 Fix prev_row_boundary when a wrap follows a fold
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-15 18:30:09 -08:00
Max Brunsfeld
4c22774694 Always clip buffer points when clipping display points
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-15 17:58:24 -08:00
Max Brunsfeld
f898dc6dae Guard against inverted ranges when building edits in unfold
The multibuffer lets you refer to offsets inside of headers,
so it's possible to create a fold that appears non-empty,
but which spans zero characters in the underlying buffers.

Fold ranges are biased inward: the start is biased right, and
the end is biased left.

Because of these two things, it's possible to create a fold
that becomes "inverted" when you insert text at that position.
2021-12-15 17:29:15 -08:00
Max Brunsfeld
e8570b5c26 Allow multibuffer to clip to the ends of excerpts, before trailing newlines 2021-12-15 17:04:57 -08:00
Max Brunsfeld
f8ef605cbd Update all MultiBuffer unit tests, removing expected trailing newline 2021-12-15 17:04:57 -08:00
Max Brunsfeld
f4115ddc3c 🎨 point_to_display_point & display_point_to_point 2021-12-15 15:45:02 -08:00
Max Brunsfeld
368b4447ff Clip buffer points in DisplayMap::{prev,next}_row_boundary 2021-12-15 15:41:38 -08:00
Max Brunsfeld
2930ea8fb0 Fix handling of excerpts surrounded by edits in MultiBuffer::edit 2021-12-15 12:12:39 -08:00
Max Brunsfeld
4bea16eb31 Ensure muiltibuffer anchors are contained within their excerpt ranges
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-12-15 10:52:27 -08:00
Max Brunsfeld
cec0c5912c Create multiple excerpts in random BlockMap test
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-15 10:21:11 -08:00
Antonio Scandurra
80abd84050 Create MultiBuffers with more than one fragment in more randomized tests
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-12-15 18:38:37 +01:00
Antonio Scandurra
1bdaeda43e Remove disk diagnostics that were invalidated by a buffer edit
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-12-15 18:29:01 +01:00
Antonio Scandurra
4ab307f0a1 Re-enable multi-byte random character generation
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-15 17:51:11 +01:00
Antonio Scandurra
5118f27a90 Overhaul MultiBuffer::chunks
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-15 17:22:04 +01:00
Antonio Scandurra
bcdb4ffd88 Allow edits at the end of MultiBuffer
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-15 16:45:01 +01:00
Antonio Scandurra
7bbaa1d930 Don't insert a newline after the last excerpt of a MultiBuffer
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-15 16:39:09 +01:00
Antonio Scandurra
ae0fa75abe Start testing the integration of display layers with MultiBuffers
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-15 16:05:26 +01:00
Antonio Scandurra
59121a238a Forward notifications from Buffer in MultiBuffer
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-15 15:07:42 +01:00
Nathan Sobo
437145afbe Remove assertion and don't consume 0 bytes
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-12-15 06:52:37 -07:00
Nathan Sobo
fbba417f09 Implement MultiBuffer::bytes_in_range
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-12-15 06:49:10 -07:00
Antonio Scandurra
95137ecb2a WIP 2021-12-15 13:20:11 +01:00
Antonio Scandurra
e23965e7c9 Implement MultiBuffer::reversed_chars_at 2021-12-15 10:06:45 +01:00
Antonio Scandurra
9cbb680fb2 Fix panic on creation of a left-biased anchor at the end of MultiBuffer 2021-12-15 10:06:43 +01:00
Antonio Scandurra
7bcce23dc9 Fix compile error in server integration tests 2021-12-15 08:48:50 +01:00
Nathan Sobo
6c5b27af1d Group diagnostics by primary
Render primary message above the excerpt and supporting messages as block decorations with a `Below` disposition. This is still super rough.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-14 18:26:42 -07:00
Nathan Sobo
e1a2897d53 Render basic diagnostic messages in project diagnostics view
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-14 17:00:57 -07:00
Nathan Sobo
ad05c0cc7a Implement MultiBufferSnapshot::excerpt_headers_in_range
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-14 16:24:48 -07:00
Max Brunsfeld
60e2c6bc52 Fix multibuffer anchors before the ends of excerpts 2021-12-14 13:37:05 -08:00
Max Brunsfeld
06e241117c Fix assertions in test for selection restoration after undo/redo
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-14 13:04:51 -08:00
Max Brunsfeld
e38c1814d5 Update selections on text insertion using anchors
The delta-based approach doesn't work for multi-excerpt buffers.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-14 12:15:26 -08:00
Max Brunsfeld
4ed96bb5a6 Fix assertion in multibuffer history test
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-14 11:47:22 -08:00
Max Brunsfeld
bf9daf1529 Allow left-biased anchors at the beginnings of excerpts
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-12-14 09:58:28 -08:00
Antonio Scandurra
358a6ff66c Implement MultiBufferSnapshot::contains_str_at 2021-12-14 17:51:14 +01:00
Antonio Scandurra
08e9f3e1e3 Maintain a different undo/redo stack in MultiBuffer
This only applies to singleton mode.
2021-12-14 17:43:41 +01:00
Antonio Scandurra
523cbe781b Return the transaction id after grouping in end_transaction_at
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-14 17:41:42 +01:00
Antonio Scandurra
119d44caf7 Remove test-only transaction_group_interval method from MultiBuffer 2021-12-14 14:19:04 +01:00
Antonio Scandurra
2d1ff8f606 Clip anchors created on MultiBuffer's trailing newlines or headers 2021-12-14 12:29:05 +01:00
Antonio Scandurra
1b67f19edc Implement MultiBuffer::set_active_selections 2021-12-14 12:13:19 +01:00
Antonio Scandurra
920daa8a8f Remove stray log statement 2021-12-14 12:01:19 +01:00
Antonio Scandurra
163ce95171 Implement MultiBufferSnapshot::remote_selections_in_range 2021-12-14 11:34:26 +01:00
Antonio Scandurra
174b37cdf0 Assume all excerpts in the multi buffer have the same language for now 2021-12-14 11:33:53 +01:00
Antonio Scandurra
04ffca95c6 Keep a separate diagnostic update count and parse count in MultiBuffer 2021-12-14 11:32:49 +01:00
Antonio Scandurra
9e15c57f91 Display a rudimentary project diagnostic view on alt-shift-d 2021-12-14 11:32:05 +01:00
Max Brunsfeld
4efdc53d9f WIP 2021-12-13 17:44:20 -08:00
Max Brunsfeld
0b1c27956b Add Project::open_buffer method 2021-12-13 17:44:15 -08:00
Max Brunsfeld
fe571f1d70 Store diagnostic summaries on worktrees 2021-12-13 16:36:53 -08:00
Max Brunsfeld
6ab795c629 Handle buffer deduping in the worktree instead of in workspace
Previously, buffers were only deduped by file if they were opened
through Workspace::open_entry
2021-12-13 16:35:46 -08:00
Max Brunsfeld
52b8e3d1a2 Get tests passing after diagnostic + selection changes
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-13 11:34:56 -08:00
Max Brunsfeld
418a9a3d66 Get things compiling with diagnostics on worktree
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-13 11:15:03 -08:00
Antonio Scandurra
85674ba506 WIP
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-13 16:46:35 +01:00
Antonio Scandurra
6645e2820c First attempt at implementing MultiBuffer::edit_internal
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-13 15:43:26 +01:00
Antonio Scandurra
c984b39aaa Show remote collaborators' active selections 2021-12-13 11:38:38 +01:00
Antonio Scandurra
2adf11e204 Write a simple unit test for TreeMap and fix bug in remove 2021-12-13 11:20:10 +01:00
Nathan Sobo
cdbcbdfe6d Test undo/redo at editor layer, including selection restoration 2021-12-12 15:04:19 -07:00
Nathan Sobo
44cd0be068 Restore selections upon undo/redo of edits performed in the current editor 2021-12-12 14:12:03 -07:00
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
0639c8331c Relax TreeMap value bounds, fix warnings, simplify cmp 2021-12-10 23:35:24 -07:00
Nathan Sobo
49d1c9d1ba Introduce sum_tree::TreeMap<K, V>
I think this will be useful to avoid cloning HashMaps in certain cases such as snapshots.
2021-12-10 23:33:15 -07:00
Nathan Sobo
f5c775fcd1 WIP 2021-12-10 22:16:39 -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
d9da8effd4 Re-implement edits_since_in_range in terms of Locator
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-10 14:22:43 +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
Antonio Scandurra
eeba0993aa Optimize anchor comparison and take full advantage of fragment IDs 2021-12-10 09:16:58 +01:00
Max Brunsfeld
5e516f59c0 Merge branch 'fragment-locators' into HEAD 2021-12-09 14:49:04 -08:00
Max Brunsfeld
1ed1ec21dd Batch anchor resolution, avoid cloning fragment ids when seeking 2021-12-09 11:00:40 -08:00
Antonio Scandurra
e9c385e7a6 WIP 2021-12-09 18:27:54 +01: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
Antonio Scandurra
67686dd1c2 Don't use an enum for anchors and model min/max more implicitly
This will make it easier to serialize an anchor.
2021-12-09 12:01:17 +01:00
Antonio Scandurra
cbe136c0cb Implement anchor resolution using locators 2021-12-09 11:18:01 +01:00
Antonio Scandurra
b7535dfba4 Store only clock::Local in InsertionFragment 2021-12-09 09:21:52 +01:00
Antonio Scandurra
dc81b5f57a Make remote edit randomized tests pass with locators 2021-12-09 09:15:19 +01:00
Antonio Scandurra
b4ebe179f9 Make local edit randomized tests pass with locators 2021-12-09 09:11:16 +01:00
Nathan Sobo
dd38eb1264 Start on maintaining an insertions tree
I'm correctly assigning fragment ids to all fragments in the fragments tree, but I have a randomized test failure when making sure that the insertions tree matches the state of the fragments tree.
2021-12-08 22:05:13 -07:00
Nathan Sobo
ec54010e3c Sketch in type-level changes to track insertion splits 2021-12-08 21:04:22 -07: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