Skip to main content

Backend

Struct Backend 

Source
pub(crate) struct Backend {
    pub(crate) client: Client,
    pub(crate) state: Arc<RwLock<State>>,
}

Fields§

§client: Client§state: Arc<RwLock<State>>

Implementations§

Source§

impl Backend

Source

pub(crate) fn new(client: Client) -> Self

Source

pub(crate) fn find_project_root(start: &Path) -> Option<PathBuf>

Locate bynk.toml walking upward from the given path. Returns the project root (the directory containing bynk.toml) on success.

Source

pub(crate) async fn recompile_and_publish(&self, uri: &Url)

Re-run the compiler on the document at uri and publish diagnostics. Best-effort: a malformed file produces diagnostics rather than a hard failure.

Source

pub(crate) async fn schedule_project_diagnostics(&self)

v0.24: debounce a project-wide analysis — each call bumps the generation; the spawned task runs only if still the latest after the delay, so a typing burst produces one analysis.

Source

pub(crate) async fn run_project_diagnostics(&self)

v0.24 (ADR 0052): one project-wide diagnostics round — overlay the open buffers over disk, analyse off the async runtime, convert spans against the analysed snapshots, and publish via the pure publish-plan (clears included).

Source

pub(crate) async fn project_src_root(&self) -> Option<PathBuf>

Project source root resolved against the active bynk.toml’s [paths].src. Returns None when no project root is known (single- file mode), in which case cross-file lookups are skipped.

Source

pub(crate) fn local_sites( &self, analysis: &Analysis, rel: &Path, offset: usize, ) -> Option<Vec<Span>>

v0.31: the def + use spans of the local under the cursor (def first), or None if the cursor is not on a local.

Source

pub(crate) async fn locals_completions( &self, uri: &Url, pos: Position, ) -> Vec<CompletionItem>

v0.31 (ADR 0064): the in-scope local bindings at the cursor, as variable completions, read from the cached analysis — so they survive the mid-edit buffer the current keystroke produced (the last good round’s bindings around the cursor are what’s wanted). Positions convert against the cached snapshot, like the other cached-round reads.

Source

pub(crate) fn local_locations( &self, analysis: &Analysis, rel: &Path, spans: &[Span], ) -> Vec<Location>

Convert same-file local spans to LSP Locations.

Source

pub(crate) async fn value_member_completions( &self, uri: &Url, text: &str, offset: usize, ) -> Vec<CompletionItem>

Slice 3 (ADR 0063): complete the members of a typed value receiver. Re-analyses the buffer rewritten so the receiver parses (the trailing .partial dropped), types the receiver via the retained expr_types, and maps its type to kernel methods + record fields. Empty when the receiver can’t be typed (the file has errors — the clean-file ceiling).

Source

pub(crate) async fn type_receiver( &self, uri: &Url, rewritten: String, recv_offset: usize, ) -> Option<Ty>

v0.32 (ADR 0065): the type of a receiver expression at recv_offset in a buffer rewritten so it parses — re-analyse the overlay and query the retained expr_types. Shared by value-member completion and signature help; None when the file doesn’t check clean (the clean-file ceiling).

Source

pub(crate) async fn ensure_analysis(&self) -> Option<Arc<Analysis>>

v0.25: the latest analysis, running one synchronously if none has completed yet (a request can arrive before the first debounced round).

Source

pub(crate) async fn fresh_analysis(&self) -> Option<Arc<Analysis>>

v0.25: a fresh analysis of the current buffers — rename plans against live state, not the last debounced round.

Source

pub(crate) fn uri_to_rel(analysis: &Analysis, uri: &Url) -> Option<PathBuf>

Map a request URI to the analysis’ project-relative path.

Source

pub(crate) async fn unit_reference_definition( &self, uri: &Url, pos: Position, ) -> Option<Location>

Slice 6a follow-up (ADR 0095): if pos sits on a uses/consumes unit name, the location of that unit’s source (its first file, at the top — units aren’t index symbols, so there is no finer def span to land on). Spans come from the live buffer; the target from the round’s unit→source map. None for a first-party/unresolved unit or a non-unit position.

Source

pub(crate) fn site_to_location( analysis: &Analysis, site: &SiteRef, ) -> Option<Location>

Convert an index site to an LSP location, spans against the analysed snapshot (v0.24 rule).

Source

pub(crate) fn call_hierarchy_item( analysis: &Analysis, key: &SymbolKey, def: &SiteRef, ) -> Option<CallHierarchyItem>

v0.34 (ADR 0067): build a CallHierarchyItem for an index symbol from its key + definition site. The key is round-tripped through data so the incoming/outgoing follow-ups resolve straight off it, never re-inferring from a position.

Source

pub(crate) fn call_ranges(analysis: &Analysis, sites: &[&SiteRef]) -> Vec<Range>

The call-site ranges (fromRanges) for a call relation, each converted against its file’s analysed snapshot.

Source

pub(crate) async fn semantic_tokens_for( &self, uri: &Url, range: Option<Range>, ) -> Vec<SemanticToken>

v0.28 (ADR 0057): the shared body of both semantic-tokens requests — resolve the cached round, convert the optional range against the analysed snapshot, and run the pure producer. Empty when no round is cached or the file is outside the project.

Source

pub(crate) async fn index_position( &self, uri: &Url, position: Position, fresh: bool, ) -> Option<(Arc<Analysis>, PathBuf, usize)>

The (analysis, rel-path, snapshot byte offset) for a request position — the shared front half of every index-backed handler.

Source

pub(crate) async fn identifier_at( &self, uri: &Url, position: Position, ) -> Option<(String, Span, String)>

Locate the AST node at the given cursor position by re-parsing the document. Returns the textual identifier (if any) and its span. Used by hover and definition handlers.

Trait Implementations§

Source§

impl Clone for Backend

Source§

fn clone(&self) -> Backend

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl LanguageServer for Backend

Source§

fn signature_help<'life0, 'async_trait>( &'life0 self, params: SignatureHelpParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<SignatureHelp>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

v0.32 (ADR 0065): signature help for the call under the cursor.

Source§

fn code_lens<'life0, 'async_trait>( &'life0 self, params: CodeLensParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<Vec<CodeLens>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

v0.33 (ADR 0066): a reference-count lens above each top-level definition, clickable to peek the references. Served from the cached round.

Source§

fn goto_implementation<'life0, 'async_trait>( &'life0 self, params: GotoImplementationParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<GotoImplementationResponse>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

v0.35 (ADR 0068): textDocument/implementation — on a capability symbol (its declaration, a given Cap use, or a provides Cap use), the providers that implement it. None for any other symbol (the reverse, provider → capability, is served by goto-definition).

Source§

fn goto_type_definition<'life0, 'async_trait>( &'life0 self, params: GotoTypeDefinitionParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<GotoTypeDefinitionResponse>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Slice 6: textDocument/typeDefinition — from a value at the cursor to the definition of its (user-declared) type. Reads the value’s type from the round’s expr_types, unwraps it to a Named target, and returns that type’s definition site(s). None for a built-in/function/actor type, or a cursor not on a typed expression in a clean round.

Slice 6b (ADR 0095): textDocument/documentLinkuses/consumes unit names are clickable to the unit’s source. Spans come from parsing the live buffer; the target is the unit’s first source file from the round’s unit→source map. A first-party uses (embedded, no on-disk file) or an unresolved unit yields no link.

Source§

fn completion_resolve<'life0, 'async_trait>( &'life0 self, item: CompletionItem, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<CompletionItem>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Slice 5: fill in hover-quality documentation for the focused completion item, reusing the hover renderer (symbols::describe_symbol, local then cross-file — §3.4). The originating doc URI is read from the item’s data (a resolve request carries only the item, not a position). A no-op for an item that names no declared symbol (a keyword, kernel method, or local) — its one-line detail already suffices.

Source§

fn folding_range<'life0, 'async_trait>( &'life0 self, params: FoldingRangeParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<Vec<FoldingRange>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

v0.37 (ADR 0070): textDocument/foldingRange — structural folds + comment runs from the recovered AST (no analysis round).

Source§

fn selection_range<'life0, 'async_trait>( &'life0 self, params: SelectionRangeParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<Vec<SelectionRange>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

v0.37 (ADR 0070): textDocument/selectionRange — the enclosing-node chain (innermost first) for each requested position.

Source§

fn code_action<'life0, 'async_trait>( &'life0 self, params: CodeActionParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<CodeActionResponse>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

v0.26 (ADR 0054): quick-fixes from structured suggestions. Served from the cached analysis round only (never a fresh run — slow, and it could disagree with the squiggles the client is showing): a request before the first round, or for a file outside the project, returns the empty list.

Source§

fn inlay_hint<'life0, 'async_trait>( &'life0 self, params: InlayHintParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<Vec<InlayHint>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

v0.27 (ADR 0056): inferred-type inlay hints for the visible range, served from the cached round only — no cached round (pre-first- analysis, non-project file) returns the empty list. Positions convert against the analysed snapshot (the v0.24 rule).

Source§

fn semantic_tokens_full<'life0, 'async_trait>( &'life0 self, params: SemanticTokensParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<SemanticTokensResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

v0.28 (ADR 0057): semantic tokens for the whole document, served from the cached round only (no cached round / non-project file → empty), positions against the analysed snapshot (the v0.24 rule).

Source§

fn semantic_tokens_range<'life0, 'async_trait>( &'life0 self, params: SemanticTokensRangeParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<SemanticTokensRangeResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

v0.28 (ADR 0057): the …/range variant — the same pure read, filtered to tokens overlapping the requested range.

Source§

fn symbol<'life0, 'async_trait>( &'life0 self, params: WorkspaceSymbolParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<Vec<SymbolInformation>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

v0.26 rider (ADR 0055): project-wide symbol search — the index’s definitions, filtered by the query.

Source§

fn document_highlight<'life0, 'async_trait>( &'life0 self, params: DocumentHighlightParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<Vec<DocumentHighlight>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

v0.26 rider (ADR 0055): the symbol-at-cursor’s occurrences in the active file. kind is omitted — the index does not distinguish read from write references.

Source§

fn initialize<'life0, 'async_trait>( &'life0 self, params: InitializeParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<InitializeResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The initialize request is the first request sent from the client to the server. Read more
Source§

fn initialized<'life0, 'async_trait>( &'life0 self, __arg1: InitializedParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The initialized notification is sent from the client to the server after the client received the result of the initialize request but before the client sends anything else. Read more
Source§

fn shutdown<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The shutdown request asks the server to gracefully shut down, but to not exit. Read more
Source§

fn did_open<'life0, 'async_trait>( &'life0 self, params: DidOpenTextDocumentParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The textDocument/didOpen notification is sent from the client to the server to signal that a new text document has been opened by the client. Read more
Source§

fn did_change<'life0, 'async_trait>( &'life0 self, params: DidChangeTextDocumentParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The textDocument/didChange notification is sent from the client to the server to signal changes to a text document. Read more
Source§

fn did_close<'life0, 'async_trait>( &'life0 self, params: DidCloseTextDocumentParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The textDocument/didClose notification is sent from the client to the server when the document got closed in the client. Read more
Source§

fn hover<'life0, 'async_trait>( &'life0 self, params: HoverParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<Hover>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The textDocument/hover request asks the server for hover information at a given text document position. Read more
Source§

fn prepare_call_hierarchy<'life0, 'async_trait>( &'life0 self, params: CallHierarchyPrepareParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<Vec<CallHierarchyItem>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The textDocument/prepareCallHierarchy request is sent from the client to the server to return a call hierarchy for the language element of given text document positions. Read more
Source§

fn incoming_calls<'life0, 'async_trait>( &'life0 self, params: CallHierarchyIncomingCallsParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<Vec<CallHierarchyIncomingCall>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The callHierarchy/incomingCalls request is sent from the client to the server to resolve incoming calls for a given call hierarchy item. Read more
Source§

fn outgoing_calls<'life0, 'async_trait>( &'life0 self, params: CallHierarchyOutgoingCallsParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<Vec<CallHierarchyOutgoingCall>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The callHierarchy/outgoingCalls request is sent from the client to the server to resolve outgoing calls for a given call hierarchy item. Read more
Source§

fn completion<'life0, 'async_trait>( &'life0 self, params: CompletionParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<CompletionResponse>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The textDocument/completion request is sent from the client to the server to compute completion items at a given cursor position. Read more
Source§

fn goto_definition<'life0, 'async_trait>( &'life0 self, params: GotoDefinitionParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<GotoDefinitionResponse>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The textDocument/definition request asks the server for the definition location of a symbol at a given text document position. Read more
Source§

fn formatting<'life0, 'async_trait>( &'life0 self, params: DocumentFormattingParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<Vec<TextEdit>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The textDocument/formatting request is sent from the client to the server to format a whole document.
Source§

fn range_formatting<'life0, 'async_trait>( &'life0 self, params: DocumentRangeFormattingParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<Vec<TextEdit>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The textDocument/rangeFormatting request is sent from the client to the server to format a given range in a document.
Source§

fn document_symbol<'life0, 'async_trait>( &'life0 self, params: DocumentSymbolParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<DocumentSymbolResponse>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The textDocument/documentSymbol request is sent from the client to the server to retrieve all symbols found in a given text document. Read more
Source§

fn references<'life0, 'async_trait>( &'life0 self, params: ReferenceParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<Vec<Location>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The textDocument/references request is sent from the client to the server to resolve project-wide references for the symbol denoted by the given text document position.
Source§

fn prepare_rename<'life0, 'async_trait>( &'life0 self, params: TextDocumentPositionParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<PrepareRenameResponse>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The textDocument/prepareRename request is sent from the client to the server to setup and test the validity of a rename operation at a given location. Read more
Source§

fn rename<'life0, 'async_trait>( &'life0 self, params: RenameParams, ) -> Pin<Box<dyn Future<Output = JsonRpcResult<Option<WorkspaceEdit>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The textDocument/rename request is sent from the client to the server to ask the server to compute a workspace change so that the client can perform a workspace-wide rename of a symbol.
Source§

fn did_change_watched_files<'life0, 'async_trait>( &'life0 self, params: DidChangeWatchedFilesParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The workspace/didChangeWatchedFiles notification is sent from the client to the server when the client detects changes to files watched by the language client. Read more
§

fn will_save<'life0, 'async_trait>( &'life0 self, params: WillSaveTextDocumentParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The textDocument/willSave notification is sent from the client to the server before the document is actually saved.
§

fn will_save_wait_until<'life0, 'async_trait>( &'life0 self, params: WillSaveTextDocumentParams, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TextEdit>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The textDocument/willSaveWaitUntil request is sent from the client to the server before the document is actually saved. Read more
§

fn did_save<'life0, 'async_trait>( &'life0 self, params: DidSaveTextDocumentParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The textDocument/didSave notification is sent from the client to the server when the document was saved in the client.
§

fn goto_declaration<'life0, 'async_trait>( &'life0 self, params: GotoDefinitionParams, ) -> Pin<Box<dyn Future<Output = Result<Option<GotoDefinitionResponse>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The textDocument/declaration request asks the server for the declaration location of a symbol at a given text document position. Read more
§

fn prepare_type_hierarchy<'life0, 'async_trait>( &'life0 self, params: TypeHierarchyPrepareParams, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TypeHierarchyItem>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The textDocument/prepareTypeHierarchy request is sent from the client to the server to return a type hierarchy for the language element of given text document positions. Read more
§

fn supertypes<'life0, 'async_trait>( &'life0 self, params: TypeHierarchySupertypesParams, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TypeHierarchyItem>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The [typeHierarchy/supertypes] request is sent from the client to the server to resolve the supertypes for a given type hierarchy item. Read more
§

fn subtypes<'life0, 'async_trait>( &'life0 self, params: TypeHierarchySubtypesParams, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TypeHierarchyItem>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The [typeHierarchy/subtypes] request is sent from the client to the server to resolve the subtypes for a given type hierarchy item. Read more
The documentLink/resolve request is sent from the client to the server to resolve the target of a given document link. Read more
§

fn code_lens_resolve<'life0, 'async_trait>( &'life0 self, params: CodeLens, ) -> Pin<Box<dyn Future<Output = Result<CodeLens, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The codeLens/resolve request is sent from the client to the server to resolve the command for a given code lens item.
§

fn semantic_tokens_full_delta<'life0, 'async_trait>( &'life0 self, params: SemanticTokensDeltaParams, ) -> Pin<Box<dyn Future<Output = Result<Option<SemanticTokensFullDeltaResult>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The textDocument/semanticTokens/full/delta request is sent from the client to the server to resolve the semantic tokens of a given file, returning only the delta. Read more
§

fn inline_value<'life0, 'async_trait>( &'life0 self, params: InlineValueParams, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<InlineValue>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The textDocument/inlineValue request is sent from the client to the server to compute inline values for a given text document that may be rendered in the editor at the end of lines. Read more
§

fn inlay_hint_resolve<'life0, 'async_trait>( &'life0 self, params: InlayHint, ) -> Pin<Box<dyn Future<Output = Result<InlayHint, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The inlayHint/resolve request is sent from the client to the server to resolve additional information for a given inlay hint. Read more
§

fn moniker<'life0, 'async_trait>( &'life0 self, params: MonikerParams, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Moniker>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The textDocument/moniker request is sent from the client to the server to get the symbol monikers for a given text document position. Read more
§

fn diagnostic<'life0, 'async_trait>( &'life0 self, params: DocumentDiagnosticParams, ) -> Pin<Box<dyn Future<Output = Result<DocumentDiagnosticReportResult, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The textDocument/diagnostic request is sent from the client to the server to ask the server to compute the diagnostics for a given document. Read more
§

fn workspace_diagnostic<'life0, 'async_trait>( &'life0 self, params: WorkspaceDiagnosticParams, ) -> Pin<Box<dyn Future<Output = Result<WorkspaceDiagnosticReportResult, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The workspace/diagnostic request is sent from the client to the server to ask the server to compute workspace wide diagnostics which previously where pushed from the server to the client. Read more
§

fn code_action_resolve<'life0, 'async_trait>( &'life0 self, params: CodeAction, ) -> Pin<Box<dyn Future<Output = Result<CodeAction, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The codeAction/resolve request is sent from the client to the server to resolve additional information for a given code action. Read more
§

fn document_color<'life0, 'async_trait>( &'life0 self, params: DocumentColorParams, ) -> Pin<Box<dyn Future<Output = Result<Vec<ColorInformation>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The textDocument/documentColor request is sent from the client to the server to list all color references found in a given text document. Along with the range, a color value in RGB is returned. Read more
§

fn color_presentation<'life0, 'async_trait>( &'life0 self, params: ColorPresentationParams, ) -> Pin<Box<dyn Future<Output = Result<Vec<ColorPresentation>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The textDocument/colorPresentation request is sent from the client to the server to obtain a list of presentations for a color value at a given location. Read more
§

fn on_type_formatting<'life0, 'async_trait>( &'life0 self, params: DocumentOnTypeFormattingParams, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TextEdit>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The textDocument/onTypeFormatting request is sent from the client to the server to format parts of the document during typing.
§

fn linked_editing_range<'life0, 'async_trait>( &'life0 self, params: LinkedEditingRangeParams, ) -> Pin<Box<dyn Future<Output = Result<Option<LinkedEditingRanges>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The textDocument/linkedEditingRange request is sent from the client to the server to return for a given position in a document the range of the symbol at the position and all ranges that have the same content. Read more
§

fn symbol_resolve<'life0, 'async_trait>( &'life0 self, params: WorkspaceSymbol, ) -> Pin<Box<dyn Future<Output = Result<WorkspaceSymbol, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The workspaceSymbol/resolve request is sent from the client to the server to resolve additional information for a given workspace symbol. Read more
§

fn did_change_configuration<'life0, 'async_trait>( &'life0 self, params: DidChangeConfigurationParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The workspace/didChangeConfiguration notification is sent from the client to the server to signal the change of configuration settings.
§

fn did_change_workspace_folders<'life0, 'async_trait>( &'life0 self, params: DidChangeWorkspaceFoldersParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The workspace/didChangeWorkspaceFolders notification is sent from the client to the server to inform about workspace folder configuration changes. Read more
§

fn will_create_files<'life0, 'async_trait>( &'life0 self, params: CreateFilesParams, ) -> Pin<Box<dyn Future<Output = Result<Option<WorkspaceEdit>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The workspace/willCreateFiles request is sent from the client to the server before files are actually created as long as the creation is triggered from within the client. Read more
§

fn did_create_files<'life0, 'async_trait>( &'life0 self, params: CreateFilesParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The workspace/didCreateFiles request is sent from the client to the server when files were created from within the client.
§

fn will_rename_files<'life0, 'async_trait>( &'life0 self, params: RenameFilesParams, ) -> Pin<Box<dyn Future<Output = Result<Option<WorkspaceEdit>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The workspace/willRenameFiles request is sent from the client to the server before files are actually renamed as long as the rename is triggered from within the client. Read more
§

fn did_rename_files<'life0, 'async_trait>( &'life0 self, params: RenameFilesParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The workspace/didRenameFiles notification is sent from the client to the server when files were renamed from within the client.
§

fn will_delete_files<'life0, 'async_trait>( &'life0 self, params: DeleteFilesParams, ) -> Pin<Box<dyn Future<Output = Result<Option<WorkspaceEdit>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The workspace/willDeleteFiles request is sent from the client to the server before files are actually deleted as long as the deletion is triggered from within the client either by a user action or by applying a workspace edit. Read more
§

fn did_delete_files<'life0, 'async_trait>( &'life0 self, params: DeleteFilesParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The workspace/didDeleteFiles notification is sent from the client to the server when files were deleted from within the client.
§

fn execute_command<'life0, 'async_trait>( &'life0 self, params: ExecuteCommandParams, ) -> Pin<Box<dyn Future<Output = Result<Option<Value>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The workspace/executeCommand request is sent from the client to the server to trigger command execution on the server. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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.

§

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

§

fn fg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the foreground set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like red() and green(), which have the same functionality but are pithier.

§Example

Set foreground color to white using fg():

use yansi::{Paint, Color};

painted.fg(Color::White);

Set foreground color to white using white().

use yansi::Paint;

painted.white();
§

fn primary(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Primary].

§Example
println!("{}", value.primary());
§

fn fixed(&self, color: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Fixed].

§Example
println!("{}", value.fixed(color));
§

fn rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Rgb].

§Example
println!("{}", value.rgb(r, g, b));
§

fn black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Black].

§Example
println!("{}", value.black());
§

fn red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Red].

§Example
println!("{}", value.red());
§

fn green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Green].

§Example
println!("{}", value.green());
§

fn yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Yellow].

§Example
println!("{}", value.yellow());
§

fn blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Blue].

§Example
println!("{}", value.blue());
§

fn magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Magenta].

§Example
println!("{}", value.magenta());
§

fn cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Cyan].

§Example
println!("{}", value.cyan());
§

fn white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: White].

§Example
println!("{}", value.white());
§

fn bright_black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlack].

§Example
println!("{}", value.bright_black());
§

fn bright_red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightRed].

§Example
println!("{}", value.bright_red());
§

fn bright_green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightGreen].

§Example
println!("{}", value.bright_green());
§

fn bright_yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightYellow].

§Example
println!("{}", value.bright_yellow());
§

fn bright_blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlue].

§Example
println!("{}", value.bright_blue());
§

fn bright_magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.bright_magenta());
§

fn bright_cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightCyan].

§Example
println!("{}", value.bright_cyan());
§

fn bright_white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightWhite].

§Example
println!("{}", value.bright_white());
§

fn bg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the background set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like on_red() and on_green(), which have the same functionality but are pithier.

§Example

Set background color to red using fg():

use yansi::{Paint, Color};

painted.bg(Color::Red);

Set background color to red using on_red().

use yansi::Paint;

painted.on_red();
§

fn on_primary(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Primary].

§Example
println!("{}", value.on_primary());
§

fn on_fixed(&self, color: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Fixed].

§Example
println!("{}", value.on_fixed(color));
§

fn on_rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Rgb].

§Example
println!("{}", value.on_rgb(r, g, b));
§

fn on_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Black].

§Example
println!("{}", value.on_black());
§

fn on_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Red].

§Example
println!("{}", value.on_red());
§

fn on_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Green].

§Example
println!("{}", value.on_green());
§

fn on_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Yellow].

§Example
println!("{}", value.on_yellow());
§

fn on_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Blue].

§Example
println!("{}", value.on_blue());
§

fn on_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Magenta].

§Example
println!("{}", value.on_magenta());
§

fn on_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Cyan].

§Example
println!("{}", value.on_cyan());
§

fn on_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: White].

§Example
println!("{}", value.on_white());
§

fn on_bright_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlack].

§Example
println!("{}", value.on_bright_black());
§

fn on_bright_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightRed].

§Example
println!("{}", value.on_bright_red());
§

fn on_bright_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightGreen].

§Example
println!("{}", value.on_bright_green());
§

fn on_bright_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightYellow].

§Example
println!("{}", value.on_bright_yellow());
§

fn on_bright_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlue].

§Example
println!("{}", value.on_bright_blue());
§

fn on_bright_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.on_bright_magenta());
§

fn on_bright_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightCyan].

§Example
println!("{}", value.on_bright_cyan());
§

fn on_bright_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightWhite].

§Example
println!("{}", value.on_bright_white());
§

fn attr(&self, value: Attribute) -> Painted<&T>

Enables the styling [Attribute] value.

This method should be used rarely. Instead, prefer to use attribute-specific builder methods like bold() and underline(), which have the same functionality but are pithier.

§Example

Make text bold using attr():

use yansi::{Paint, Attribute};

painted.attr(Attribute::Bold);

Make text bold using using bold().

use yansi::Paint;

painted.bold();
§

fn bold(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Bold].

§Example
println!("{}", value.bold());
§

fn dim(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Dim].

§Example
println!("{}", value.dim());
§

fn italic(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Italic].

§Example
println!("{}", value.italic());
§

fn underline(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Underline].

§Example
println!("{}", value.underline());

Returns self with the attr() set to [Attribute :: Blink].

§Example
println!("{}", value.blink());

Returns self with the attr() set to [Attribute :: RapidBlink].

§Example
println!("{}", value.rapid_blink());
§

fn invert(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Invert].

§Example
println!("{}", value.invert());
§

fn conceal(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Conceal].

§Example
println!("{}", value.conceal());
§

fn strike(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Strike].

§Example
println!("{}", value.strike());
§

fn quirk(&self, value: Quirk) -> Painted<&T>

Enables the yansi [Quirk] value.

This method should be used rarely. Instead, prefer to use quirk-specific builder methods like mask() and wrap(), which have the same functionality but are pithier.

§Example

Enable wrapping using .quirk():

use yansi::{Paint, Quirk};

painted.quirk(Quirk::Wrap);

Enable wrapping using wrap().

use yansi::Paint;

painted.wrap();
§

fn mask(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Mask].

§Example
println!("{}", value.mask());
§

fn wrap(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Wrap].

§Example
println!("{}", value.wrap());
§

fn linger(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Linger].

§Example
println!("{}", value.linger());
§

fn clear(&self) -> Painted<&T>

👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear(). The clear() method will be removed in a future release.

Returns self with the quirk() set to [Quirk :: Clear].

§Example
println!("{}", value.clear());
§

fn resetting(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Resetting].

§Example
println!("{}", value.resetting());
§

fn bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Bright].

§Example
println!("{}", value.bright());
§

fn on_bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: OnBright].

§Example
println!("{}", value.on_bright());
§

fn whenever(&self, value: Condition) -> Painted<&T>

Conditionally enable styling based on whether the [Condition] value applies. Replaces any previous condition.

See the crate level docs for more details.

§Example

Enable styling painted only when both stdout and stderr are TTYs:

use yansi::{Paint, Condition};

painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
§

fn new(self) -> Painted<Self>
where Self: Sized,

Create a new [Painted] with a default [Style]. Read more
§

fn paint<S>(&self, style: S) -> Painted<&Self>
where S: Into<Style>,

Apply a style wholesale to self. Any previous style is replaced. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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