Consolidate logic for completion alongside code actions in Project

This way, completions are dealt with more consistently with code actions,
and the logic is not spread across so many places. The `language::File`
trait and the multibuffer no longer need to deal with completions. Completions
are no longer generic over an anchor type.
This commit is contained in:
Max Brunsfeld 2022-02-08 14:24:45 -08:00
parent 722c84c976
commit 93bcde953c
12 changed files with 324 additions and 402 deletions

View file

@ -145,7 +145,12 @@ impl ProjectDiagnosticsEditor {
let excerpts = cx.add_model(|cx| MultiBuffer::new(project.read(cx).replica_id()));
let build_settings = editor::settings_builder(excerpts.downgrade(), settings.clone());
let editor = cx.add_view(|cx| {
let mut editor = Editor::for_buffer(excerpts.clone(), build_settings.clone(), cx);
let mut editor = Editor::for_buffer(
excerpts.clone(),
build_settings.clone(),
Some(workspace.clone()),
cx,
);
editor.set_vertical_scroll_margin(5, cx);
editor
});