clean up merge mess pt 2

pull/6465/head
Anthony Templeton 10 months ago
parent 2b7bbe9479
commit 46686ec3ce

@ -1,4 +1,4 @@
use futures_util::{future::BoxFuture, stream::FuturesUnordered, FutureExt}; use futures_util::{stream::FuturesUnordered, FutureExt};
use helix_lsp::{ use helix_lsp::{
block_on, block_on,
lsp::{ lsp::{
@ -8,23 +8,24 @@ use helix_lsp::{
util::{diagnostic_to_lsp_diagnostic, lsp_range_to_range, range_to_lsp_range}, util::{diagnostic_to_lsp_diagnostic, lsp_range_to_range, range_to_lsp_range},
Client, OffsetEncoding, Client, OffsetEncoding,
}; };
use serde_json::Value;
use tokio_stream::StreamExt; use tokio_stream::StreamExt;
use tui::{ use tui::{
text::{Span, Spans}, text::{Span, Spans},
widgets::Row, widgets::Row,
}; };
use super::{align_view, push_jump, Align, Context, Editor, Open}; use super::{align_view, push_jump, Align, Context, Editor};
use helix_core::{ use helix_core::{
movement::Direction, path, syntax::LanguageServerFeature, text_annotations::InlineAnnotation, movement::Direction, syntax::LanguageServerFeature, text_annotations::InlineAnnotation,
Selection, Selection,
}; };
use helix_stdx::path; use helix_stdx::path;
use helix_view::{ use helix_view::{
document::{DocumentInlayHints, DocumentInlayHintsId, Mode}, document::{DocumentInlayHints, DocumentInlayHintsId},
editor::Action, editor::Action,
graphics::Margin,
handlers::lsp::SignatureHelpInvoked,
theme::Style, theme::Style,
Document, View, Document, View,
}; };
@ -32,10 +33,7 @@ use helix_view::{
use crate::{ use crate::{
compositor::{self, Compositor}, compositor::{self, Compositor},
job::Callback, job::Callback,
ui::{ ui::{self, overlay::overlaid, DynamicPicker, FileLocation, Picker, Popup, PromptEvent},
self, lsp::SignatureHelp, overlay::overlaid, DynamicPicker, FileLocation, Picker, Popup,
PromptEvent,
},
}; };
use std::{ use std::{
@ -44,14 +42,13 @@ use std::{
fmt::Write, fmt::Write,
future::Future, future::Future,
path::PathBuf, path::PathBuf,
sync::Arc,
}; };
/// Gets the first language server that is attached to a document which supports a specific feature. /// Gets the first language server that is attached to a document which supports a specific feature.
/// If there is no configured language server that supports the feature, this displays a status message. /// If there is no configured language server that supports the feature, this displays a status message.
/// Using this macro in a context where the editor automatically queries the LSP /// Using this macro in a context where the editor automatically queries the LSP
/// (instead of when the user explicitly does so via a keybind like `gd`) /// (instead of when the user explicitly does so via a keybind like `gd`)
/// will spam the "No configured language server supports <feature>" status message confusingly. /// will spam the "No configured language server supports \<feature>" status message confusingly.
#[macro_export] #[macro_export]
macro_rules! language_server_with_feature { macro_rules! language_server_with_feature {
($editor:expr, $doc:expr, $feature:expr) => {{ ($editor:expr, $doc:expr, $feature:expr) => {{
@ -897,7 +894,6 @@ pub fn apply_workspace_edit(
} }
}; };
let current_view_id = view!(editor).id;
let doc_id = match editor.open(&path, Action::Load) { let doc_id = match editor.open(&path, Action::Load) {
Ok(doc_id) => doc_id, Ok(doc_id) => doc_id,
Err(err) => { Err(err) => {
@ -1199,12 +1195,6 @@ pub fn goto_reference_direction(cx: &mut Context, direction: Direction) {
); );
} }
#[derive(PartialEq, Eq, Clone, Copy)]
pub enum SignatureHelpInvoked {
Manual,
Automatic,
}
pub fn signature_help(cx: &mut Context) { pub fn signature_help(cx: &mut Context) {
cx.editor cx.editor
.handlers .handlers

Loading…
Cancel
Save