Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use MATLABKernel from a VSCode devcontainer? #24

Open
worc4021 opened this issue Feb 23, 2023 · 9 comments
Open

How to use MATLABKernel from a VSCode devcontainer? #24

worc4021 opened this issue Feb 23, 2023 · 9 comments

Comments

@worc4021
Copy link

Hello guys!

Not so much an issue but more a question: Has anyone been able to get the jupyter kernel embedded in vscode via a devcontainer?

My attempts so far have been futile and I keep seeing

Kernel needs to be started by a Jupyter Server. Please use JupyterLab or Classic Notebook while using MATLAB Kernel for Jupyter.

Anything I am missing in princple? It works in the lab and in the notebook but refuses to connect in vscode :'(

Cheers,
Manuel

@prabhakk-mw prabhakk-mw self-assigned this Mar 9, 2023
@codingToPerfection
Copy link

same issue here. I think it is possible for matlab proxy working in vscode-jupyter environment.

I use vscode-jupyter to launch matlab kernal.

It returns :

Kernel needs to be started by a Jupyter Server. Please use JupyterLab or Classic Notebook while using MATLAB Kernel for Jupyter.

@vani-lu
Copy link

vani-lu commented May 7, 2023

My current workaround is to open the jupyter server from command line. Copy and paste the url into VSCode as "existing Jupyter Server" as guided here.

@codingToPerfection
Copy link

My current workaround is to open the jupyter server from command line. Copy and paste the url into VSCode as "existing Jupyter Server" as guided here.

I have not tried your method. But I think it will work.

@NickSebClark
Copy link

vani-lu's workaound works just fine for me.

It would be nice if we could skip this step.

@andresxvar
Copy link

My current workaround is to open the jupyter server from command line. Copy and paste the url into VSCode as "existing Jupyter Server" as guided here.

hi, did "jupyter variables" panel work for you?
The matlab code runs, but the panel doesn't show any variables. Not sure if this is a vscode issue or jupyter-matlab-proxy issue.

@prabhakk-mw
Copy link
Member

@andresxvar
Would you please create another issue to track this question / feature request?

@Idiotabtcodes
Copy link

Really appreciate your work here. But there's been a hiccup with it in my end.
In vscode, when I install and activate the official MATLAB extension, I get problems roughly translated as "cannot run code anlysis, '~\Untitled1.ipynb' invald file extension name" from every cell. I can still run the codes as expected when connected to MATLAB Kernal, though.

And if I disable the MATLAB extension and reopen the file, matlab lauguage is not recognised and features like syntax highlightening are gone while the "plain text" code works fine.
I notice that there's a MATLAB icon named Objective-C in select language mode, it can highlight sytax but not auto complete code.

@prabhakk-mw prabhakk-mw changed the title vscode integration How to use MATLABKernel from a VSCode devcontainer? May 14, 2024
@prabhakk-mw
Copy link
Member

Hi @Idiotabtcodes

disable the MATLAB extension and reopen the file, matlab lauguage is not recognised and features like syntax highlightening are gone while the "plain text" code works fine.
I notice that there's a MATLAB icon named Objective-C in select language mode, it can highlight sytax but not auto complete code.

This is a known limitation of with the Linter being used by the MATLAB extension for VSCode. Currently the linter only recognizes files which have ** M or MLX extensions **.

For now, I'd recommend leaving the extension turned on and ignoring these warnings.

The issue has been captured here: mathworks/MATLAB-extension-for-vscode#88

@Idiotabtcodes
Copy link

Thanks for the quick response! I suppose I can live with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants