Skip to content

Completion does not activate for imports/arguments without a non-space prefix #68

Description

@tomshafer

Moved over from main marimo repo. I’m no expert in TypeScript or CodeMirror, but GPT 5.6 identified a small change (few lines plus tests) that fixes this issue.

Describe the bug

Completion works as expected for from dataclasses import d<pause/ctl+space> (completion options appear), but does not activate at all for from dataclasses import <pause/ctl+space>. The same can be true for function argument completion, depending whether the user has backspaced through characters. This is an important feature for experimenting with APIs and I miss it when I use marimo.

Will you submit a PR?

  • Yes

Environment

Details
{
  "marimo": "0.23.14",
  "editable": false,
  "location": "/Users/tomshafer/Library/Caches/uv/archive-v0/_LjD0vyGeI3lEH5m/lib/python3.14/site-packages/marimo",
  "OS": "Darwin",
  "OS Version": "25.5.0",
  "Processor": "arm",
  "Python Version": "3.14.2",
  "Locale": "C/en_US",
  "Binaries": {
    "Browser": "149.0.7827.201",
    "Node": "v26.3.1",
    "uv": "0.11.26 (396ef7ce4 2026-06-30 aarch64-apple-darwin)"
  },
  "Dependencies": {
    "click": "8.4.2",
    "docutils": "0.23",
    "itsdangerous": "2.2.0",
    "jedi": "0.19.2",
    "markdown": "3.10.2",
    "narwhals": "2.23.0",
    "packaging": "26.2",
    "psutil": "7.2.2",
    "pygments": "2.20.0",
    "pymdown-extensions": "10.21.3",
    "pyyaml": "6.0.3",
    "starlette": "1.3.1",
    "tomlkit": "0.15.0",
    "typing-extensions": "4.16.0",
    "uvicorn": "0.51.0",
    "websockets": "16.1"
  },
  "Optional Dependencies": {
    "loro": "1.13.1",
    "python-lsp-ruff": "2.3.1",
    "python-lsp-server": "1.14.0",
    "ruff": "0.15.21"
  },
  "Experimental Flags": {}
}

Code to reproduce

# /// script
# dependencies = [
#     "marimo",
# ]
# requires-python = ">=3.14"
# ///

import marimo

__generated_with = "0.23.14"
app = marimo.App(width="medium")


@app.cell
def _():
    import marimo as mo

    return


@app.cell
def _():
    from dataclasses import 

    return


if __name__ == "__main__":
    app.run()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions