euporie.core.completion

Contain the main class for a notebook file.

Classes

CompleteEvent([text_inserted, ...])

Event that called the completer.

Completer()

Base class for completer implementations.

Completion(text[, start_position, display, ...])

param text:

The new string that will be inserted into the document.

DeduplicateCompleter(completer)

Asynchronous wrapper around a completer that removes duplicates.

KernelCompleter(kernel)

A prompt_toolkit completer which provides completions from a Jupyter kernel.

LspCompleter(lsp, path)

A completer for documents using an LSP.

class euporie.core.completion.DeduplicateCompleter(completer: Completer)

Bases: Completer

Asynchronous wrapper around a completer that removes duplicates.

Only the first unique completions are kept. Completions are considered to be a duplicate if they result in the same document text when they would be applied.

get_completions(document: Document, complete_event: CompleteEvent) Iterable[Completion]

Do nothing as completions are retrieved asynchronously.

async get_completions_async(document: Document, complete_event: CompleteEvent) AsyncGenerator[Completion, None]

Get completions from wrapped completer.

class euporie.core.completion.KernelCompleter(kernel: Kernel)

Bases: Completer

A prompt_toolkit completer which provides completions from a Jupyter kernel.

get_completions(document: Document, complete_event: CompleteEvent) Iterable[Completion]

Do nothing as completions are retrieved asynchronously.

async get_completions_async(document: Document, complete_event: CompleteEvent) AsyncGenerator[Completion, None]

Retrieve completions from a Kernel.

class euporie.core.completion.LspCompleter(lsp: LspClient, path: Path)

Bases: Completer

A completer for documents using an LSP.

get_completions(document: Document, complete_event: CompleteEvent) Iterable[Completion]

Do nothing as completions are retrieved asynchronously.

async get_completions_async(document: Document, complete_event: CompleteEvent) AsyncGenerator[Completion, None]

Retrieve completions from an LSP server.