syntax-highlighting

Make PyQt syntax highlighting work when loading from .ui file

Make PyQt syntax highlighting work when loading from .ui file Question: If elements of a PyQt/PySide GUI are defined programmatically, then any IDE can easily understand what they are, do syntax highlighting, show suggested methods etc. For instance, it may look like this in VS Code: However, if the GUI is not defined programmatically, but …

Total answers: 1

Python code is not syntax highlighted in Pycharm notebook?

Python code is not syntax highlighted in Pycharm notebook? Question: In the screenshot we see a pretty normal-ish python code cell within the Pycharm notebook viewer The viewer "understands" the notebook: it is bringing up the managed Jupyter server option and knows this is [python] code: So then where did the syntax highlighting go to? …

Total answers: 1

Syntax highlighting in Vscode for type hints

Syntax highlighting in Vscode for type hints Question: I am using the Dark++ theme but personalising a lot of colours. Everything works fine but one small thing: only the basic types are properly highlighted. For example this "editor.tokenColorCustomizations": { "comments": "#707070", "keywords": "#adc5ee", "types": "#bbbbbb", "strings": "#bdceb7" } gives me the following picture: I would …

Total answers: 1

Should I avoid using "str" as a variable name in Python?

Should I avoid using "str" as a variable name in Python? Question: I’ve noticed that certain variable names in Python get flagged up by Vim in blue highlight, whereas others do not. I’m familiar with the concept of reserved words, per this question, but from looking it up, "str" does not appear to be one …

Total answers: 3

What do the Python VSCode syntax colors mean?

What do the Python VSCode syntax colors mean? Question: VSCode has syntax highlighting for the Python language. I can’t find any explanation for how each token is classified and organized into colors. Specifically, why are some keywords the same color, but some are different? Looking at this code: for…in shows the keywords as the same …

Total answers: 3

How to use sublime 3 jinja2 highlighter

How to use sublime 3 jinja2 highlighter Question: I have a problem with jinja2 highlighter in sublime 3.All the files associated with .html extensions don’t recognize jinja templates blocks..I searched the web but the only solution I found is to make a .jinja.html custom extension..anyone got any idea how to solve this?..This is the plugin …

Total answers: 3

Preserving whitespace with Pygments

Preserving whitespace with Pygments Question: I’m currently writing an application that uses Pygments to perform syntax highlighting. The problem I’m having is any code I process with Pygments has the leading and trailing whitespace in the file removed, and a single line break added to the end. Is there a way to make Pygments preserve …

Total answers: 1