Skip to content

Identify notebooks by LSP didOpen instead of .ipynb file extension#22810

Merged
MichaReiser merged 2 commits intoastral-sh:mainfrom
manzt:manzt/notebook-lsp-did-open
Jan 23, 2026
Merged

Identify notebooks by LSP didOpen instead of .ipynb file extension#22810
MichaReiser merged 2 commits intoastral-sh:mainfrom
manzt:manzt/notebook-lsp-did-open

Conversation

@manzt
Copy link
Contributor

@manzt manzt commented Jan 22, 2026

Fixes #22809

Use the documents map to determine if a URL was opened as a notebook via notebookDocument/didOpen, rather than relying on the .ipynb file extension. This allows tools like marimo that use .py files as notebook documents to work correctly without URI workarounds.

@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 22, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Fixes astral-sh#22809

Use the documents map to determine if a URL was opened as a notebook via
`notebookDocument/didOpen`, rather than relying on the `.ipynb` file
extension. This allows tools like marimo that use `.py` files as
notebook documents to work correctly without URI workarounds.
@manzt manzt force-pushed the manzt/notebook-lsp-did-open branch from 85c7fec to 5b6e766 Compare January 22, 2026 19:45
@manzt manzt changed the title [server] Identify notebooks by LSP didOpen Identify notebooks by LSP didOpen instead of .ipynb file extension Jan 22, 2026
@manzt manzt force-pushed the manzt/notebook-lsp-did-open branch from 1be528e to 2a5193a Compare January 22, 2026 20:04
@MichaReiser MichaReiser added the server Related to the LSP server label Jan 23, 2026
@MichaReiser
Copy link
Member

Thank you, this makes sense to me

@MichaReiser MichaReiser merged commit 3424e8c into astral-sh:main Jan 23, 2026
42 checks passed
carljm added a commit that referenced this pull request Jan 30, 2026
* main: (62 commits)
  [`refurb`] Do not add `abc.ABC` if already present (`FURB180`) (#22234)
  [ty] Add a new `assert-type-unspellable-subtype` diagnostic (#22815)
  [ty] Avoid duplicate syntax errors for `await` outside functions (#22826)
  [ty] Fix unary operator false-positive for constrained TypeVars (#22783)
  [ty] Fix binary operator false-positive for constrained TypeVars (#22782)
  [ty] Fix false-positive `unsupported-operator` for "symmetric" TypeVars (#22756)
  [`pydocstyle`] Clarify which quote styles are allowed (`D300`) (#22825)
  [ty] Use distributed versions of AND and OR on constraint sets (#22614)
  [ty] Add support for dict literals and dict() calls as default values for parameters with TypedDict types (#22161)
  Document `-` stdin convention in CLI help text (#22817)
  [ty] Make `infer_subscript_expression_types` a method on `Type` (#22731)
  [ty] Simplify `OverloadLiteral::spans` and `OverloadLiteral::parameter_span` (#22823)
  [ty] Require both `*args` and `**kwargs` when calling a `ParamSpec` callable (#22820)
  [ty] Handle tagged errors in conformance (#22746)
  Add `--color` cli option to force colored output (#22806)
  Identify notebooks by LSP didOpen instead of `.ipynb` file extension (#22810)
  [ty] Fix docstring rendering for literal blocks after doctests (#22676)
  [ty] Update salsa to fix out-of-order query validation (#22498)
  [ty] Inline cycle initial and recovery functions (#22814)
  [ty] Pass the generic context through the decorator (#22544)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

server Related to the LSP server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Notebook document identification relies on .ipynb extension rather than LSP notification type

2 participants