Commit Graph
253 Commits
Author SHA1 Message Date
Antonio Scandurra 29cad65ce0 Open untitled buffers via the Project
This allows the registration of such buffers in the project, which is necessary
to correctly support `::save_buffer_as` and opens the door to sharing untitled
buffers with guests in the future.

Note that, for now, this disallows guests to create untitled buffers in the
current window and will create a new window instead. This is because we don't
yet have a global way of allocating a buffer's remote id (nor a way of saving
such buffers in the host's worktree) and we instead rely on the local model ID,
which could clash with the host's buffer IDs.

I think we should revisit this once guests can share their untitled buffers
with the host and other remote peers, as well as once we start keying
operations by entry id.
2022-03-04 15:25:39 +01:00
Antonio ScandurraandMax Brunsfeld 68cfce1fb8 Rename weak to visible
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-03-02 14:38:16 -08:00
Antonio Scandurra 466db69780 Pass a reference to TestAppContext in tests
This allows us to drop the context *after* we ran all futures to
completion and that's crucial otherwise we'll never drop entities
and/or flush effects.
2022-03-01 12:01:02 +01:00
Nathan Sobo 7ef98fb935 Make versions oldest_selection and newest_selection that don't require snapshots
I thought I needed this but actually didn't, but I still kinda think it's a good change for the public interface of Editor.
2022-02-27 13:02:09 -07:00
Nathan Sobo dabb17a2ef Clone editor's searchable state on split 2022-02-27 09:48:46 -07:00
Nathan Sobo dd6f8d20a3 Remove carriage returns 2022-02-27 07:47:46 -07:00
Nathan Sobo 2f427769df Allow a new search to be created with cmd-enter
This replaces the `cmd-alt-shift-F` binding to open a new search. Instead, you can preserve the existing search results by entering a query and then hitting `cmd-enter` instead of `enter`. This opens a new project find view and restores the previous view to whatever query it was previously displaying. It's a bit strange, but I don't want to rely on splitting as the only way of creating multiple sets of search results.
2022-02-26 13:23:05 -07:00
Nathan Sobo 60710fa5d5 Only store one nav history entry when opening excerpts
Also: Introduce the ability to disable and enable the nav history directly. This allows us to explicitly push an entry when opening excerpts and then disable all pushes as we open individual buffers.
2022-02-25 19:26:15 -07:00
Nathan SoboandMax Brunsfeld 721258911c Open excerpts on alt-enter
Also: Remove special handling for alt-shift-D binding in diagnostics view that opens excerpts. Rely on alt-enter in all multi-buffers instead.
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-02-25 16:49:28 -07:00
Nathan SoboandMax Brunsfeld dea40c5d1a Don't show buffer search UI on ProjectSearchView
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-02-25 16:14:45 -07:00
Antonio Scandurra b506db7c93 Use the new split pane's navigation history when cloning an item 2022-02-25 17:22:30 +01:00
Antonio Scandurra 7aacb63762 Respect field editor background, color and selection styling 2022-02-25 10:48:22 +01:00
Antonio Scandurra 0bf944e038 Use Project::search in ProjectFind and show search results 2022-02-25 10:32:45 +01:00
Max BrunsfeldandNathan Sobo 47b654063e Provide editor styling information separately from editor settings
* Since regular editors' font sizes and families are controlled by
  the settings and not the theme, don't store a dummy text style in
  the theme. Instead, only store a font color, and synthesize
  the text style for regular editors using both the theme and the
  settings.
* Style single-line and auto-height editors (now called "field
  editors") using a single function that takes the entire theme and
  selects a relevant sub-object.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-24 16:42:00 -08:00
Antonio Scandurra 9e173564e9 Pass an AsyncAppContext to fake language server request handlers 2022-02-23 16:14:36 +01:00
Max Brunsfeld e140f70e3c Show document highlights from the language server when moving the cursor 2022-02-22 17:16:31 -08:00
Max BrunsfeldandNathan Sobo 25d45378e4 Implement find-all-references
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-22 14:27:16 -08:00
Antonio Scandurra 8a8ae0fbcd Rename CompletionLabel to CodeLabel and add Project::symbols
This only works locally for now and we haven't implemented the
`RustLsp::label_for_symbol` method yet.
2022-02-22 10:01:08 +01:00
Max Brunsfeld b573a39cbc Ensure we never leak block decorations when renaming 2022-02-18 17:00:57 -08:00
Max Brunsfeld 80bca57bfa Tweak behavior of selections when renaming 2022-02-18 15:44:57 -08:00
Max BrunsfeldandNathan Sobo f0a6e8cb9c Use a block decoration for entering rename text
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-18 13:51:43 -08:00
Antonio Scandurra d705244210 WIP 2022-02-18 10:47:22 -08:00
Antonio Scandurra 62e5947b76 Cancel pending rename when hitting escape 2022-02-18 15:24:24 +01:00
Antonio Scandurra 20c1a1e310 Use theme to highlight in-progress rename 2022-02-18 12:20:59 +01:00
Antonio Scandurra a682ebb08d Add test for preparing and performing a rename 2022-02-18 12:18:01 +01:00
Antonio Scandurra f9723ae16b Undo temporary edits before performing rename or canceling it
Also, wire up remote renames.
2022-02-18 11:41:47 +01:00
Antonio Scandurra 514d69e83d Merge branch 'main' into rename 2022-02-18 09:11:05 +01:00
Max Brunsfeld 54d7642712 Start work on renames 2022-02-17 18:01:07 -08:00
Max Brunsfeld 10580f96a3 Automatically include current view id in element state ids 2022-02-17 13:44:46 -08:00
Max Brunsfeld 6d8db5f6bb Convert some project tests to use FakeFs
Also, tweak some FakeFs methods to make them slightly more convenient.
2022-02-17 11:09:27 -08:00
Max BrunsfeldandAntonio Scandurra d173e4ef3c Fix non-unique ids passed to MouseEventHandlers
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-02-17 09:44:02 -08:00
Antonio Scandurra 985d216e4b Make completion unit test on editor more resilient 2022-02-17 17:30:10 +01:00
Max BrunsfeldandNathan Sobo 90f31bb123 Allow FakeLanguageServer handlers to handle multiple requests
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-16 16:19:27 -08:00
Max BrunsfeldandNathan Sobo c4dff12d69 Allow multiple fake language servers to be started for a given project
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-16 16:10:36 -08:00
Max BrunsfeldandNathan Sobo e9250e647b Fix mouse event handler for code actions indicator
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-14 14:06:55 -08:00
Antonio Scandurra fadb94afb2 Use selection instead of just the cursor when fetching code actions 2022-02-14 14:13:36 +01:00
Antonio Scandurra 1eea2f3653 Add integration test for code actions 2022-02-14 11:42:56 +01:00
Antonio Scandurra a2100627c3 Refresh diagnostics and code actions more selectively 2022-02-12 13:01:55 +01:00
Max Brunsfeld 06bb8d2779 Fix panic when canceling with a pending selection 2022-02-11 15:31:54 -08:00
01664d494c Restructure fake language server to setup request handlers in advance
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-11 15:08:56 -08:00
680d1fedc2 Always call set_selections in mouse selection methods
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-11 09:52:18 -08:00
947fe848c1 Make multibuffer anchor's buffer_id optional
Avoid using 0 for a buffer id on Anchor::min and max

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-11 09:51:47 -08:00
Nathan SoboandMax Brunsfeld fa194c8e14 Pass the pending selection to update_selections and set_selections
This helps us preserve our invariant of always having at least a pending selection in set_selections when comparing old and new cursor positions.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-02-11 10:07:42 -07:00
Nathan Sobo ad9a0e2d4f Revert "Ensure there's always at least one selection in the editor"
This reverts commit b1a44b5816.
2022-02-11 09:21:04 -07:00
Antonio ScandurraandNathan Sobo 612a33147a Allow toggling of code actions
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-11 17:01:22 +01:00
Antonio ScandurraandNathan Sobo 7b28418979 Allow deployment of code actions from indicator
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-11 16:47:40 +01:00
Antonio ScandurraandNathan Sobo b1a44b5816 Ensure there's always at least one selection in the editor
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-11 16:25:26 +01:00
Antonio ScandurraandNathan Sobo a41725daee Render code actions indicator
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-11 16:01:15 +01:00
Antonio ScandurraandNathan Sobo 2fcdcac080 Fetch code actions on cursor movement instead of on-demand
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-11 14:41:19 +01:00
424b35253a Don't open a multibuffer when code actions's edits are contained in the current editor
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-10 09:55:21 -08:00