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-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,
|
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-03-28 10:52:08 +00:00
|
|
|
DuplicateLineUp,
|
|
|
|
DuplicateLineDown,
|
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,
|
Add `git blame` (#8889)
This adds a new action to the editor: `editor: toggle git blame`. When
used it turns on a sidebar containing `git blame` information for the
currently open buffer.
The git blame information is updated when the buffer changes. It handles
additions, deletions, modifications, changes to the underlying git data
(new commits, changed commits, ...), file saves. It also handles folding
and wrapping lines correctly.
When the user hovers over a commit, a tooltip displays information for
the commit that introduced the line. If the repository has a remote with
the name `origin` configured, then clicking on a blame entry opens the
permalink to the commit on the code host.
Users can right-click on a blame entry to get a context menu which
allows them to copy the SHA of the commit.
The feature also works on shared projects, e.g. when collaborating a
peer can request `git blame` data.
As of this PR, Zed now comes bundled with a `git` binary so that users
don't have to have `git` installed locally to use this feature.
### Screenshots
![screenshot-2024-03-28-13 57
43@2x](https://github.com/zed-industries/zed/assets/1185253/ee8ec55d-3b5e-4d63-a85a-852da914f5ba)
![screenshot-2024-03-28-14 01
23@2x](https://github.com/zed-industries/zed/assets/1185253/2ba8efd7-e887-4076-a87a-587a732b9e9a)
![screenshot-2024-03-28-14 01
32@2x](https://github.com/zed-industries/zed/assets/1185253/496f4a06-b189-4881-b427-2289ae6e6075)
### TODOs
- [x] Bundling `git` binary
### Release Notes
Release Notes:
- Added `editor: toggle git blame` command that toggles a sidebar with
git blame information for the current buffer.
---------
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Piotr <piotr@zed.dev>
Co-authored-by: Bennet <bennetbo@gmx.de>
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-03-28 17:32:11 +00:00
|
|
|
ToggleGitBlame,
|
2024-01-17 23:48:37 +00:00
|
|
|
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
|
|
|
]
|
|
|
|
);
|