question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Highlight typing hints in a different color than ordinary code.

See original GitHub issue

Typing hints are displayed in the same color as python variables and statements. That looks somewhat confusing and makes it harder to see at once where is a typing hint, where a variable name is defined and where is an actual code.

E.g., the line below up to ‘origin’ is in the same color.

  remote: pygit2.Remote = gitrepo.remotes['origin']

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:8
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
vpetrovykhcommented, Oct 28, 2019

I’ll see what I can do to highlight type hints better. I guess the starting point would be to at least give them all a scope of their own like meta.typehint.python.

1reaction
cardoso-netocommented, Jun 5, 2020

It appears Github’s highlighting decided that everything that starts with a capital letter deserves that same color. I’m still inclined towards having separate scopes for typehints and for normal classes, so we can choose different colors.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Semantic Highlighting for Type Hints · Issue #335 - GitHub
However it seems like type hints don't have any special semantic (usually ... and I'm wanted type hints to have a different color...
Read more >
Syntax Highlight Guide | Visual Studio Code Extension API
Syntax highlighting determines the color and style of source code displayed in the Visual Studio Code editor. It is responsible for colorizing keywords...
Read more >
Semantic Code Highlighting - Visual Studio Magazine
Syntax-based coloring "can only highlight by what the code looks like, not by what the code means, since that requires wider knowledge," notes ......
Read more >
Syntax highlighting - Wikipedia
Syntax highlighting is a feature of text editors that are used for programming, scripting, ... The feature displays text, especially source code, in...
Read more >
Colors and fonts | IntelliJ IDEA Documentation - JetBrains
and select Restore Defaults. You cannot remove predefined color schemes. To define color and font settings, open the Editor | Color Scheme page ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found