Defines the structure for code completion results including symbol name, type, and docstring info. Reuse when building IDE completion frontends.
# Source: https://github.com/marimo-team/marimo | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
# Copyright 2026 Marimo. All rights reserved.
"""Specification of a code completion result"""
from __future__ import annotations
import msgspec
class CompletionOption(msgspec.Struct):
# completed symbol name
name: str
# type of symbol
type: str
# docstring, type hint, or other info
completion_info: str | None
def __post_init__(self) -> None:
# Remove trailing quotes because frontends may automatically add quotes
self.name = self.name.rstrip('"').rstrip("'")
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key