Skip to content

Type hints not recognized by language server #318

@Antyos

Description

@Antyos

Describe the bug

Marimo's language server does not detect manually specified type hints. This can be important, as functions which lack return typing or have wrapped return typing, e.g., alt.Chart().encode(), will become typed as Unknown and lose the benefits of the language server.

Image

Environment

Details
marimo VS Code Extension Diagnostics
=====================================

Language Server (LSP):
	UV Bin: Discovered (C:\Users\andrew\.local\bin\uv.exe)
	UV: uv 0.9.9 (4fac4cb7e 2025-11-12) ✓
	Using bundled marimo-lsp via uvx

Python Extension:
	Interpreter: c:\Users\andrew\Code\project\code\.venv\Scripts\python.exe
	Version: 3.13.9.final.0
	Environment: VirtualEnvironment (biaxtic)

Python Language Server (ty):
	Status: running ✓
	Version: 0.0.8 (aa7559db8 2025-12-29)
	Python: c:\Users\andrew\Code\project\code\.venv\Scripts\python.exe (3.13.9.final.0)

Extension Configuration:
	Version: 0.8.10 
	UV integration disabled: false 

System Information:
	Host: desktop 
	IDE: Visual Studio Code 
	IDE version: 1.108.0 
	Platform: win32 
	Architecture: x64 
	Node version: v22.21.1 

Common Issues:
	1. If notebooks won't open:
		- Check Python interpreter is selected
		- Ensure marimo and pyzmq are installed
		- Check 'marimo-lsp' output channel for errors
	2. If features are missing:
		- Ensure marimo version is >= 0.17.0
		- Try reloading the window

Steps to reproduce

Code snippet:

import altair as alt
import polars as pl

chart: alt.Chart = alt.Chart(pl.DataFrame({
        "x": [0, 1, 0, 1], "y": [0, 0, 1, 1], "c": [0, 1, 2, 3]
    })).mark_rect().encode(
    x="x:O",
    y="y:O",
    color="c:O"
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingupstream

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions