microsoft / PTVS

Python Tools for Visual Studio
https://aka.ms/PTVS
Apache License 2.0
2.53k stars 676 forks source link

VS2022 Python Fonts and Colors Customization Regression from VS2019, Defies Microsoft Documentation #7082

Closed schulmaster closed 9 months ago

schulmaster commented 2 years ago

Describe the bug VS2022 Python Fonts and Colors Customization Regression from VS2019, Defies Microsoft Documentation. No IDE syntax categories at all. Just broad spectrum Interactive colors.

Steps to Reproduce 1.Consult Documentation: https://docs.microsoft.com/en-us/visualstudio/python/editing-python-code-in-visual-studio?view=vs-2022

  1. Read this section: "To customize the colors, go to Tools > Options > Environment > Fonts and Colors and modify the Python entries in the Display items list:"
  2. Observe how VS2022 does not conform to documentation

Expected behavior I would love for Python Syntax highlighting to work like VS2019, and/or to conform to Microsoft's own documentation

Additional context and screenshots [Add any other information such as screenshots, error message, or stack trace] I will attach documentation and reality.

pydoc image image

AdamYoblick commented 1 year ago

Pylance is now responsible for determining identifiers, operators, functions, etc. Are there still options in VS to change the colors of these things? If so, we might need to look to see if we are wiring these up correctly when they come back from pylance so VS can change their colors.

AdamYoblick commented 1 year ago

(and those docs need to be updated with VS2022 UI)

StellaHuang95 commented 1 year ago

We didn't provide tmThem file along with TextMate grammar. tmTheme file is used to map the scopes defined in TextMate grammars (e.g. keyword.operator.logical.python) to VS standard color names that are customizable via Tools/Options/Fonts and Colors. Unfortunately for the custom colors (e.g. Python Function) to appear there we will need in-proc VS extension to register them. VS doesn’t support tokenColorCustomizations like VS Code.

StellaHuang95 commented 1 year ago

The Python display items supported in vs2019 are:

Textmate: https://dev.azure.com/devdiv/DevDiv/_git/VS-Platform?path=%2Fsrc%2FEditor%2FTextMate%2FVSWindows%2FSetup%2FStarterkit%2FExtensions%2Fpython%2Fsyntaxes%2FMagicPython.tmLanguage&_a=contents&version=GBmain

ShiShuyang commented 11 months ago

It has been one and a half year since this issue was raised. I have noticed that many duplicated issues were opened and closed for the same question. This may be a common issue that lots of user desire to solve. And, this function works well in VS 2019 and in VS code. Looking forward to fixing this issue soon! Best wishes!

cwebster-99 commented 11 months ago

Thanks for raising this issue! PTVS VS 2022 documentation has been updated to exclude these color setting options for now. This should address the documentation mismatch raised in this issue. More investigation is needed to see which code coloring settings can be added to VS 2022.