jupyterlab_code_formatter icon indicating copy to clipboard operation
jupyterlab_code_formatter copied to clipboard

Jupyterlab Code Formatter Error on R kernel

Open ZhengJIN94 opened this issue 2 years ago • 3 comments

Hello,

The Code Formatter can work on the default ipykernel (Python3), however, after I add another independent kernel (R 4.2.1), it returned error, even though I used the same format.

Is there anyway to solve it?

Thank you so much.

ZhengJIN94 avatar Oct 08 '23 14:10 ZhengJIN94

I was getting the following error when using Jupyterlab Code Formatter in an irkernel notebook: Jupyterlab Code Formatter Error Unable to find default formatters to use, please file an issue on GitHub.

The plugin defaults for the default_formatter setting look like this:

    "preferences": {
        "default_formatter": {
            "python": [
                "isort",
                "black"
            ],
            "R": "formatR",
            "rust": "rustfmt",
            "c++11": "astyle"
        }
    },

I added the following to my user preferences and it seems to work. Basically change the "R" key to lowercase.

{
    "preferences": {
        "default_formatter": {
            "r": "formatR",
    },
}

Perhaps this broke with JupyterLab 4? I'm running JupyterLab 4.0.11, R 4.3.2, IRkernel 1.3.2

onepunchdan avatar Jan 21 '24 01:01 onepunchdan

Thanks @onepunchdan, was wondering where the issue was coming from. Using R 4.4.1, jupyterlab 4.1.6, IRkernel 1.3.2 and had the same problem.

G3ordan1 avatar Aug 08 '24 15:08 G3ordan1