Skip to main content

AsyncMessage

Enum AsyncMessage 

Source
pub enum AsyncMessage {
Show 51 variants RemoteAttachReady(RemoteAttachReady), RemoteAttachFailed { error: String, request_id: u64, }, LspDiagnostics { uri: String, diagnostics: Vec<Diagnostic>, server_name: String, }, LspInitialized { language: String, server_name: String, capabilities: ServerCapabilitySummary, }, LspError { language: String, error: String, stderr_log_path: Option<PathBuf>, }, LspCompletion { request_id: u64, items: Vec<CompletionItem>, }, LspGotoDefinition { request_id: u64, locations: Vec<Location>, }, LspRename { request_id: u64, result: Result<WorkspaceEdit, String>, }, LspHover { request_id: u64, contents: String, is_markdown: bool, range: Option<((u32, u32), (u32, u32))>, }, LspReferences { request_id: u64, locations: Vec<Location>, }, LspSignatureHelp { request_id: u64, signature_help: Option<SignatureHelp>, }, LspCodeActions { request_id: u64, actions: Vec<CodeActionOrCommand>, }, LspCompletionResolved { request_id: u64, item: Result<CompletionItem, String>, }, LspFormatting { request_id: u64, uri: String, edits: Vec<TextEdit>, }, LspPrepareRename { request_id: u64, result: Result<Value, String>, }, LspPulledDiagnostics { request_id: u64, uri: String, result_id: Option<String>, diagnostics: Vec<Diagnostic>, unchanged: bool, }, LspInlayHints { request_id: u64, uri: String, hints: Vec<InlayHint>, }, LspFoldingRanges { request_id: u64, uri: String, ranges: Vec<FoldingRange>, }, LspSemanticTokens { request_id: u64, uri: String, response: LspSemanticTokensResponse, }, LspServerQuiescent { language: String, }, LspDiagnosticRefresh { language: String, }, LspInlayHintRefresh { language: String, }, LspSemanticTokensRefresh { language: String, }, LspDynamicCapabilities { language: String, server_name: String, register: bool, registrations: Vec<(String, Option<Value>)>, }, FileChanged { path: String, }, GitStatusChanged { status: String, }, FileExplorerInitialized { window: WindowId, view: FileTreeView, }, FileExplorerToggleNode(NodeId), FileExplorerRefreshNode(NodeId), FileExplorerExpandedToPath { window: WindowId, view: FileTreeView, }, Plugin(PluginAsyncMessage), FileOpenDirectoryLoaded(Result<Vec<DirEntry>>), FileOpenShortcutsLoaded(Vec<NavigationShortcut>), TerminalOutput { terminal: WindowTerminalId, }, ClipboardPasteResult { request_id: u64, text: Option<String>, }, PathChanged { handle: u64, path: PathBuf, kind: PathChangeKind, }, TerminalExited { terminal: WindowTerminalId, exit_code: Option<i32>, }, LspProgress { language: String, token: String, value: LspProgressValue, }, LspWindowMessage { language: String, message_type: LspMessageType, message: String, }, LspLogMessage { language: String, message_type: LspMessageType, message: String, }, LspApplyEdit { edit: WorkspaceEdit, label: Option<String>, }, LspCodeActionResolved { request_id: u64, action: Result<CodeAction, String>, }, LspServerRequest { language: String, server_command: String, method: String, params: Option<Value>, }, PluginLspResponse { language: String, request_id: u64, result: Result<Value, String>, }, PluginProcessOutput { process_id: u64, stdout: String, stderr: String, exit_code: i32, }, LspStatusUpdate { language: String, server_name: String, status: LspServerStatus, message: Option<String>, }, GrammarRegistryBuilt { registry: Arc<GrammarRegistry>, callback_ids: Vec<JsCallbackId>, }, QuickOpenFilesLoaded { cwd: String, files: Arc<Vec<FileEntry>>, complete: bool, }, PluginsDirLoaded { dir: PathBuf, errors: Vec<String>, discovered_plugins: HashMap<String, PluginConfig>, }, PluginDeclarationsReady { declarations: Vec<(String, String)>, }, PluginInitScriptLoaded(PluginInitScriptOutcome),
}
Expand description

Messages sent from async tasks to the synchronous main loop

Variants§

§

RemoteAttachReady(RemoteAttachReady)

An async attachRemoteAgent connect succeeded — install the authority + keepalive and restart.

§

RemoteAttachFailed

An async attachRemoteAgent connect failed — reject the plugin’s promise with error (the plugin shows it and creates no window); the editor stays on its current authority.

Fields

§error: String
§request_id: u64
§

LspDiagnostics

LSP diagnostics received for a file

Fields

§diagnostics: Vec<Diagnostic>
§server_name: String

Name of the server that sent these diagnostics (for per-server tracking)

§

LspInitialized

LSP server initialized successfully

Fields

§language: String
§server_name: String

Name of the specific server (for per-server capability tracking)

§capabilities: ServerCapabilitySummary

Capabilities reported by this server

§

LspError

LSP server crashed or failed

Fields

§language: String
§error: String
§stderr_log_path: Option<PathBuf>

Path to the stderr log file for this LSP session

§

LspCompletion

LSP completion response

Fields

§request_id: u64
§

LspGotoDefinition

LSP go-to-definition response

Fields

§request_id: u64
§locations: Vec<Location>
§

LspRename

LSP rename response

Fields

§request_id: u64
§

LspHover

LSP hover response

Fields

§request_id: u64
§contents: String

Hover contents as a single string (joined if multiple parts)

§is_markdown: bool

Whether the content is markdown (true) or plaintext (false)

§range: Option<((u32, u32), (u32, u32))>

Optional range of the symbol that was hovered over (LSP line/character positions) Used to highlight the hovered symbol

§

LspReferences

LSP find references response

Fields

§request_id: u64
§locations: Vec<Location>
§

LspSignatureHelp

LSP signature help response

Fields

§request_id: u64
§signature_help: Option<SignatureHelp>
§

LspCodeActions

LSP code actions response

Fields

§request_id: u64
§

LspCompletionResolved

LSP completionItem/resolve response

Fields

§request_id: u64
§

LspFormatting

LSP textDocument/formatting response

Fields

§request_id: u64
§edits: Vec<TextEdit>
§

LspPrepareRename

LSP textDocument/prepareRename response

Fields

§request_id: u64
§

LspPulledDiagnostics

LSP pulled diagnostics response (textDocument/diagnostic)

Fields

§request_id: u64
§result_id: Option<String>

New result_id for incremental updates (None if server doesn’t support)

§diagnostics: Vec<Diagnostic>

Diagnostics (empty if unchanged)

§unchanged: bool

True if diagnostics haven’t changed since previous_result_id

§

LspInlayHints

LSP inlay hints response (textDocument/inlayHint)

Fields

§request_id: u64
§hints: Vec<InlayHint>

Inlay hints for the requested range

§

LspFoldingRanges

LSP folding ranges response (textDocument/foldingRange)

Fields

§request_id: u64
§

LspSemanticTokens

LSP semantic tokens response (full, full/delta, or range)

Fields

§request_id: u64
§

LspServerQuiescent

LSP server status became quiescent (project fully loaded) This is a rust-analyzer specific notification (experimental/serverStatus)

Fields

§language: String
§

LspDiagnosticRefresh

LSP server requests diagnostic refresh (workspace/diagnostic/refresh) Client should re-pull diagnostics for all open documents

Fields

§language: String
§

LspInlayHintRefresh

LSP server requests an inlay-hint refresh (workspace/inlayHint/refresh). Client should re-pull inlay hints for all open documents — used when the server learns more later (e.g. a change in file A alters inferred types in file B, which the user never edited so was never otherwise re-pulled).

Fields

§language: String
§

LspSemanticTokensRefresh

LSP server requests a semantic-tokens refresh (workspace/semanticTokens/refresh). Client should re-pull semantic tokens for all open documents.

Fields

§language: String
§

LspDynamicCapabilities

LSP server registered (client/registerCapability) or unregistered (client/unregisterCapability) one or more capabilities dynamically. Many servers advertise little or nothing statically in their initialize result and instead register providers afterwards, so these must update the stored ServerCapabilities or the features stay gated off for the whole session. register == false means unregister. Each entry is (method, register_options).

Fields

§language: String
§server_name: String
§register: bool
§registrations: Vec<(String, Option<Value>)>
§

FileChanged

File changed externally (future: file watching)

Fields

§path: String
§

GitStatusChanged

Git status updated (future: git integration)

Fields

§status: String
§

FileExplorerInitialized

File explorer initialized with tree view. Carries the id of the window that requested it: a background preview/materialize can init a non-active window’s explorer, so the view must land on that window — applying it to whatever is active would clobber an unrelated explorer.

Fields

§window: WindowId
§

FileExplorerToggleNode(NodeId)

File explorer node toggle completed

§

FileExplorerRefreshNode(NodeId)

File explorer node refresh completed

§

FileExplorerExpandedToPath

File explorer expand to path completed. Carries the requesting window id (see FileExplorerInitialized) so the expanded view returns to its own window rather than the active one.

Fields

§window: WindowId
§

Plugin(PluginAsyncMessage)

Plugin-related async messages

§

FileOpenDirectoryLoaded(Result<Vec<DirEntry>>)

File open dialog: directory listing completed

§

FileOpenShortcutsLoaded(Vec<NavigationShortcut>)

File open dialog: async shortcuts (Windows drive letters) loaded

§

TerminalOutput

Terminal output received (triggers redraw). Tagged with the owning window: terminal ids are only unique within a window, so a bare id can’t be attributed to a session without guessing.

Fields

§

ClipboardPasteResult

Result of an asynchronous system-clipboard read. The main loop blocks input dispatch while a paste is in flight; the matching request_id ensures a late result that arrived after the timeout fallback fired is discarded as stale. text is None when the read errored, returned empty, or was cancelled by the deadline.

Fields

§request_id: u64
§

PathChanged

File watcher delivered an event for a path under a WatchPath-registered watcher. Routed to the path_changed plugin hook by the main loop.

Fields

§handle: u64

Watch handle the event came from (matches the value returned by WatchPath).

§path: PathBuf
§kind: PathChangeKind

Conservative bucketing of notify::EventKind.

§

TerminalExited

Terminal process exited.

exit_code is None when the editor cannot determine a status (the wait happens in a separate thread, signal exits, kill before wait, etc.). Populated end-to-end is a follow-up; the initial wiring sends None so plugin handlers see the variant shape that matches HookArgs::TerminalExited.

Fields

§exit_code: Option<i32>
§

LspProgress

LSP progress notification ($/progress)

Fields

§language: String
§token: String
§

LspWindowMessage

LSP window message (window/showMessage)

Fields

§language: String
§message_type: LspMessageType
§message: String
§

LspLogMessage

LSP log message (window/logMessage)

Fields

§language: String
§message_type: LspMessageType
§message: String
§

LspApplyEdit

LSP workspace/applyEdit (server -> client request) Server asks client to apply a workspace edit (during executeCommand, etc.)

Fields

§

LspCodeActionResolved

LSP codeAction/resolve response

Fields

§request_id: u64
§

LspServerRequest

LSP server request (server -> client) Used for custom/extension methods that plugins can handle

Fields

§language: String
§server_command: String
§method: String
§params: Option<Value>
§

PluginLspResponse

Response for a plugin-initiated LSP request

Fields

§language: String
§request_id: u64
§

PluginProcessOutput

Plugin process completed with output

Fields

§process_id: u64

Unique ID for this process (to match with callback)

§stdout: String

Standard output

§stderr: String

Standard error

§exit_code: i32

Exit code

§

LspStatusUpdate

LSP server status update (progress, messages, etc.)

Fields

§language: String
§server_name: String

Name of the specific server (for multi-server status tracking)

§message: Option<String>
§

GrammarRegistryBuilt

Background grammar build completed — swap in the new registry. callback_ids contains plugin callbacks to resolve (empty for the initial startup build).

Fields

§callback_ids: Vec<JsCallbackId>
§

QuickOpenFilesLoaded

Quick Open file list loaded by a background task. complete is true when the scan is finished, false for incremental partial updates sent while the walk is still in progress.

Fields

§cwd: String

The working directory the files were enumerated under. Lets the editor drop results that arrive after the user has switched windows/projects (the cache is keyed by cwd).

§complete: bool
§

PluginsDirLoaded

Startup-async: a single plugin directory finished loading on the plugin thread. Carries the same payload as the blocking load_plugins_from_dir_with_config return value.

Fields

§errors: Vec<String>
§discovered_plugins: HashMap<String, PluginConfig>
§

PluginDeclarationsReady

Startup-async: every directory in the startup batch has loaded and the resulting .d.ts declarations have been collected from the plugin runtime. Triggers init_script::write_plugin_declarations.

Fields

§declarations: Vec<(String, String)>
§

PluginInitScriptLoaded(PluginInitScriptOutcome)

Startup-async: init.ts (auto-loaded source plugin) finished running its top level and has either succeeded, failed, or was skipped/fused. The handler logs and applies the corresponding status message, and (on Loaded) clears the crash fuse.

Trait Implementations§

Source§

impl Debug for AsyncMessage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, T> FromIn<'a, T> for T

Source§

fn from_in(t: T, _: &'a Allocator) -> T

Converts to this type from the input type within the given allocator.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<'a, T, U> IntoIn<'a, U> for T
where U: FromIn<'a, T>,

Source§

fn into_in(self, allocator: &'a Allocator) -> U

Converts this type into the (usually inferred) input type within the given allocator.
Source§

impl<D> OwoColorize for D

Source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
Source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
Source§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
Source§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
Source§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
Source§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
Source§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
Source§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
Source§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
Source§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
Source§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
Source§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
Source§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
Source§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
Source§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
Source§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
Source§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
Source§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
Source§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
Source§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
Source§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
Source§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
Source§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
Source§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
Source§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
Source§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
Source§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
Source§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
Source§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
Source§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
Source§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
Source§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
Source§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
Source§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
Source§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
Source§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
Source§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
Source§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
Source§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
Source§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
Source§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
Source§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
Source§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
Source§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
Source§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
Source§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
Source§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
Source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
Source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
Source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
Source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
Source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
Source§

impl<T> ParallelSend for T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more