Commit Graph
31406 Commits
Author SHA1 Message Date
Antonio Scandurra 6350760340 Implement zed --wait 2022-04-20 17:28:31 +02:00
Antonio Scandurra f18eb2a63f Call language::init_test in test_single_file_worktrees_diagnostics 2022-04-20 17:28:31 +02:00
Antonio Scandurra 2b2123b655 Use osascript to escalate privileges and copy the CLI to /usr/local/bin 2022-04-20 17:28:30 +02:00
Max Brunsfeld b7f90ffdee Avoid permissions error when installing CLI symlink 2022-04-20 17:27:33 +02:00
Max Brunsfeld e7aa8350fd Add a command for installing the CLI 2022-04-20 17:27:33 +02:00
Max Brunsfeld 391e3b8fec 🎨 Remove unnecessary JoinProjectParams struct 2022-04-20 17:27:33 +02:00
Max Brunsfeld 8ae5bc4280 Locate the Zed app from the CLI using NSWorkspace API 2022-04-20 17:27:33 +02:00
Max BrunsfeldandAntonio Scandurra d3971f0899 Allow opening paths from the CLI
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-04-20 17:27:31 +02:00
Nathan Sobo c1e95c2f9b Process incoming CLI requests on the main thread 2022-04-20 17:15:46 +02:00
Nathan SoboandMax Brunsfeld b7f0ff4dca Use ipc_channel crate to communicate between cli and app
We still aren't handling CLI requests in the app, but this lays the foundation for bi-directional communication.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-04-20 17:15:46 +02:00
Antonio ScandurraandNathan Sobo a49363b39e WIP: Start on a new cli crate
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-04-20 17:15:45 +02:00
Antonio Scandurra 58111044f0 v0.28.1 2022-04-20 15:21:15 +02:00
Antonio Scandurra a233f1fb91 Don't emit event when LSP reports consecutive empty diagnostics
This is related to #849: in that pull request we avoided *storing*
empty diagnostics, but we'd still report an event when receiving
consecutive empty diagnostics. So if the project diagnostics editor
was open, it could happen that opening a buffer would cause the
language server to report zero diagnostics. We would therefore close
the buffer because there were no diagnostics, but doing so would cause
the LSP to report another event with zero diagnostics. This would repeat
forever, causing Zed to use a lot of CPU and the UI not to refresh properly.

With this commit we will simply avoid emitting a `DiagnosticsUpdated` event
altogether if no diagnostics were present before *and* the LSP is reporting
a `PublishDiagnostics` event with no diagnostics in it.
2022-04-20 15:02:38 +02:00
Max Brunsfeld e5693a7b18 Don't cancel match updates when picker query changes
The file finder often cancels an in-progress match task when
the project updates. But it still needs to take the matches
that it did find and add them to its results. So we should
not cancel the entire task, as this will cause the
partial results to be discarded.
2022-04-19 13:16:57 -07:00
Max Brunsfeld 412d48c8b5 Update file finder correctly when project files change 2022-04-19 13:10:36 -07:00
Keith Simmons 6196733e01 Handle linewise motions correctly and fix panic when executing invalid actions 2022-04-19 11:36:44 -07:00
a8a55600c9 Navigate to best match when updating outline view query
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Keith Simmons <keith@the-simmons.net>
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-04-19 10:12:42 -06:00
Nathan SoboandAntonio Scandurra 62ecf5be3d v0.28.0
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-04-19 09:40:32 -06:00
Antonio ScandurraandNathan Sobo 1df22bbdec Remove summaries that don't contain any errors or warnings
When opening a buffer, some language servers might start reporting
diagnostics. When closing a buffer, they might report that no diagnostics
are present for that buffer. Previously, we would keep an empty summary entry
which would cause us to open a buffer in the project diagnostics view, only to
drop it because it contained no diagnostics. However, the act of opening it
caused the language server to asynchronously report non-empty diagnostics.
We would therefore handle this as an update, but the previous closing of the
buffer would cause the language server to report empty diagnostics again. This
would cause the project diagnostics view to thrash infinitely between these two
states, pegging the CPU and constantly refreshing the UI.

With this commit we won't maintain empty summary entries for files that contain
no diagnostics, which fixes the above issue.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-04-19 15:30:46 +02:00
Antonio Scandurra ab111f672e Use the entire ProjectPath to find open buffer for an LSP diagnostic
Previously, we would only compare the path relative to the worktree root, which
would cause Zed to sometimes update diagnostics on the wrong buffer. This
manifested in the project diagnostics not showing those errors/warnings while
the status bar and the tab title displayed a summary with errors/warnings.

This commit simply uses `Project::get_open_buffer` which correctly locates a
buffer with the given project path.
2022-04-19 12:06:14 +02:00
Max Brunsfeld 54649856d8 Format action names more readably in command palette
Also add a unit test for the command palette
2022-04-18 18:12:43 -07:00
Max Brunsfeld b07ab44305 tmp 2022-04-18 17:30:17 -07:00
Max Brunsfeld c8badace6a Allow toggling other modals from the command palette 2022-04-18 17:11:39 -07:00
Max Brunsfeld c282add536 Highlight fuzzy match positions in command palette 2022-04-18 17:11:39 -07:00
Max Brunsfeld 04cbb7b727 Use Picker in Outline view 2022-04-18 17:11:39 -07:00
5b4f7a0f6c Fix hang when dropping ::scoped future under deterministic executor
Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-18 17:11:39 -07:00
Max BrunsfeldandKeith Simmons 0cf719d1b8 Remove unused crossbeam-channel dependency in zed crate
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-18 17:11:39 -07:00
Max BrunsfeldandKeith Simmons c428098b2e Fix crash when dropping a task that is awaiting a call to Background::scoped
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-18 17:11:39 -07:00
Max Brunsfeld 385ea15c1b Make all pickers respect mouse clicks 2022-04-18 17:11:39 -07:00
Max Brunsfeld 72580120eb Use Picker in FileFinder 2022-04-18 17:11:39 -07:00
Max Brunsfeld bab5d43198 Use Picker in ProjectSymbolsView 2022-04-18 17:11:39 -07:00
Max Brunsfeld 662c01fe43 Use Picker in ThemeSelector 2022-04-18 17:11:39 -07:00
Max Brunsfeld 3db14eb424 Rename SelectorModal -> Picker, put it in its own crate 2022-04-18 17:11:39 -07:00
Max Brunsfeld 44a0e8a019 Add basic styling to keystrokes in command palette 2022-04-18 17:11:37 -07:00
Max BrunsfeldandAntonio Scandurra f573a7f164 Display key bindings in the command palette
They still need to be styled.

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-04-18 17:11:08 -07:00
Max Brunsfeld 700c1b2d50 Start work on a command palette 2022-04-18 17:11:08 -07:00
Max Brunsfeld d54db9b4ae Add a gpui method for listing the available actions 2022-04-18 17:11:07 -07:00
Keith Simmons 4579e1f7c9 Merge pull request #812 from zed-industries/js-jsx-language
Add javascript and jsx specific languages
2022-04-18 16:19:54 -07:00
Keith Simmons 315ad8dfff Swap to parsing javascript as jsx 2022-04-18 15:26:57 -07:00
Keith Simmons 6727a370c1 Revert d/c j and k binding special casing 2022-04-18 14:44:11 -07:00
Keith Simmons d7933ffd5c Merge jsx language into js 2022-04-18 14:21:23 -07:00
Keith Simmons 35557b222c Add c and d operators to vim normal mode
Extracted motions from normal mode
Changed vim_submode to be vim_operator to enable better composition of operators
2022-04-15 16:05:50 -07:00
Antonio Scandurra 4beffbe00d Always clear rename state when selections change
At some point during the implementation of rename, we added logic for
invalidating the rename state when the selection moved outside the original
rename range. After transitioning to displaying renames as a block decoration,
we don't need that anymore given that a new, temporary editor is used instead.

This commit removes that invalidation logic and always calls `Editor::take_rename`
when the editor selections change. Doing so also fixes a bug that was causing Zed
to hide the cursor when clicking on the editor to dismiss the rename.
2022-04-15 10:32:07 +02:00
Nathan Sobo beb2ec9065 Merge pull request #822 from zed-industries/focus-project-search-query
Fix focus bugs in `ProjectSearchView`
2022-04-14 12:25:59 -06:00
Max Brunsfeld d0089e79ef Merge pull request #817 from zed-industries/dynamic-editor-highlights
Store accessors for editor highlight colors not colors themselves
2022-04-14 10:36:38 -07:00
Antonio Scandurra 53944f3971 Fix tests 2022-04-14 18:50:45 +02:00
Antonio Scandurra a70882b79c Persist project search focus state
...so that we can re-focus the previously-active editor when switching back
to the project search tab.
2022-04-14 18:36:42 +02:00
Antonio Scandurra 5294b328d3 Introduce ViewContext::observe_focus 2022-04-14 18:22:55 +02:00
Nathan Sobo e221fb61ac Only process a single focus effect per batch
This allows us to focus the query editor of the project search when deploying it. Previously, a complex interplay between focus events was preventing this from working in an intuitive way. What happened previously:

- We'd activate the project search, which enqueued a focus effect for the project search view
- We'd focus the query editor, which enqueued an effect
- We'd process the focus effect for the search view, which would enqueue an effect to transfer focus to the results editor
- We'd process the effect to focus the query editor
- We'd process the effect to focus the results editor

Now...

- We activate the project search pane item, enqueuing a focus effect for the project search itself
- We focus the query editor and *remove* the previous pending focus change effect
- We process the focus effect
2022-04-14 08:52:24 -06:00
Nathan Sobo 10ee52fa86 Revert "Focus Project Search query editor always when deployed" 2022-04-14 07:53:15 -06:00