Hover

class Hover

Options for LSP hover provider that displays documentation of elements under the cursor.

Members defined in Hover (4 members)

force_root_to_workspace

RW

Use workspace as the root directory for root-relative paths instead of project roots. Only works on user documents, and not external dependencies and standard library.

path_extensions

RW

Extensions that are allowed in path resolution.

path_resolution

RW

Kinds of paths to resolve inside Markdown links ([...](<path>)).

__init__

Attributes

property force_root_to_workspace: bool

Use workspace as the root directory for root-relative paths instead of project roots. Only works on user documents, and not external dependencies and standard library.

Note that paths relative to the workspace root may break after packaging as assets may no longer be found at the same paths relative to the package root.

property path_extensions: list[str] | None

Extensions that are allowed in path resolution.

This controls which paths may be resolved, and ignores the rest. An empty array will resolve no paths. This does not support glob patterns, only string comparisons. However, * means to allow all extensions.

property path_resolution: syside.conf.PathResolution

Kinds of paths to resolve inside Markdown links ([...](<path>)).

Primary use case is to embed images inside documentation that would then be rendered on hover. Currently, only paths relative to the source document are supported. Paths relative to the project root will be added in the future.

Paths traversing outside of root directory will be ignored. Until project roots are supported, relative paths cannot traverse directories up from the source file, unless force-root-to-workspace option is set. In which case, relative and workspace paths cannot leave the workspace directory instead.

This is opt-in to prevent clients automatically loading potentially untrusted files. Note that at least VS Code requires paths to use / separators even on Windows, that is paths should be valid URLs.

Only file paths may be resolved, i.e. URLs without a scheme, or a file scheme.

Methods

__init__() None