2024-01-17 23:48:37 +00:00
|
|
|
//! This module contains all actions supported by [`Editor`].
|
|
|
|
use super::*;
|
|
|
|
|
|
|
|
#[derive(PartialEq, Clone, Deserialize, Default)]
|
|
|
|
pub struct SelectNext {
|
|
|
|
#[serde(default)]
|
|
|
|
pub replace_newest: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(PartialEq, Clone, Deserialize, Default)]
|
|
|
|
pub struct SelectPrevious {
|
|
|
|
#[serde(default)]
|
|
|
|
pub replace_newest: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(PartialEq, Clone, Deserialize, Default)]
|
|
|
|
pub struct SelectToBeginningOfLine {
|
|
|
|
#[serde(default)]
|
|
|
|
pub(super) stop_at_soft_wraps: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(PartialEq, Clone, Deserialize, Default)]
|
|
|
|
pub struct MovePageUp {
|
|
|
|
#[serde(default)]
|
|
|
|
pub(super) center_cursor: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(PartialEq, Clone, Deserialize, Default)]
|
|
|
|
pub struct MovePageDown {
|
|
|
|
#[serde(default)]
|
|
|
|
pub(super) center_cursor: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(PartialEq, Clone, Deserialize, Default)]
|
|
|
|
pub struct SelectToEndOfLine {
|
|
|
|
#[serde(default)]
|
|
|
|
pub(super) stop_at_soft_wraps: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(PartialEq, Clone, Deserialize, Default)]
|
|
|
|
pub struct ToggleCodeActions {
|
|
|
|
#[serde(default)]
|
|
|
|
pub deployed_from_indicator: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(PartialEq, Clone, Deserialize, Default)]
|
|
|
|
pub struct ConfirmCompletion {
|
|
|
|
#[serde(default)]
|
|
|
|
pub item_ix: Option<usize>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(PartialEq, Clone, Deserialize, Default)]
|
|
|
|
pub struct ConfirmCodeAction {
|
|
|
|
#[serde(default)]
|
|
|
|
pub item_ix: Option<usize>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(PartialEq, Clone, Deserialize, Default)]
|
|
|
|
pub struct ToggleComments {
|
|
|
|
#[serde(default)]
|
|
|
|
pub advance_downwards: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(PartialEq, Clone, Deserialize, Default)]
|
|
|
|
pub struct FoldAt {
|
|
|
|
pub buffer_row: u32,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(PartialEq, Clone, Deserialize, Default)]
|
|
|
|
pub struct UnfoldAt {
|
|
|
|
pub buffer_row: u32,
|
|
|
|
}
|
editor: Add MoveUpByLines and MoveDownByLines actions (#7208)
This adds four new actions:
- `editor::MoveUpByLines`
- `editor::MoveDownByLines`
- `editor::SelectUpByLines`
- `editor::SelectDownByLines`
They all take a count by which to move the cursor up and down.
(Requested by Adam here:
https://twitter.com/adamwathan/status/1753017094248018302)
Example `keymap.json` entries:
```json
{
"context": "Editor",
"bindings": [
"alt-up": [ "editor::MoveUpByLines", { "lines": 3 } ],
"alt-down": [ "editor::MoveDownByLines", { "lines": 3 } ],
"alt-shift-up": [ "editor::SelectUpByLines", { "lines": 3 } ],
"alt-shift-down": [ "editor::SelectDownByLines", { "lines": 3 } ]
]
}
```
They are *not* bound by default, so as to not conflict with the
`alt-up/down` bindings that already exist.
Release Notes:
- Added four new actions: `editor::MoveUpByLines`,
`editor::MoveDownByLines`, `editor::SelectUpByLines`,
`editor::SelectDownByLines` that can take a line count configuration and
move the cursor up by the count.
### Demo
https://github.com/zed-industries/zed/assets/1185253/e78d4077-5bd5-4d72-a806-67695698af5d
https://github.com/zed-industries/zed/assets/1185253/0b086ec9-eb90-40a2-9009-844a215e6378
2024-02-02 15:48:04 +00:00
|
|
|
|
|
|
|
#[derive(PartialEq, Clone, Deserialize, Default)]
|
|
|
|
pub struct MoveUpByLines {
|
|
|
|
#[serde(default)]
|
|
|
|
pub(super) lines: u32,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(PartialEq, Clone, Deserialize, Default)]
|
|
|
|
pub struct MoveDownByLines {
|
|
|
|
#[serde(default)]
|
|
|
|
pub(super) lines: u32,
|
|
|
|
}
|
|
|
|
#[derive(PartialEq, Clone, Deserialize, Default)]
|
|
|
|
pub struct SelectUpByLines {
|
|
|
|
#[serde(default)]
|
|
|
|
pub(super) lines: u32,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(PartialEq, Clone, Deserialize, Default)]
|
|
|
|
pub struct SelectDownByLines {
|
|
|
|
#[serde(default)]
|
|
|
|
pub(super) lines: u32,
|
|
|
|
}
|
|
|
|
|
2024-03-06 19:16:14 +00:00
|
|
|
#[derive(PartialEq, Clone, Deserialize, Default)]
|
|
|
|
pub struct DuplicateLine {
|
|
|
|
#[serde(default)]
|
|
|
|
pub move_upwards: bool,
|
|
|
|
}
|
|
|
|
|
2024-01-17 23:48:37 +00:00
|
|
|
impl_actions!(
|
|
|
|
editor,
|
|
|
|
[
|
|
|
|
SelectNext,
|
|
|
|
SelectPrevious,
|
|
|
|
SelectToBeginningOfLine,
|
|
|
|
MovePageUp,
|
|
|
|
MovePageDown,
|
|
|
|
SelectToEndOfLine,
|
|
|
|
ToggleCodeActions,
|
|
|
|
ConfirmCompletion,
|
|
|
|
ConfirmCodeAction,
|
|
|
|
ToggleComments,
|
|
|
|
FoldAt,
|
editor: Add MoveUpByLines and MoveDownByLines actions (#7208)
This adds four new actions:
- `editor::MoveUpByLines`
- `editor::MoveDownByLines`
- `editor::SelectUpByLines`
- `editor::SelectDownByLines`
They all take a count by which to move the cursor up and down.
(Requested by Adam here:
https://twitter.com/adamwathan/status/1753017094248018302)
Example `keymap.json` entries:
```json
{
"context": "Editor",
"bindings": [
"alt-up": [ "editor::MoveUpByLines", { "lines": 3 } ],
"alt-down": [ "editor::MoveDownByLines", { "lines": 3 } ],
"alt-shift-up": [ "editor::SelectUpByLines", { "lines": 3 } ],
"alt-shift-down": [ "editor::SelectDownByLines", { "lines": 3 } ]
]
}
```
They are *not* bound by default, so as to not conflict with the
`alt-up/down` bindings that already exist.
Release Notes:
- Added four new actions: `editor::MoveUpByLines`,
`editor::MoveDownByLines`, `editor::SelectUpByLines`,
`editor::SelectDownByLines` that can take a line count configuration and
move the cursor up by the count.
### Demo
https://github.com/zed-industries/zed/assets/1185253/e78d4077-5bd5-4d72-a806-67695698af5d
https://github.com/zed-industries/zed/assets/1185253/0b086ec9-eb90-40a2-9009-844a215e6378
2024-02-02 15:48:04 +00:00
|
|
|
UnfoldAt,
|
|
|
|
MoveUpByLines,
|
|
|
|
MoveDownByLines,
|
|
|
|
SelectUpByLines,
|
2024-03-06 19:16:14 +00:00
|
|
|
SelectDownByLines,
|
|
|
|
DuplicateLine
|
2024-01-17 23:48:37 +00:00
|
|
|
]
|
|
|
|
);
|
|
|
|
|
|
|
|
gpui::actions!(
|
|
|
|
editor,
|
|
|
|
[
|
2024-03-03 16:24:48 +00:00
|
|
|
AcceptPartialCopilotSuggestion,
|
Introduce `InlineCompletionProvider` (#9777)
This pull request introduces a new `InlineCompletionProvider` trait,
which enables making `Editor` copilot-agnostic and lets us push all the
copilot functionality into the `copilot_ui` module. Long-term, I would
like to merge `copilot` and `copilot_ui`, but right now `project`
depends on `copilot`, which makes this impossible.
The reason for adding this new trait is so that we can experiment with
other inline completion providers and swap them at runtime using config
settings.
Please, note also that we renamed some of the existing copilot actions
to be more agnostic (see release notes below). We still kept the old
actions bound for backwards-compatibility, but we should probably remove
them at some later version.
Also, as a drive-by, we added new methods to the `Global` trait that let
you read or mutate a global directly, e.g.:
```rs
MyGlobal::update(cx, |global, cx| {
});
```
Release Notes:
- Renamed the `copilot::Suggest` action to
`editor::ShowInlineCompletion`
- Renamed the `copilot::NextSuggestion` action to
`editor::NextInlineCompletion`
- Renamed the `copilot::PreviousSuggestion` action to
`editor::PreviousInlineCompletion`
- Renamed the `editor::AcceptPartialCopilotSuggestion` action to
`editor::AcceptPartialInlineCompletion`
---------
Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Kyle <kylek@zed.dev>
Co-authored-by: Kyle Kelley <rgbkrk@gmail.com>
2024-03-26 12:28:06 +00:00
|
|
|
AcceptPartialInlineCompletion,
|
2024-01-17 23:48:37 +00:00
|
|
|
AddSelectionAbove,
|
|
|
|
AddSelectionBelow,
|
|
|
|
Backspace,
|
|
|
|
Cancel,
|
|
|
|
ConfirmRename,
|
|
|
|
ContextMenuFirst,
|
|
|
|
ContextMenuLast,
|
|
|
|
ContextMenuNext,
|
|
|
|
ContextMenuPrev,
|
|
|
|
ConvertToKebabCase,
|
|
|
|
ConvertToLowerCamelCase,
|
|
|
|
ConvertToLowerCase,
|
|
|
|
ConvertToSnakeCase,
|
|
|
|
ConvertToTitleCase,
|
|
|
|
ConvertToUpperCamelCase,
|
|
|
|
ConvertToUpperCase,
|
|
|
|
Copy,
|
|
|
|
CopyHighlightJson,
|
|
|
|
CopyPath,
|
2024-01-31 00:20:15 +00:00
|
|
|
CopyPermalinkToLine,
|
2024-01-17 23:48:37 +00:00
|
|
|
CopyRelativePath,
|
|
|
|
Cut,
|
|
|
|
CutToEndOfLine,
|
|
|
|
Delete,
|
|
|
|
DeleteLine,
|
|
|
|
DeleteToBeginningOfLine,
|
|
|
|
DeleteToEndOfLine,
|
|
|
|
DeleteToNextSubwordEnd,
|
|
|
|
DeleteToNextWordEnd,
|
|
|
|
DeleteToPreviousSubwordStart,
|
|
|
|
DeleteToPreviousWordStart,
|
2024-01-25 11:56:12 +00:00
|
|
|
DisplayCursorNames,
|
2024-01-17 23:48:37 +00:00
|
|
|
ExpandMacroRecursively,
|
|
|
|
FindAllReferences,
|
|
|
|
Fold,
|
|
|
|
FoldSelectedRanges,
|
|
|
|
Format,
|
|
|
|
GoToDefinition,
|
|
|
|
GoToDefinitionSplit,
|
|
|
|
GoToDiagnostic,
|
|
|
|
GoToHunk,
|
Introduce `InlineCompletionProvider` (#9777)
This pull request introduces a new `InlineCompletionProvider` trait,
which enables making `Editor` copilot-agnostic and lets us push all the
copilot functionality into the `copilot_ui` module. Long-term, I would
like to merge `copilot` and `copilot_ui`, but right now `project`
depends on `copilot`, which makes this impossible.
The reason for adding this new trait is so that we can experiment with
other inline completion providers and swap them at runtime using config
settings.
Please, note also that we renamed some of the existing copilot actions
to be more agnostic (see release notes below). We still kept the old
actions bound for backwards-compatibility, but we should probably remove
them at some later version.
Also, as a drive-by, we added new methods to the `Global` trait that let
you read or mutate a global directly, e.g.:
```rs
MyGlobal::update(cx, |global, cx| {
});
```
Release Notes:
- Renamed the `copilot::Suggest` action to
`editor::ShowInlineCompletion`
- Renamed the `copilot::NextSuggestion` action to
`editor::NextInlineCompletion`
- Renamed the `copilot::PreviousSuggestion` action to
`editor::PreviousInlineCompletion`
- Renamed the `editor::AcceptPartialCopilotSuggestion` action to
`editor::AcceptPartialInlineCompletion`
---------
Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Kyle <kylek@zed.dev>
Co-authored-by: Kyle Kelley <rgbkrk@gmail.com>
2024-03-26 12:28:06 +00:00
|
|
|
GoToImplementation,
|
|
|
|
GoToImplementationSplit,
|
2024-01-17 23:48:37 +00:00
|
|
|
GoToPrevDiagnostic,
|
|
|
|
GoToPrevHunk,
|
|
|
|
GoToTypeDefinition,
|
|
|
|
GoToTypeDefinitionSplit,
|
|
|
|
HalfPageDown,
|
|
|
|
HalfPageUp,
|
|
|
|
Hover,
|
|
|
|
Indent,
|
|
|
|
JoinLines,
|
|
|
|
LineDown,
|
|
|
|
LineUp,
|
|
|
|
MoveDown,
|
|
|
|
MoveLeft,
|
|
|
|
MoveLineDown,
|
|
|
|
MoveLineUp,
|
|
|
|
MoveRight,
|
|
|
|
MoveToBeginning,
|
|
|
|
MoveToBeginningOfLine,
|
|
|
|
MoveToEnclosingBracket,
|
|
|
|
MoveToEnd,
|
|
|
|
MoveToEndOfLine,
|
|
|
|
MoveToEndOfParagraph,
|
|
|
|
MoveToNextSubwordEnd,
|
|
|
|
MoveToNextWordEnd,
|
|
|
|
MoveToPreviousSubwordStart,
|
|
|
|
MoveToPreviousWordStart,
|
|
|
|
MoveToStartOfParagraph,
|
|
|
|
MoveUp,
|
|
|
|
Newline,
|
|
|
|
NewlineAbove,
|
|
|
|
NewlineBelow,
|
Introduce `InlineCompletionProvider` (#9777)
This pull request introduces a new `InlineCompletionProvider` trait,
which enables making `Editor` copilot-agnostic and lets us push all the
copilot functionality into the `copilot_ui` module. Long-term, I would
like to merge `copilot` and `copilot_ui`, but right now `project`
depends on `copilot`, which makes this impossible.
The reason for adding this new trait is so that we can experiment with
other inline completion providers and swap them at runtime using config
settings.
Please, note also that we renamed some of the existing copilot actions
to be more agnostic (see release notes below). We still kept the old
actions bound for backwards-compatibility, but we should probably remove
them at some later version.
Also, as a drive-by, we added new methods to the `Global` trait that let
you read or mutate a global directly, e.g.:
```rs
MyGlobal::update(cx, |global, cx| {
});
```
Release Notes:
- Renamed the `copilot::Suggest` action to
`editor::ShowInlineCompletion`
- Renamed the `copilot::NextSuggestion` action to
`editor::NextInlineCompletion`
- Renamed the `copilot::PreviousSuggestion` action to
`editor::PreviousInlineCompletion`
- Renamed the `editor::AcceptPartialCopilotSuggestion` action to
`editor::AcceptPartialInlineCompletion`
---------
Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Kyle <kylek@zed.dev>
Co-authored-by: Kyle Kelley <rgbkrk@gmail.com>
2024-03-26 12:28:06 +00:00
|
|
|
NextInlineCompletion,
|
2024-01-17 23:48:37 +00:00
|
|
|
NextScreen,
|
|
|
|
OpenExcerpts,
|
2024-02-29 02:23:36 +00:00
|
|
|
OpenExcerptsSplit,
|
2024-02-08 16:40:38 +00:00
|
|
|
OpenPermalinkToLine,
|
Introduce `InlineCompletionProvider` (#9777)
This pull request introduces a new `InlineCompletionProvider` trait,
which enables making `Editor` copilot-agnostic and lets us push all the
copilot functionality into the `copilot_ui` module. Long-term, I would
like to merge `copilot` and `copilot_ui`, but right now `project`
depends on `copilot`, which makes this impossible.
The reason for adding this new trait is so that we can experiment with
other inline completion providers and swap them at runtime using config
settings.
Please, note also that we renamed some of the existing copilot actions
to be more agnostic (see release notes below). We still kept the old
actions bound for backwards-compatibility, but we should probably remove
them at some later version.
Also, as a drive-by, we added new methods to the `Global` trait that let
you read or mutate a global directly, e.g.:
```rs
MyGlobal::update(cx, |global, cx| {
});
```
Release Notes:
- Renamed the `copilot::Suggest` action to
`editor::ShowInlineCompletion`
- Renamed the `copilot::NextSuggestion` action to
`editor::NextInlineCompletion`
- Renamed the `copilot::PreviousSuggestion` action to
`editor::PreviousInlineCompletion`
- Renamed the `editor::AcceptPartialCopilotSuggestion` action to
`editor::AcceptPartialInlineCompletion`
---------
Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Kyle <kylek@zed.dev>
Co-authored-by: Kyle Kelley <rgbkrk@gmail.com>
2024-03-26 12:28:06 +00:00
|
|
|
OpenUrl,
|
2024-01-17 23:48:37 +00:00
|
|
|
Outdent,
|
|
|
|
PageDown,
|
|
|
|
PageUp,
|
|
|
|
Paste,
|
Introduce `InlineCompletionProvider` (#9777)
This pull request introduces a new `InlineCompletionProvider` trait,
which enables making `Editor` copilot-agnostic and lets us push all the
copilot functionality into the `copilot_ui` module. Long-term, I would
like to merge `copilot` and `copilot_ui`, but right now `project`
depends on `copilot`, which makes this impossible.
The reason for adding this new trait is so that we can experiment with
other inline completion providers and swap them at runtime using config
settings.
Please, note also that we renamed some of the existing copilot actions
to be more agnostic (see release notes below). We still kept the old
actions bound for backwards-compatibility, but we should probably remove
them at some later version.
Also, as a drive-by, we added new methods to the `Global` trait that let
you read or mutate a global directly, e.g.:
```rs
MyGlobal::update(cx, |global, cx| {
});
```
Release Notes:
- Renamed the `copilot::Suggest` action to
`editor::ShowInlineCompletion`
- Renamed the `copilot::NextSuggestion` action to
`editor::NextInlineCompletion`
- Renamed the `copilot::PreviousSuggestion` action to
`editor::PreviousInlineCompletion`
- Renamed the `editor::AcceptPartialCopilotSuggestion` action to
`editor::AcceptPartialInlineCompletion`
---------
Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Kyle <kylek@zed.dev>
Co-authored-by: Kyle Kelley <rgbkrk@gmail.com>
2024-03-26 12:28:06 +00:00
|
|
|
PreviousInlineCompletion,
|
2024-01-17 23:48:37 +00:00
|
|
|
Redo,
|
|
|
|
RedoSelection,
|
|
|
|
Rename,
|
|
|
|
RestartLanguageServer,
|
|
|
|
RevealInFinder,
|
|
|
|
ReverseLines,
|
Introduce `InlineCompletionProvider` (#9777)
This pull request introduces a new `InlineCompletionProvider` trait,
which enables making `Editor` copilot-agnostic and lets us push all the
copilot functionality into the `copilot_ui` module. Long-term, I would
like to merge `copilot` and `copilot_ui`, but right now `project`
depends on `copilot`, which makes this impossible.
The reason for adding this new trait is so that we can experiment with
other inline completion providers and swap them at runtime using config
settings.
Please, note also that we renamed some of the existing copilot actions
to be more agnostic (see release notes below). We still kept the old
actions bound for backwards-compatibility, but we should probably remove
them at some later version.
Also, as a drive-by, we added new methods to the `Global` trait that let
you read or mutate a global directly, e.g.:
```rs
MyGlobal::update(cx, |global, cx| {
});
```
Release Notes:
- Renamed the `copilot::Suggest` action to
`editor::ShowInlineCompletion`
- Renamed the `copilot::NextSuggestion` action to
`editor::NextInlineCompletion`
- Renamed the `copilot::PreviousSuggestion` action to
`editor::PreviousInlineCompletion`
- Renamed the `editor::AcceptPartialCopilotSuggestion` action to
`editor::AcceptPartialInlineCompletion`
---------
Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Kyle <kylek@zed.dev>
Co-authored-by: Kyle Kelley <rgbkrk@gmail.com>
2024-03-26 12:28:06 +00:00
|
|
|
RevertSelectedHunks,
|
2024-01-17 23:48:37 +00:00
|
|
|
ScrollCursorBottom,
|
|
|
|
ScrollCursorCenter,
|
|
|
|
ScrollCursorTop,
|
|
|
|
SelectAll,
|
2024-01-25 11:56:12 +00:00
|
|
|
SelectAllMatches,
|
2024-01-17 23:48:37 +00:00
|
|
|
SelectDown,
|
|
|
|
SelectLargerSyntaxNode,
|
|
|
|
SelectLeft,
|
|
|
|
SelectLine,
|
|
|
|
SelectRight,
|
|
|
|
SelectSmallerSyntaxNode,
|
|
|
|
SelectToBeginning,
|
|
|
|
SelectToEnd,
|
|
|
|
SelectToEndOfParagraph,
|
|
|
|
SelectToNextSubwordEnd,
|
|
|
|
SelectToNextWordEnd,
|
|
|
|
SelectToPreviousSubwordStart,
|
|
|
|
SelectToPreviousWordStart,
|
|
|
|
SelectToStartOfParagraph,
|
|
|
|
SelectUp,
|
|
|
|
ShowCharacterPalette,
|
|
|
|
ShowCompletions,
|
Introduce `InlineCompletionProvider` (#9777)
This pull request introduces a new `InlineCompletionProvider` trait,
which enables making `Editor` copilot-agnostic and lets us push all the
copilot functionality into the `copilot_ui` module. Long-term, I would
like to merge `copilot` and `copilot_ui`, but right now `project`
depends on `copilot`, which makes this impossible.
The reason for adding this new trait is so that we can experiment with
other inline completion providers and swap them at runtime using config
settings.
Please, note also that we renamed some of the existing copilot actions
to be more agnostic (see release notes below). We still kept the old
actions bound for backwards-compatibility, but we should probably remove
them at some later version.
Also, as a drive-by, we added new methods to the `Global` trait that let
you read or mutate a global directly, e.g.:
```rs
MyGlobal::update(cx, |global, cx| {
});
```
Release Notes:
- Renamed the `copilot::Suggest` action to
`editor::ShowInlineCompletion`
- Renamed the `copilot::NextSuggestion` action to
`editor::NextInlineCompletion`
- Renamed the `copilot::PreviousSuggestion` action to
`editor::PreviousInlineCompletion`
- Renamed the `editor::AcceptPartialCopilotSuggestion` action to
`editor::AcceptPartialInlineCompletion`
---------
Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Kyle <kylek@zed.dev>
Co-authored-by: Kyle Kelley <rgbkrk@gmail.com>
2024-03-26 12:28:06 +00:00
|
|
|
ShowInlineCompletion,
|
2024-01-17 23:48:37 +00:00
|
|
|
ShuffleLines,
|
|
|
|
SortLinesCaseInsensitive,
|
|
|
|
SortLinesCaseSensitive,
|
|
|
|
SplitSelectionIntoLines,
|
|
|
|
Tab,
|
|
|
|
TabPrev,
|
|
|
|
ToggleInlayHints,
|
2024-03-01 09:09:21 +00:00
|
|
|
ToggleLineNumbers,
|
Introduce `InlineCompletionProvider` (#9777)
This pull request introduces a new `InlineCompletionProvider` trait,
which enables making `Editor` copilot-agnostic and lets us push all the
copilot functionality into the `copilot_ui` module. Long-term, I would
like to merge `copilot` and `copilot_ui`, but right now `project`
depends on `copilot`, which makes this impossible.
The reason for adding this new trait is so that we can experiment with
other inline completion providers and swap them at runtime using config
settings.
Please, note also that we renamed some of the existing copilot actions
to be more agnostic (see release notes below). We still kept the old
actions bound for backwards-compatibility, but we should probably remove
them at some later version.
Also, as a drive-by, we added new methods to the `Global` trait that let
you read or mutate a global directly, e.g.:
```rs
MyGlobal::update(cx, |global, cx| {
});
```
Release Notes:
- Renamed the `copilot::Suggest` action to
`editor::ShowInlineCompletion`
- Renamed the `copilot::NextSuggestion` action to
`editor::NextInlineCompletion`
- Renamed the `copilot::PreviousSuggestion` action to
`editor::PreviousInlineCompletion`
- Renamed the `editor::AcceptPartialCopilotSuggestion` action to
`editor::AcceptPartialInlineCompletion`
---------
Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Kyle <kylek@zed.dev>
Co-authored-by: Kyle Kelley <rgbkrk@gmail.com>
2024-03-26 12:28:06 +00:00
|
|
|
ToggleSoftWrap,
|
2024-01-17 23:48:37 +00:00
|
|
|
Transpose,
|
|
|
|
Undo,
|
|
|
|
UndoSelection,
|
|
|
|
UnfoldLines,
|
2024-02-08 15:13:15 +00:00
|
|
|
UniqueLinesCaseSensitive,
|
|
|
|
UniqueLinesCaseInsensitive
|
2024-01-17 23:48:37 +00:00
|
|
|
]
|
|
|
|
);
|