Fix renames over language server for SSH remoting (#17897)

Release Notes:

- ssh remoting: Fix rename over language server

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Max <max@zed.dev>
This commit is contained in:
Conrad Irwin 2024-09-16 16:20:17 -06:00 committed by GitHub
parent 01bb10f518
commit e66ea9e5d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 505 additions and 329 deletions

View file

@ -46,8 +46,8 @@ pub fn lsp_formatting_options(settings: &LanguageSettings) -> lsp::FormattingOpt
}
#[async_trait(?Send)]
pub trait LspCommand: 'static + Sized + Send {
type Response: 'static + Default + Send;
pub trait LspCommand: 'static + Sized + Send + std::fmt::Debug {
type Response: 'static + Default + Send + std::fmt::Debug;
type LspRequest: 'static + Send + lsp::request::Request;
type ProtoRequest: 'static + Send + proto::RequestMessage;
@ -104,72 +104,80 @@ pub trait LspCommand: 'static + Sized + Send {
fn buffer_id_from_proto(message: &Self::ProtoRequest) -> Result<BufferId>;
}
#[derive(Debug)]
pub(crate) struct PrepareRename {
pub position: PointUtf16,
}
#[derive(Debug)]
pub(crate) struct PerformRename {
pub position: PointUtf16,
pub new_name: String,
pub push_to_history: bool,
}
#[derive(Debug)]
pub struct GetDefinition {
pub position: PointUtf16,
}
#[derive(Debug)]
pub(crate) struct GetDeclaration {
pub position: PointUtf16,
}
#[derive(Debug)]
pub(crate) struct GetTypeDefinition {
pub position: PointUtf16,
}
#[derive(Debug)]
pub(crate) struct GetImplementation {
pub position: PointUtf16,
}
#[derive(Debug)]
pub(crate) struct GetReferences {
pub position: PointUtf16,
}
#[derive(Debug)]
pub(crate) struct GetDocumentHighlights {
pub position: PointUtf16,
}
#[derive(Clone)]
#[derive(Clone, Debug)]
pub(crate) struct GetSignatureHelp {
pub position: PointUtf16,
}
#[derive(Clone)]
#[derive(Clone, Debug)]
pub(crate) struct GetHover {
pub position: PointUtf16,
}
#[derive(Debug)]
pub(crate) struct GetCompletions {
pub position: PointUtf16,
pub context: CompletionContext,
}
#[derive(Clone)]
#[derive(Clone, Debug)]
pub(crate) struct GetCodeActions {
pub range: Range<Anchor>,
pub kinds: Option<Vec<lsp::CodeActionKind>>,
}
#[derive(Debug)]
pub(crate) struct OnTypeFormatting {
pub position: PointUtf16,
pub trigger: String,
pub options: lsp::FormattingOptions,
pub push_to_history: bool,
}
#[derive(Debug)]
pub(crate) struct InlayHints {
pub range: Range<Anchor>,
}
#[derive(Debug)]
pub(crate) struct LinkedEditingRange {
pub position: Anchor,
}