use super::*;
mod breadcrumbs;
mod capabilities;
mod code_actions;
mod code_lens;
mod decorations;
mod format;
mod go_to_symbol;
mod hierarchy;
mod hover_text;
mod inlay_hints;
mod messages;
mod navigation;
mod outline;
mod peek;
mod rename;
mod rust_analyzer;
mod selection;
mod semantic;
mod sync;
mod typing;
mod workspace_edits;
mod workspace_symbols;
#[cfg(test)]
pub(super) use breadcrumbs::breadcrumb_symbol_chain;
#[cfg(test)]
pub(super) use breadcrumbs::sibling_symbols;
pub(super) use hover_text::compose_hover;
pub(super) use hover_text::format_diagnostics;
pub(super) use outline::syntax_kind_of;
#[cfg(test)]
pub(super) use peek::peek_excerpt;
#[cfg(test)]
pub(super) use semantic::semantic_reply_is_current;
pub(super) use sync::just_installed_covers_path;
pub(super) use sync::store_diagnostics_update;
pub(super) use sync::tool_on_path;
use sync::*;
pub(super) use typing::is_signature_help_trigger;
pub(super) use typing::snippet_completion_item;
#[derive(Clone, Debug, PartialEq, Eq)]
pub(super) struct CaretSpot {
pub(super) path: PathBuf,
pub(super) row: usize,
pub(super) col: usize,
pub(super) seq: u64,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub(super) struct FileRequest {
pub(super) id: u64,
pub(super) path: PathBuf,
pub(super) seq: u64,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub(super) struct CaretRequest {
pub(super) id: u64,
pub(super) at: CaretSpot,
}
pub(super) fn take_reply<T>(
pending: &mut Option<u64>,
mut next: impl FnMut() -> Option<T>,
id: impl Fn(&T) -> u64,
) -> Option<T> {
let mut reply = None;
while let Some(candidate) = next() {
if Some(id(&candidate)) == *pending {
reply = Some(candidate);
}
}
if reply.is_some() {
*pending = None;
}
reply
}
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub(super) enum OnTypeReply {
NotOurs,
Stale,
Apply,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub(super) enum CrumbTarget {
Folder(PathBuf),
File(PathBuf),
Symbol(usize),
}
pub(super) type OutlineKey = (PathBuf, Option<u64>);
pub(super) type OutlineParse = crate::jobs::Job<Vec<crate::lsp::manager::OutlineSymbol>>;
pub(super) type PeekLocation = (PathBuf, u32, u32);
pub(super) const CODE_LENS_SETTLE: std::time::Duration = std::time::Duration::from_millis(600);
pub(super) const STICKY_SCROLL_MAX: usize = 5;
pub(super) const BASH_SERVER: &str = "bash-language-server";
pub(super) const SHFMT_MISSING: &str =
"Not formatted: bash-language-server formats shell scripts with shfmt, which is not on PATH";
pub(super) const SHELLCHECK_MISSING: &str = "Shell scripts are not linted: bash-language-server lints with shellcheck, which is not on PATH";
pub(super) const LSP_PAUSED_FOR_BUILD: &str =
"Language servers are stopped while croft builds its update; they restart when it finishes";
pub(super) const OUTLINE_INLINE_MAX_BYTES: usize = 64 * 1024;
pub(super) const HOVER_DIVIDER: &str = "────────";
pub(super) const NO_HOVER_AT_CARET: &str = "No hover information at the caret";