Commit Graph

5739 Commits

Author SHA1 Message Date
Nathan Sobo
71cf6ec5ae Use into_any instead of weird 'as' hack 2023-04-02 15:55:30 -06:00
Nathan Sobo
27258a0889 Remove From trait for AnyViewHandle in favor of into_any method
I think it's more explicit.
2023-04-02 15:50:42 -06:00
Nathan Sobo
aed8df96ff Wrap AnyWeak handles with their typed counterparts 2023-04-02 15:42:03 -06:00
Nathan Sobo
82a713fd1d Store AnyViewHandle inside ViewHandle and Deref to it 2023-04-02 14:59:55 -06:00
Julia
8c0db17634 Trust NPM instead of managing dirs for different Node server versions 2023-03-31 17:15:44 -04:00
Mikayla Maki
c19e6f8f0e
Merge pull request #2338 from zed-industries/more-copilot-bugs
More copilot bugs
2023-03-31 12:45:19 -07:00
Mikayla Maki
dcaa355ad2 Switch from removing all directories in the container dir to removing the non-version dir 2023-03-31 12:36:23 -07:00
Julia
0f4f3bfbde Revert "Merge pull request #2335 from zed-industries/dont-delete-json-server-after-downloading-it"
This reverts commit 516e77906e, reversing
changes made to 54582fd77f.
2023-03-31 15:31:50 -04:00
Mikayla Maki
57b5c1ee20 Fix crash on initiating copilot during collaboration. Copilot is now disabled when collaborating. 2023-03-31 12:28:58 -07:00
Mikayla Maki
f616e8bac9
Merge pull request #2336 from zed-industries/respect-languages-alias-in-settings-file
Add support for writing to the langauge_overrides alias in settings
2023-03-31 11:51:25 -07:00
Mikayla Maki
b6882f0cbf Fix typo in copilot button 2023-03-31 11:50:31 -07:00
Mikayla Maki
e5a6b11d8f
Merge pull request #2334 from zed-industries/quiet-copilot-loggin
Add handlers for LogMessage and statusNotification to copilot LSP
2023-03-31 11:22:23 -07:00
Mikayla Maki
c1445fe015 Add support for the langauge_overrides alias in the settings file updating code 2023-03-31 11:20:46 -07:00
Mikayla Maki
bdce96b19a
Update copilot.rs 2023-03-31 11:16:52 -07:00
Julia
0199ffed5f Don't delete JSON language server directly after downloading it
This was accidentally added during the messy NodeRuntime/Copilot rebase

Co-Authored-By: Joseph Lyons <joseph@zed.dev>
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2023-03-31 14:01:04 -04:00
Mikayla Maki
f561e5ef2c remove spare debug 2023-03-31 11:00:06 -07:00
Mikayla Maki
4865ea2efc Add handlers for LogMessage and statusNotification to copilot LSP 2023-03-31 10:58:18 -07:00
Antonio Scandurra
b208d1a489 🎨 2023-03-31 18:10:10 +02:00
Antonio Scandurra
5f579a4287 Fix prefix/suffix calculation when determining copilot suggestion
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2023-03-31 18:05:07 +02:00
Antonio Scandurra
b588ba1435 Avoid auto-indenting when accepting copilot suggestion
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-03-31 17:17:35 +02:00
Antonio Scandurra
6e43e77c3f Use copilot's Completion::{range,text} to determine suggestion
Previously, we were using display text, but this isn't always correct. Now,
we just attempt to determine what text Copilot wants to insert by finding
a prefix and suffix in the existing text with the suggested text.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-03-31 17:08:41 +02:00
Mikayla Maki
713f5f604f Fix leaked handle and failure to update language in context menu 2023-03-30 17:40:11 -07:00
Mikayla Maki
e38f52d595 Fix unrelated panics in tests 2023-03-30 17:19:29 -07:00
Mikayla Maki
c3188be4c1 cargofmt 2023-03-30 16:58:11 -07:00
Mikayla Maki
81411b9114 Merge branch 'main' into copilot 2023-03-30 16:57:18 -07:00
Mikayla Maki
c28d2c490b Remove test modals 2023-03-30 16:52:55 -07:00
Mikayla Maki
afc9b832c8 Finish device code flow for copilot 2023-03-30 16:50:33 -07:00
Mikayla Maki
f5d4bcd934 Added erorr states and first-pass error handling to the copilot status bar item.
Added correct icons
Added a new 'Toast' action which allows other crates to easily pop toasts with an optional click action
2023-03-30 14:10:57 -07:00
Julia
cdde523ea4 Allow each language adapter to provide their own code action kinds array 2023-03-30 15:41:54 -04:00
Mikayla Maki
b7461c32dd Improve settings writing for more cases 2023-03-30 10:40:53 -07:00
Mikayla Maki
e46cd2def3 Switch to using zed hosted copilot LSP (again)
co-authored-by: antonio <antionio@zed.dev>
2023-03-30 09:29:49 -07:00
Petros Amoiridis
007aa92581
Merge pull request #2323 from zed-industries/petros/z-402-recent-projects-replace-expanded-home
Replace home directory with the tilde substitution
2023-03-30 18:12:39 +03:00
Petros Amoiridis
dc51735112
Fix doctests 2023-03-30 17:57:14 +03:00
Petros Amoiridis
adc5ef911f
Remove the Errors section from rust docs
The section does not add anything that we don't already know.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2023-03-30 14:04:37 +03:00
Petros Amoiridis
18c6c7ebb7
Fix error 2023-03-30 14:03:59 +03:00
Petros Amoiridis
9ef3e45bcd
Update crates/recent_projects/src/highlighted_workspace_location.rs
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2023-03-30 11:35:17 +03:00
Antonio Scandurra
af4c4c7cf0 Speed up tab searching in TabMap::sync by looking for \t only
Instead of looking for `\n` as a stopping condition, we cap the range
we pass to `SuggestionSnapshot::chunks` to stop on the next line. This
makes character searching faster, because looking for a single character
uses `memchr`. Also, this avoids an extra conditional in a tight loop such
as the chunk scanning one contained in `TabMap::sync`.
2023-03-30 10:03:13 +02:00
Antonio Scandurra
79346b0706 Use + instead of | to break out of tab expansion in TabMap::sync 2023-03-30 09:49:07 +02:00
Mikayla Maki
5b3b74345d Remove some strays 2023-03-29 22:22:02 -07:00
Mikayla Maki
a8033b266d Fix bug with enable setting, clean up sign in UIs 2023-03-29 21:51:07 -07:00
Mikayla Maki
cc7c5b416c Add status bar icon reflecting copilot state to Zed status bar 2023-03-29 21:31:33 -07:00
Mikayla Maki
8fac32e1eb WIP, not compiling 2023-03-29 17:59:21 -07:00
Mikayla Maki
76efab005f WIP 2023-03-29 17:25:41 -07:00
Max Brunsfeld
b5f762ab25 Open a new window when activating Zed from the dock w/ no windows open 2023-03-29 17:24:44 -07:00
Mikayla Maki
ae3b3ea458 Merge branch 'main' into copilot 2023-03-29 16:57:38 -07:00
Mikayla Maki
ebd06b43f5 Add copilot settings
Add copilot pause / resume
Add copilot statusbar item stub
2023-03-29 16:40:52 -07:00
Max Brunsfeld
7601e7902a
Merge pull request #2325 from zed-industries/tab-map-long-lines
Avoid slowdowns with long lines by skipping tab expansion beyond a certain column
2023-03-29 14:48:23 -07:00
Max Brunsfeld
0c07a373a8 🎨 2023-03-29 14:43:01 -07:00
Julia
e558d3f903
Merge pull request #2328 from zed-industries/breadcrumbs-outline-toggle
Open symbol outline when clicking on editor breadcrumbs
2023-03-29 15:51:30 -04:00
Julia
737e2e1b3c Open symbol outline when clicking on editor breadcrumbs 2023-03-29 15:46:43 -04:00
Mikayla Maki
f812796283 Make modal behavior stateless
Co-authored-by: antonio <antonio@zed.dev>
2023-03-29 12:45:53 -07:00
Antonio Scandurra
49447128a9 Make edits smaller when tab expansion changes on a line 2023-03-29 21:40:37 +02:00
Joseph Lyons
6e2a9297ff v0.81.x dev 2023-03-29 14:13:01 -04:00
Antonio Scandurra
b86f8188d1 Expand edit to end of the line when old/new row exceeds max expansion 2023-03-29 16:49:21 +02:00
Petros Amoiridis
b15632bd45
Remove convert_to_shortened_path from gpui platform 2023-03-29 17:41:01 +03:00
Petros Amoiridis
b4593cd90b
Use util::paths::compact 2023-03-29 17:40:39 +03:00
Petros Amoiridis
69989d0463
Introduce compact function in util create 2023-03-29 17:32:27 +03:00
Petros Amoiridis
d5f53111e8
Enable doctests in util crate 2023-03-29 17:31:55 +03:00
Petros Amoiridis
a128439699
Move code into the platform
Co-Authored-By: Joseph T. Lyons <19867440+JosephTLyons@users.noreply.github.com>
2023-03-29 16:25:13 +03:00
Petros Amoiridis
87c1b190a8
Replace home directory with the tilde substitution 2023-03-29 16:25:10 +03:00
Antonio Scandurra
719d0f0abf Rename skip_leading_tab to inside_leading_tab 2023-03-29 14:53:28 +02:00
Antonio Scandurra
813f722925 Increment input_column correctly when inside the leading tab 2023-03-29 14:52:50 +02:00
Antonio Scandurra
a64296938d Delete unused code 2023-03-29 09:04:13 +02:00
Mikayla Maki
d60ef03d66 WIP Add copilot disabled setting 2023-03-28 20:52:50 -07:00
Mikayla Maki
0b0c7e4ce9 Move command palette filter into collections crate
Filter out copilot commands from command palette when not active
2023-03-28 20:13:17 -07:00
Mikayla Maki
aea8475d30 Apply cargo fmt 2023-03-28 18:45:37 -07:00
Antonio Scandurra
12370f120e 🎨 2023-03-28 18:40:51 -07:00
Antonio Scandurra
ce9774be53 Improve detection of common prefix in text_for_active_completion 2023-03-28 18:40:42 -07:00
Mikayla Maki
9d8d2bb8f4 Add rough versions of all 3 modals 2023-03-28 18:00:09 -07:00
Max Brunsfeld
5c1f82ae3d Don't use TabMap::expand_tabs in line_indent_for_buffer_row 2023-03-28 17:37:57 -07:00
Max Brunsfeld
08e93e9321 Only expand tabs up until a limited column 2023-03-28 16:40:04 -07:00
Max Brunsfeld
c23feeab3a 🎨 Make expand_tabs and collapse_tabs instance methods on TabSnapshot 2023-03-28 14:10:43 -07:00
Mikayla Maki
941da24f73 Refactor out the node runtime crate and hook up all related imports 2023-03-28 10:27:31 -07:00
Mikayla Maki
0ef9cefe0f Finish shape of copilot auth UI 2023-03-28 09:42:01 -07:00
Mikayla Maki
6ff09865eb Create copilot auth popup UI 2023-03-28 09:42:01 -07:00
Antonio Scandurra
da81ff3295 Optimize CopilotState::text_for_active_completion 2023-03-28 09:42:01 -07:00
Antonio Scandurra
034bc75467 Refresh copilot suggestions when hitting alt-] if none are showing
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2023-03-28 09:42:01 -07:00
Antonio Scandurra
d236d9e8c9 Clear copilot suggestions when hitting escape
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2023-03-28 09:42:01 -07:00
Antonio Scandurra
1162615043 Reuse existing suggestion when inserting to avoid flickering 2023-03-28 09:42:01 -07:00
Antonio Scandurra
6715e5247c Rework SuggestionMap to take highlight style when retrieving chunks 2023-03-28 09:42:01 -07:00
Antonio Scandurra
093e0a30e9 Replace editor::CycleCopilotSuggestions with copilot::NextSuggestion 2023-03-28 09:42:01 -07:00
Antonio Scandurra
2f95510a2e Start integrating Copilot with editor
There's still a bit to do in terms of reusing the previous suggestion
when the prefix matches, but we're getting there.
2023-03-28 09:42:01 -07:00
Antonio Scandurra
b16e2169ce WIP: Start on showing window for authenticating with copilot
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2023-03-28 09:42:01 -07:00
Antonio Scandurra
9713d1bb31 Fix invalid translation between bottom/top left coordinate spaces
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2023-03-28 09:42:01 -07:00
Antonio Scandurra
99cca59c84 Restructure verification code prompting to open a window instead
Also, prevent multiple calls to `sign_in` from racing with each other.
2023-03-28 09:42:01 -07:00
Mikayla Maki
19cc86a2d4 Wait to show the auth modal until the sign request has returned 2023-03-28 09:42:00 -07:00
Mikayla Maki
15e29d44b9 Add basic copilot modal 2023-03-28 09:42:00 -07:00
Mikayla Maki
b57d5174aa Add copilot theme, start sketching out the auth modal 2023-03-28 09:42:00 -07:00
Antonio Scandurra
591e246450 Implement Copilot::completions_cycling
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2023-03-28 09:42:00 -07:00
Antonio Scandurra
155594c8b8 Successfully fetch completions from Copilot
We still need to process them and return them into a more Zed-friendly
structure, but we're getting there.
2023-03-28 09:42:00 -07:00
Antonio Scandurra
180371929b Start on copilot completions 2023-03-28 09:42:00 -07:00
Antonio Scandurra
8ba9e63ab8 🎨 2023-03-28 09:42:00 -07:00
Antonio Scandurra
59d9277a74 Implement Copilot sign in and sign out 2023-03-28 09:42:00 -07:00
Antonio Scandurra
797bb7d780 Start copilot and check sign in status 2023-03-28 09:42:00 -07:00
Antonio Scandurra
5471217089 Use the same serde version across the entire workspace 2023-03-28 09:42:00 -07:00
Mikayla Maki
9a99eaee96 Fix bad global 2023-03-28 09:42:00 -07:00
Mikayla Maki
455cdc8b37 Add copilot crate
Refactor HTTP and github release downloading into util
Lazily download / upgrade the copilot LSP from Zed

Co-authored-by: Max <max@zed.dev>
Co-Authored-By: Antonio <antonio@zed.dev>
2023-03-28 09:41:59 -07:00
Julia
35b2aceffb
Merge pull request #2324 from zed-industries/download-node
Automatically download Node for Node based language servers
2023-03-28 12:10:24 -04:00
Julia
ee3ac9c344 Rename installation.rs -> github.rs now that is all it concerns 2023-03-28 11:51:09 -04:00
Julia
350f8ed304 Download the JSON LSP package instead of our own bundled binary 2023-03-28 11:48:00 -04:00