Closed ncworstell closed 7 months ago
VSCode Quarto extension repository is https://github.com/quarto-dev/quarto.
Note that Quarto is a CLI. So even if the VSCode extension can use the the other extension, a kernel is still needed to render the document the same way a Jupyter Notebook will need the kernel. Are you saying that you don't need to specify the MatLab kernel inside Jupyter Notebook when using the MatLab extension?
Could you properly format your post using code blocks for code and terminal outputs? Thanks.
If your code contains code blocks, you need to enclose it using more backticks, i.e., usually four ````
.
Currently it's not very legible.
@ncworstell can you format your issue correctly please ? This way will be able to look at your example correctly.
See https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us
thanks !
@cderv, I think I updated it properly. Please let me know how else I can help/what else I might need to correct.
@ncworstell GitHub uses markdown. You only have to edit your post to make it "pretty". Take a look at the current formatting, you have quarto check
output outside of a code block, you have a weird sections headers in the middle, etc.
In particular, take a look at your "Expected behavior" section and how it is formatted.
You can use the "preview" button to see your formatting.
Thanks for the example @ncworstell
As context and reminder, Quarto will use Jupyter and its kernel to run the code cell you provide. More on this at https://quarto.org/docs/computations/python.html
VS Code or not, this is how Quarto runs - VS Code extension of Quarto (Render or Preview button) will only call quarto render
which will have Jupyter processing in the rendering.
That being said, Jupyter kernel detection is explained at https://quarto.org/docs/computations/python.html#kernel-selection In your case this applies
If no Jupyter kernel is specified, then the kernel is determined by finding an available kernel that supports the language of the first executable code block found within the file (e.g. ```{python}).
When using matlab
as a code cell language, quarto will try to find an installed Jupyter kernel that supports matlab
. As no error on finding it is reported, I believe it found one, and you may have Matlab kernel installed.
I don't know which one, but I know one of them is not supporting correctly some jupyter technical things that prevent its usage in quarto
The error you have is the one reported there. Discussion in quarto about this is at
The issue at https://github.com/mathworks/jupyter-matlab-proxy/issues/48 lead to some other project https://github.com/allefeld/mkernel
I hope this clarifies how quarto works.
You can understand now that quarto render
won't be able to leverage the Matlab plug-in. Any rendering happens through Jupyter engine or knitr engine for now. So matlab needs to be used though Jupyter. It won't be able to use a VS Code plugin - especially because outside of VSCode this would obviously not work, and quarto is a CLI tool.
Hope this helps.
I'll close this as the kernel issue you have is reported upstream already; Please to reopen if you think I missed your point; Thanks !
Bug description
When I generate the Markdown preview of a quarto document with MatLab code in it, it tries to run the MatLab kernel for jupyter and does not give the option or seem to look for the MatLab plug-in for VS Code. Presumably this is because the MatLab plug-in only recently started to support code execution (https://marketplace.visualstudio.com/items?itemName=MathWorks.language-matlab)
Steps to reproduce
Actual behavior
Your environment
-IDE: VSCode Version: 1.87.1 (user setup) Commit: 1e790d77f81672c49be070e04474901747115651 Date: 2024-03-06T00:21:36.258Z Electron: 27.3.2 ElectronBuildId: 26836302 Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0 OS: Windows_NT x64 10.0.19045
Quarto check output