Skip to content

Support the %%file IPython magic #302

Open
@bollwyvl

Description

@bollwyvl

Elevator Pitch

Support detecting and connecting the appropriate language server when a %%file <filename> magic is encountered.

Motivation

This would enable to a demo I've wanted to do for a while, namely, from within a single notebook session, with language server support:

  • write an environment.yml
  • write a package.json
  • write a tsconfig.json
  • write a index.ts
  • write a style.css
  • do the setup stuff in a new app_dir (e.g. run postBuild)
  • start up another jupyter lab server in the same event loop
  • start up the tsc --watch process
  • start up the jupyter lab --watch process (probably not in-loop)
  • open an iframe in lab, of the other lab
  • write a robot test
  • iterate on any of the above, with live reloading

Design Ideas

I haven't dug much into the extractors, but this one would need a fair amount of custom behavior, since we wouldn't know a lot ahead of time. The only argument it takes is -a for append, which wouldn't be super useful, and it could be writing out to any path, which complicates matters.

The run-a-notebook-server-inside-a-kernel trick would work great.

Right now, the highlighting is fairly underpowered with %%file... while most of them would be around, maybe we bring in some ideas from simple-syntax, and even let language server specs ship a simple mode. Why not!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions