euporie.core.lsp
Defines a simple LSP client.
Functions
|
Typed version of namedtuple. |
|
Convert a line/character ranger to a slice. |
Classes
|
Simple event to which event handlers can be attached. For instance::. |
|
An LSP client's representation of a cell. |
|
A client for communicating with LSP servers. |
|
PurePath subclass that can make system calls. |
- class euporie.core.lsp.LspCell(id: str, idx: int, path: Path, kind: str, language: str, text: str, execution_count: int, metadata: dict[str, Any] | None = None)
Bases:
NamedTuple
An LSP client’s representation of a cell.
- count(value, /)
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)
Return first index of value.
Raises ValueError if the value is not present.
- class euporie.core.lsp.LspClient(name: str, command: str, languages: Sequence[str] | None = None, settings: dict | None = None)
Bases:
object
A client for communicating with LSP servers.
- change_doc(path: Path, language: str, text: str, debounce: bool = True) None
Tell the server we have changed a document file.
- change_nb_add(path: Path, cells: Sequence[LspCell]) None
Notify server of cells added to notebook.
- change_nb_delete(path: Path, cells: Sequence[LspCell]) None
Notify server of cells removed from a notebook.
- change_nb_edit(path: Path, cells: Sequence[LspCell], debounce: bool = True) None
Notify server of a change in notebook cells.
- change_nb_meta(path: Path, metadata: dict[str, Any]) None
Notify server of a change in a notebook metadata.
- close_nb(path: Path, cells: Sequence[LspCell]) None
Tell the server we closed a notebook document.
- complete(path: Path, line: int, char: int, timeout: int = 5) list[dict[str, str]]
Trigger a LSP completion request.
- async complete_(path: Path, line: int, char: int, timeout: int = 5) list[dict[str, Any]]
Request a completion from the LSP server.
- exit() Future
Tell the server to exit.
- format(path: Path, tab_size: int = 4, spaces: bool = True, timeout: int = 1) list[dict] | None
Request LSP document formatting.
- async format_(path: Path, tab_size: int = 4, spaces: bool = True, timeout: int = 5) list[dict] | None
Trigger a formatting request from the LSP.
- async hover_(path: Path, line: int, char: int, timeout: int = 5) dict
Request hover text from the LSP server.
- loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
- open_doc(path: Path, language: str, text: str) None
Tell the server we have opened a document file.
- open_nb(path: Path, cells: Sequence[LspCell], metadata: dict[str, Any] | None) None
Tell the server we have opened a notebook file.
- async send_msg(method: str, params: dict[str, Any] | None = None, cb: Callable[[Any], Coroutine[Any, Any, None]] | None = None) int
Send a message to the LSP server, returning the sent message’s ID.
- signature(path: Path, line: int, char: int, timeout: int = 1) dict[str, object] | None
Trigger a LSP signature request.
- async signature_(path: Path, line: int, char: int, timeout: int = 5) dict[str, object] | None
Request a signature from the LSP server.
- thread = <Thread(Thread-1 (_setup_loop), initial daemon)>