mathworks / jupyter-matlab-proxy

MATLAB Integration for Jupyter enables you to run MATLAB code in Jupyter Notebooks and other Jupyter environments. You can also open MATLAB in a browser directly from your Jupyter environment to use more MATLAB features.
Other
284 stars 36 forks source link

Correct code text highlighting for transpose vs. character array #43

Closed tylerlekang closed 1 year ago

tylerlekang commented 1 year ago

System: Windows 10 Matlab 2023a Python 3.8.16 (via Miniconda) Jupyter Lab 3.6.3 (via conda install)

ISSUE: The following screenshot shows how the text is being highlighted as if it were a character array: Screenshot 2023-06-30 110535

However, in VS Code with the MATLAB extension, it correctly recognizes the difference: Screenshot 2023-06-30 110554

Note: Once again, I recognize that the ultimate issue here may just be Jupyter Lab and not jupyter-matlab-proxy. Python doesn't use the same character for transposes as defining character arrays/strings, so I have no prior experience there with this issue.

philipc-mw commented 1 year ago

Thank you for the detailed bug report! We are currently investigating solutions to the issue, and will update when we have more information.

tylerlekang commented 1 year ago

@philipc-mw Thanks for the comment!

For what it is worth (as I mentioned in https://github.com/mathworks/jupyter-matlab-proxy/issues/41 ), this is not an issue when building/editing a MATLAB notebook in VS Code (method for manually setting that up is given in the linked issue).

Again, no idea why VSC is able to succeed while JL fails, but it is working in VSC.

Screenshot: image

prabhakk-mw commented 1 year ago

@tylerlekang , out of curiousity. Do you also have the MATLAB extension for VScode installed in the example shown above? Does this issue show up if you disable that extension?

tylerlekang commented 1 year ago

@prabhakk-mw you are correct that all of the functionality I'm highlighting in VS Code is stemming from the MATLAB extension that I have installed. If I disable the extension, then VSC isn't able to do much with .m or MATLAB notebooks.

I'm not sure how VSC is able to apply the extension to notebooks, as I believe it is only intended to be helpful with editing .m files.

One thing that does not transfer over to notebook usage is that when editing .m files, the extension provides some intellisense auto-complete capabilities (though more limited than with Python or in the MATLAB editor). This does not transfer to notebooks that I can see.

prabhakk-mw commented 1 year ago

@tylerlekang This seems to be a limitation with the syntax highlighting rules that can be used by the JupyterLab 3 infrastructure. We do have plans to upgrade to newer versions of CodeMirror and JupyterLab, and we would only be able to fix this issue at that time.

Until then, since you are using VSCode, perhaps the usage of the MATLAB Extension for VSCode resolves the issue for you.

Please watch #56 for updates on when we publish syntax highlighting support for JupyterLab 4.

Closing this issue as we do not plan on fixing this for JuptyerLab 3.