7

I just installed WPy64-3940 that comes with JupyterLab 3.0.14 .
To my surprise, now my code comes decorated with things called "pycodestyle".
As you can see below, the code is underlined in orange and a popup can appear.
I do not like that at all, it perturbs my reading.
Would you know where this comes from and how I can disable this?

Thanks
Michel

enter image description here

1 Answers1

13

This is not a built-in feature of JupyterLab, but an extension called jupyterlab-lsp. As one of the authors I am surprised to see it included by default on the WPy64 distribution, and sorry you don't like it. Here are three potential solutions:

  1. Ignore this specific diagnostic message (recommended). Right click to bring up context menu and select "Show diagnostics panel"; hover mouse over the row with diagnostic message that you do not like, right click, select "Ignore diagnostics like this".

bring up context menu and select "Show diagnostics panel"

hover mouse over the row with diagnostic message that you do not like, right click, select "Ignore diagnostics like this"

  1. Disable pycodestyle diagnostic provider completely in setting of the language server. Click on "Settings" menu (top menu bar) → "Advanced Settings Editor" and choose "Language Servers" tab. Copy paste the following settings ("pyls" is the old server, "pylsp" is the new one - only one is needed but I do not know which one you are using); you can also disable other sources of diagnostics for this language server here:
{
  "language_servers": {
    "pyls": {
      "serverSettings": {
        "pyls": {
          "plugins": {
            "pydocstyle": {
              "enabled": false
            },
            "pyflakes": {
              "enabled": true
            },
            "flake8": {
              "enabled": false
            }
          }
        },
        "pylsp": {
          "plugins": {
            "pydocstyle": {
              "enabled": false
            },
            "pyflakes": {
              "enabled": true
            },
            "flake8": {
              "enabled": false
            }
          }
        }
      }
    }
  }
}
  1. Disable all diagnostics by going to "Diagnostics" tab and adding a catch-all regular-expression rule like this:
{
    "ignoreMessagesPatterns": [".*"]
}

enter image description here

  1. Disable the LSP extension altogether. It is probably best to consult whoever creates WPy64-3940 on how to do this.
krassowski
  • 13,598
  • 4
  • 60
  • 92
  • Thanks a lot. I am sorry too that I do not like it. –  May 24 '21 at 12:29
  • Thanks! Sorry that I do not like it! It is because I do not care for pep rules so much, I just know they exists. –  May 24 '21 at 12:31
  • 2
    Too be honest I have E402 disabled too - it is just to strict for notebooks ;) There is some more configuration hints in https://github.com/krassowski/jupyterlab-lsp#configuring-the-servers – krassowski May 24 '21 at 12:34
  • Thanks I will have a look in it once my install work is over. It could be interresting later! –  May 24 '21 at 12:36
  • Just used lsp a little bit. I do like it! (except for underlining code) I specially like "goto definitions" and "rename". Reminds me of the best of VS! –  May 25 '21 at 08:49