jupyterlab-lsp icon indicating copy to clipboard operation
jupyterlab-lsp copied to clipboard

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

Open YongcaiHuang opened this issue 1 year ago • 1 comments
trafficstars

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.

YongcaiHuang avatar Jun 04 '24 16:06 YongcaiHuang

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:

  • https://github.com/pappasam/jedi-language-server/pull/231
  • https://github.com/python-lsp/python-lsp-server/pull/533

krassowski avatar Jun 04 '24 17:06 krassowski