Update All Top Ranking Issues / update_top_ranking_issues (push) Has been cancelled
release_nightly / notify_on_failure (push) Has been cancelled
release_nightly / check_style (push) Has been cancelled
release_nightly / run_tests_windows (push) Has been cancelled
release_nightly / clippy_windows (push) Has been cancelled
release_nightly / bundle_linux_aarch64 (push) Has been cancelled
release_nightly / bundle_linux_x86_64 (push) Has been cancelled
release_nightly / bundle_mac_aarch64 (push) Has been cancelled
release_nightly / bundle_mac_x86_64 (push) Has been cancelled
release_nightly / bundle_windows_aarch64 (push) Has been cancelled
release_nightly / bundle_windows_x86_64 (push) Has been cancelled
release_nightly / build_nix_mac_aarch64 (push) Has been cancelled
release_nightly / update_nightly_tag (push) Has been cancelled
Hotfix Review Monitor / check-hotfix-reviews (push) Has been cancelled
Stale PR Review Reminder / check-stale-prs (push) Has been cancelled
Update Weekly Top Ranking Issues / update_top_ranking_issues (push) Has been cancelled
Triage Project Sync (#84) / Sync triage project (push) Has been cancelled
release_nightly / build_nix_linux_x86_64 (push) Has been cancelled
Bump collab-staging Tag / update-collab-staging-tag (push) Has been cancelled
compliance_check / scheduled_compliance_check (push) Has been cancelled
Single-commit orphan branch: full zed-industries/zed @ 8c74db0 source tree with a 3-file patch applied (no upstream history). Patch (crates/gpui_linux/src/linux/wayland/): - serial.rs: add SerialKind::KeyboardEnter - client.rs: store wl_keyboard.enter serial; add latest_serial_of() - window.rs: activate() uses keyboard-enter serial (Mutter focus gate) Mutter honors window activation only when the token carries the keyboard- focus serial from wl_keyboard.enter; GPUI used a stale mouse-press serial. See docs/tray-window-focus-wayland.md in logiguard. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
300 lines
7.5 KiB
Rust
300 lines
7.5 KiB
Rust
use lsp::{Uri, VersionedTextDocumentIdentifier};
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
pub enum CheckStatus {}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct CheckStatusParams {
|
|
pub local_checks_only: bool,
|
|
}
|
|
|
|
impl lsp::request::Request for CheckStatus {
|
|
type Params = CheckStatusParams;
|
|
type Result = SignInStatus;
|
|
const METHOD: &'static str = "checkStatus";
|
|
}
|
|
|
|
pub enum SignIn {}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub struct SignInParams {}
|
|
|
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct PromptUserDeviceFlow {
|
|
pub user_code: String,
|
|
pub command: lsp::Command,
|
|
}
|
|
|
|
impl lsp::request::Request for SignIn {
|
|
type Params = SignInParams;
|
|
type Result = PromptUserDeviceFlow;
|
|
const METHOD: &'static str = "signIn";
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
#[serde(tag = "status")]
|
|
pub enum SignInStatus {
|
|
#[serde(rename = "OK")]
|
|
Ok {
|
|
user: Option<String>,
|
|
},
|
|
MaybeOk {
|
|
user: String,
|
|
},
|
|
AlreadySignedIn {
|
|
user: String,
|
|
},
|
|
NotAuthorized {
|
|
user: String,
|
|
},
|
|
NotSignedIn,
|
|
}
|
|
|
|
pub enum SignOut {}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct SignOutParams {}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct SignOutResult {}
|
|
|
|
impl lsp::request::Request for SignOut {
|
|
type Params = SignOutParams;
|
|
type Result = SignOutResult;
|
|
const METHOD: &'static str = "signOut";
|
|
}
|
|
|
|
pub enum DidChangeStatus {}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub struct DidChangeStatusParams {
|
|
#[serde(default)]
|
|
pub message: Option<String>,
|
|
pub kind: StatusKind,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
|
pub enum StatusKind {
|
|
Normal,
|
|
Error,
|
|
Warning,
|
|
Inactive,
|
|
}
|
|
|
|
impl lsp::notification::Notification for DidChangeStatus {
|
|
type Params = DidChangeStatusParams;
|
|
const METHOD: &'static str = "didChangeStatus";
|
|
}
|
|
|
|
pub enum SetEditorInfo {}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct SetEditorInfoParams {
|
|
pub editor_info: EditorInfo,
|
|
pub editor_plugin_info: EditorPluginInfo,
|
|
}
|
|
|
|
impl lsp::request::Request for SetEditorInfo {
|
|
type Params = SetEditorInfoParams;
|
|
type Result = String;
|
|
const METHOD: &'static str = "setEditorInfo";
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct EditorInfo {
|
|
pub name: String,
|
|
pub version: String,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct EditorPluginInfo {
|
|
pub name: String,
|
|
pub version: String,
|
|
}
|
|
|
|
pub enum NotifyAccepted {}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct NotifyAcceptedParams {
|
|
pub uuid: String,
|
|
}
|
|
|
|
impl lsp::request::Request for NotifyAccepted {
|
|
type Params = NotifyAcceptedParams;
|
|
type Result = String;
|
|
const METHOD: &'static str = "notifyAccepted";
|
|
}
|
|
|
|
pub enum NotifyRejected {}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct NotifyRejectedParams {
|
|
pub uuids: Vec<String>,
|
|
}
|
|
|
|
impl lsp::request::Request for NotifyRejected {
|
|
type Params = NotifyRejectedParams;
|
|
type Result = String;
|
|
const METHOD: &'static str = "notifyRejected";
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct NextEditSuggestions;
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct NextEditSuggestionsParams {
|
|
pub(crate) text_document: VersionedTextDocumentIdentifier,
|
|
pub(crate) position: lsp::Position,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct NextEditSuggestion {
|
|
pub text: String,
|
|
pub text_document: VersionedTextDocumentIdentifier,
|
|
pub range: lsp::Range,
|
|
pub command: Option<lsp::Command>,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct NextEditSuggestionsResult {
|
|
pub edits: Vec<NextEditSuggestion>,
|
|
}
|
|
|
|
impl lsp::request::Request for NextEditSuggestions {
|
|
type Params = NextEditSuggestionsParams;
|
|
type Result = NextEditSuggestionsResult;
|
|
|
|
const METHOD: &'static str = "textDocument/copilotInlineEdit";
|
|
}
|
|
|
|
pub(crate) struct DidFocus;
|
|
|
|
#[derive(Serialize, Deserialize)]
|
|
pub(crate) struct DidFocusParams {
|
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
pub(crate) uri: Option<Uri>,
|
|
}
|
|
|
|
impl lsp::notification::Notification for DidFocus {
|
|
type Params = DidFocusParams;
|
|
const METHOD: &'static str = "textDocument/didFocus";
|
|
}
|
|
|
|
pub(crate) struct DidShowInlineEdit;
|
|
|
|
#[derive(Serialize, Deserialize)]
|
|
pub(crate) struct DidShowInlineEditParams {
|
|
pub(crate) item: serde_json::Value,
|
|
}
|
|
|
|
impl lsp::notification::Notification for DidShowInlineEdit {
|
|
type Params = DidShowInlineEditParams;
|
|
const METHOD: &'static str = "textDocument/didShowInlineEdit";
|
|
}
|
|
|
|
// Inline Completions (non-NES) - textDocument/inlineCompletion
|
|
|
|
pub enum InlineCompletions {}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct InlineCompletionsParams {
|
|
pub text_document: VersionedTextDocumentIdentifier,
|
|
pub position: lsp::Position,
|
|
pub context: InlineCompletionContext,
|
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
pub formatting_options: Option<FormattingOptions>,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct InlineCompletionContext {
|
|
pub trigger_kind: InlineCompletionTriggerKind,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Copy)]
|
|
pub enum InlineCompletionTriggerKind {
|
|
Invoked = 1,
|
|
Automatic = 2,
|
|
}
|
|
|
|
impl Serialize for InlineCompletionTriggerKind {
|
|
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
|
where
|
|
S: serde::Serializer,
|
|
{
|
|
serializer.serialize_u8(*self as u8)
|
|
}
|
|
}
|
|
|
|
impl<'de> Deserialize<'de> for InlineCompletionTriggerKind {
|
|
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
|
where
|
|
D: serde::Deserializer<'de>,
|
|
{
|
|
let value = u8::deserialize(deserializer)?;
|
|
match value {
|
|
1 => Ok(InlineCompletionTriggerKind::Invoked),
|
|
2 => Ok(InlineCompletionTriggerKind::Automatic),
|
|
_ => Err(serde::de::Error::custom("invalid trigger kind")),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct FormattingOptions {
|
|
pub tab_size: u32,
|
|
pub insert_spaces: bool,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct InlineCompletionsResult {
|
|
pub items: Vec<InlineCompletionItem>,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct InlineCompletionItem {
|
|
pub insert_text: String,
|
|
pub range: lsp::Range,
|
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
pub command: Option<lsp::Command>,
|
|
}
|
|
|
|
impl lsp::request::Request for InlineCompletions {
|
|
type Params = InlineCompletionsParams;
|
|
type Result = InlineCompletionsResult;
|
|
|
|
const METHOD: &'static str = "textDocument/inlineCompletion";
|
|
}
|
|
|
|
// Telemetry notifications for inline completions
|
|
|
|
pub(crate) struct DidShowCompletion;
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub(crate) struct DidShowCompletionParams {
|
|
pub(crate) item: InlineCompletionItem,
|
|
}
|
|
|
|
impl lsp::notification::Notification for DidShowCompletion {
|
|
type Params = DidShowCompletionParams;
|
|
const METHOD: &'static str = "textDocument/didShowCompletion";
|
|
}
|