Pylance-release: Type 'None' not getting colorization properly

Created on 12 Mar 2021  路  4Comments  路  Source: microsoft/pylance-release

Environment data

  • Pylance Type Checking Mode: basic
  • Language Server version: 2021.3.2-pre.1
  • OS and version: Windows 10 Pro Insider Preview Build 21313
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.7 64-bit

Expected behaviour

Expected type 'None' to still be colored blue despite the single quotes.

Actual behaviour

'None' gets colored as a string and the same goes for the vertical bar that separates types.

image

bug

All 4 comments

Thanks for the report. This looks like a bug and we will investigate.

thanks!

Would it be possible to get the vertical bar and brackets to also turn white?

We tokenize names, and then leave the other tokens up to the editor to color (in this case, they get the string literal color). What you're calling "white" is actually just the "unknown" token type when shown in regular code, i.e. what you get if you just open a new file with no language and start typing.

Changing that behavior would be a separate enhancement we could consider, as we've designed it to work the current way (versus None not being colored is a bug; None is a name).

Ah cool, thanks for explaining!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

munael picture munael  路  5Comments

iwoloschin picture iwoloschin  路  3Comments

ynouri picture ynouri  路  3Comments

yankyhoffman picture yankyhoffman  路  5Comments

martinjohndyer picture martinjohndyer  路  4Comments