jupyter-lsp / jupyterlab-lsp

Coding assistance for JupyterLab (code navigation + hover suggestions + linters + autocompletion + rename) using Language Server Protocol
https://jupyterlab-lsp.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.82k stars 148 forks source link

Support for highlighting code by different color according to types like in VSCode #1090

Open YongcaiHuang opened 5 months ago

YongcaiHuang commented 5 months ago

Elevator Pitch

any plan to support the highlight code by different color according to types (instance, function, class, package etc.) like in VSCode?

Motivation

the highlight code by different color according to types can quick help me to find and identify what I have write, especially when there are many lines and content in one cell.

in VSCode:

image

in Jupyter Notebook:

image

by comparing the same code snippet, higher readability in VSCode, even when I change different way of defining. In Jupyter Notebook, function or class is only highlighted following dot .. Also, the colors for package, class, function, instance are different with higher readability.

krassowski commented 5 months ago

If someone is willing to contribute a PR I am happy to review it. There is not many LSP servers which implement semantic highlighting - basedpyright is the only free OSS Python server that does it today, but there are PRs for other servers too: