Commit Graph
1451 Commits
Author SHA1 Message Date
Antonio Scandurra 79d5bb45dc Clear Copilot suggestions when it gets disabled from the settings 2023-04-04 10:45:56 +02:00
Mikayla Maki 2e33f8b228 fixup! Remove per-file copilot enable/disable 2023-04-03 15:21:43 -07:00
Mikayla Maki 48d9c30b0e Remove per-file copilot enable/disable 2023-04-03 15:15:42 -07:00
Nathan Sobo cdfe873802 Merge pull request #2343 from zed-industries/handles
Make typed handles wrappers around their untyped equivalents
2023-04-03 09:20:37 -04:00
Antonio Scandurra b88aa9af1d Clear active copilot suggestion only if there is one 2023-04-03 14:32:41 +02:00
Antonio Scandurra ec5309b543 Make autocompletion and copilot mutually exclusive 2023-04-03 14:15:21 +02:00
Antonio Scandurra 75ecf92ae4 Fix Copilot errors when opening buffers that don't exist locally 2023-04-03 12:28:32 +02:00
Nathan Sobo 82a713fd1d Store AnyViewHandle inside ViewHandle and Deref to it 2023-04-02 14:59:55 -06:00
Antonio Scandurra b208d1a489 🎨 2023-03-31 18:10:10 +02:00
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 ScandurraandNathan Sobo 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 ScandurraandNathan Sobo 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 81411b9114 Merge branch 'main' into copilot 2023-03-30 16:57:18 -07: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 cc7c5b416c Add status bar icon reflecting copilot state to Zed status bar 2023-03-29 21:31:33 -07:00
Mikayla Maki 76efab005f WIP 2023-03-29 17:25:41 -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 737e2e1b3c Open symbol outline when clicking on editor breadcrumbs 2023-03-29 15:46:43 -04:00
Antonio Scandurra 49447128a9 Make edits smaller when tab expansion changes on a line 2023-03-29 21:40:37 +02: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
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 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
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
Antonio Scandurra da81ff3295 Optimize CopilotState::text_for_active_completion 2023-03-28 09:42:01 -07:00
Antonio ScandurraandMikayla Maki 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 ScandurraandMikayla Maki 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 5471217089 Use the same serde version across the entire workspace 2023-03-28 09:42:00 -07:00
Nathan Sobo f0992e7d67 Trim empty tokens; copy selected range if non-empty 2023-03-24 17:10:50 -06:00
Nathan Sobo 3dfedd1b21 Merge adjacent chunks with the same highlight name in copied JSON 2023-03-24 16:52:00 -06:00
Nathan Sobo 195215f1e0 Add "editor: copy highlight json" command
Nate needs this to feed to Figma for highlighted code in designs.
2023-03-24 16:37:57 -06:00
Max Brunsfeld 027def6800 Merge branch 'main' into lsp-file-change-notifications 2023-03-24 08:52:43 -07:00
Mikayla Maki e87c3b6dd7 Update element.rs
remove spare parens
2023-03-22 17:05:54 -07:00
Mikayla Maki e729c4ad4f Fix fold indicator offsets 2023-03-22 17:04:52 -07:00
Max Brunsfeld cbeb6e692d Move postage crate version specification to workspace Cargo.toml 2023-03-21 11:26:13 -07:00
Antonio ScandurraandMax Brunsfeld 2893c9bdb7 Don't move up/down by more rows than the requested ones
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-03-21 17:52:53 +01:00
Antonio Scandurra f7cba4cec4 Make Suggestion fields public 2023-03-21 16:51:33 +01:00
Antonio Scandurra ba3913df8c Expose a DisplayMap::replace_suggestion method 2023-03-21 16:41:54 +01:00
Antonio Scandurra 9c8732a355 Integrate SuggestionMap into the rest of DisplayMap 2023-03-21 16:39:02 +01:00