Open jest opened 3 weeks ago
Digging a bit deeper, I found this:
let languages = context.notebookEditor.activeKernel?.supportedLanguages;
So it looks like the list of supported languages is taken from the active kernel, and pyprql
does not advertise itself.
Yes I'd really like this to work!
Digging a bit deeper, I found this:
Thanks for looking into it. Does that mean this is much easier than getting it to work in Jupyter normal? There are some notes from https://github.com/PRQL/pyprql/issues/45 — last time I checked it was speculative whether it was even possible.
Do you know how autodetect works there?
(We would definitely take any PR that contributed towards this, would be a v nice improvement)
Following with short analysis and debugging of the editActions.ts
mentioned above, to my surprise the cell language selectio process looks completely different when there is no active kernel.
In such a case, the list of languages presented to the user for the given cell is the "normal" list of languages supported by VSCode, including PRQL! After choosing PRQL, syntax highlighting and error reporting works nice within the cell:
Unfortunatelly, after connecting the notebook to a Jupyter server, the list of available kernel languages is fetched from there and the cell language changes automatically from PRQL to Python.
So at the first sight it looks like the user-facing functions of VSCode+prql-vscode
work well within cells. At the moment I don't know to what extent those functions implementations are instead provided by the attached kernel, so further checks with pyprql installed in Jupyter kernel are needed.
(thanks a lot for looking into that, that makes sense... So I guess fixing https://github.com/PRQL/pyprql/issues/45 would fix this too... )
I use VSCode with this extension to write PRQL files, as well as to develop and run Jupyter notebooks with Microsoft's Jupyter extension (https://github.com/Microsoft/vscode-jupyter.git) against kernel with
pyprql
.I noticed that although syntax highlighting works fine for
*.prql
files, there is no option to set the PRQL language for individual cells in the notebook:Is it possible to use syntax highlighting provided for "normal" editors to support highlighting in the Jupyter cells?