<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-support-notebooks-in-a-language-server-vwxf0syy6" -->

---
title: How to Support Notebooks in a Language Server | daily.dev
description: An explanation of how language servers can support Jupyter and other notebook formats, covering the pre-LSP-3.17 proxy-layer approach used by JupyterLab and...
canonical: https://daily.dev/posts/how-to-support-notebooks-in-a-language-server-vwxf0syy6
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to Support Notebooks in a Language Server | daily.dev
og:description: An explanation of how language servers can support Jupyter and other notebook formats, covering the pre-LSP-3.17 proxy-layer approach used by JupyterLab and...
og:url: https://daily.dev/posts/how-to-support-notebooks-in-a-language-server-vwxf0syy6
og:image: https://api.daily.dev/og/posts/vWXf0Syy6.png
og:image:alt: How to Support Notebooks in a Language Server
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Support Notebooks in a Language Server

**[Pyrefly: A Fast Python Type Checker and Language Server \| Pyrefly](https://daily.dev/sources/pyrefly)** · 6 min read · 0 upvotes · 0 comments

## Summary

An explanation of how language servers can support Jupyter and other notebook formats, covering the pre-LSP-3.17 proxy-layer approach used by JupyterLab and Meta's Bento notebooks, the notebook synchronization methods added in LSP 3.17, and the two main internal representations (file-based vs cell-based) a language server can use. Pyrefly's team describes choosing a file-based approach for their notebook support, shipped in v0.41.0, and discusses trade-offs versus a cell-based model, plus how alternative notebook formats like Quarto and Marimo face the same underlying challenge.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://pyrefly.org/blog/notebook>

## Questions this post answers

### How does LSP 3.17 add native support for Jupyter notebooks?

LSP 3.17, released in 2022, introduced four notebook-specific operations: notebookDocument/didOpen, notebookDocument/didChange, notebookDocument/didSave, and notebookDocument/didClose. Unlike textDocument operations that send one file's text, didOpen sends each cell as a separate document with its own editor-assigned URI, and didChange encodes cell additions, deletions, and content changes within cells.

_Teams building editor integrations can track LSP protocol changes like this one on daily.dev._

### What are the two ways a language server can internally represent Jupyter notebook cells?

A language server can use a file-based representation, concatenating all cells into one virtual file with position mapping between cells and lines, or a cell-based representation, treating each cell as its own file with implicit imports from prior cells. File-based is less invasive to implement but requires re-checking the whole notebook on any change; cell-based allows re-checking only subsequent cells when a cell's exported types change.

_Developers deciding on notebook tooling architecture can compare trade-offs like these on daily.dev._

### How did editors support Jupyter notebooks with language servers before native LSP notebook support existed?

Editors like JupyterLab's LSP extension and Meta's internal Bento notebooks used a proxy layer that concatenated every cell into a single virtual document, mapped cell positions to positions in that concatenated file before sending requests, and mapped response positions back to the original cell. This pushed all cell-stitching and position-mapping complexity onto the editor or middleware rather than the language server.

_Anyone maintaining notebook tooling can follow how these architectural patterns evolve on daily.dev._

## Similar posts on daily.dev

- [Why I’m Making the Switch to marimo Notebooks](https://daily.dev/posts/why-i-m-making-the-switch-to-marimo-notebooks-6uldmguqp) · Towards Data Science · 0 upvotes · 0 comments
- [the terminal of the future](https://daily.dev/posts/the-terminal-of-the-future-as03soq8f) · Hacker News · 19 upvotes · 3 comments
- [Amazon SageMaker Unified Studio adds notebook import/export and developer acceleration features](https://daily.dev/posts/amazon-sagemaker-unified-studio-adds-notebook-import-export-and-developer-acceleration-features-ywnhyfem3) · AWS · 0 upvotes · 0 comments
- [Happy Holidays: Snowflake Notebooks are now in Workspaces](https://daily.dev/posts/happy-holidays-snowflake-notebooks-are-now-in-workspaces-u2uqhrsjs) · Snowflake Community · 2 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#jupyter](https://daily.dev/tags/jupyter)

[View this post on daily.dev](https://daily.dev/posts/how-to-support-notebooks-in-a-language-server-vwxf0syy6)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to Support Notebooks in a Language Server","url":"https://daily.dev/posts/how-to-support-notebooks-in-a-language-server-vwxf0syy6","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-support-notebooks-in-a-language-server-vwxf0syy6"},"datePublished":"2026-08-23T12:17:25.511Z","dateModified":"2026-08-23T12:24:24.976Z","description":"An explanation of how language servers can support Jupyter and other notebook formats, covering the pre-LSP-3.17 proxy-layer approach used by JupyterLab and...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ce7cceb523e1bdb0e6d2d6310d2d101d?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ce7cceb523e1bdb0e6d2d6310d2d101d?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Pyrefly: A Fast Python Type Checker and Language Server | Pyrefly","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Pyrefly: A Fast Python Type Checker and Language Server | Pyrefly","logo":"https://media.daily.dev/image/upload/s--Qzw5NpnF--/c_limit,w_256/f_auto,q_auto/v1787487420/logos/pyrefly?_a=BAMAMicg0","url":"https://daily.dev/sources/pyrefly"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-to-support-notebooks-in-a-language-server-vwxf0syy6","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,jupyter","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Pyrefly: A Fast Python Type Checker and Language Server | Pyrefly","item":"https://daily.dev/sources/pyrefly"},{"@type":"ListItem","position":3,"name":"How to Support Notebooks in a Language Server"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-to-support-notebooks-in-a-language-server-vwxf0syy6#faq","mainEntity":[{"@type":"Question","name":"How does LSP 3.17 add native support for Jupyter notebooks?","acceptedAnswer":{"@type":"Answer","text":"LSP 3.17, released in 2022, introduced four notebook-specific operations: notebookDocument/didOpen, notebookDocument/didChange, notebookDocument/didSave, and notebookDocument/didClose. Unlike textDocument operations that send one file's text, didOpen sends each cell as a separate document with its own editor-assigned URI, and didChange encodes cell additions, deletions, and content changes within cells. Teams building editor integrations can track LSP protocol changes like this one on daily.dev."}},{"@type":"Question","name":"What are the two ways a language server can internally represent Jupyter notebook cells?","acceptedAnswer":{"@type":"Answer","text":"A language server can use a file-based representation, concatenating all cells into one virtual file with position mapping between cells and lines, or a cell-based representation, treating each cell as its own file with implicit imports from prior cells. File-based is less invasive to implement but requires re-checking the whole notebook on any change; cell-based allows re-checking only subsequent cells when a cell's exported types change. Developers deciding on notebook tooling architecture can compare trade-offs like these on daily.dev."}},{"@type":"Question","name":"How did editors support Jupyter notebooks with language servers before native LSP notebook support existed?","acceptedAnswer":{"@type":"Answer","text":"Editors like JupyterLab's LSP extension and Meta's internal Bento notebooks used a proxy layer that concatenated every cell into a single virtual document, mapped cell positions to positions in that concatenated file before sending requests, and mapped response positions back to the original cell. This pushed all cell-stitching and position-mapping complexity onto the editor or middleware rather than the language server. Anyone maintaining notebook tooling can follow how these architectural patterns evolve on daily.dev."}}]}
```

