# Introduce \`InlineCompletionProvider\` \(\#9777\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/fb6cff89d77f733c39d6975a6c7b821b45ad71b3)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: fb6cff89d77f733c39d6975a6c7b821b45ad71b3

Requested commit: fb6cff89d77f733c39d6975a6c7b821b45ad71b3

Commit: fb6cff89d77f733c39d6975a6c7b821b45ad71b3

Tree: 4f29d280ff6b157a9243748b02ea78eeaa1b3200

Author: Antonio Scandurra

Committer: GitHub

## Message

````
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>
````

## Parents

- [b8663e56a92b1fb59dd173890fff0f7606f6f9f9](https://git.cafe/gitcafe/zed/commit/b8663e56a92b1fb59dd173890fff0f7606f6f9f9?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/fb6cff89d77f733c39d6975a6c7b821b45ad71b3?format=markdown)
