ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Semantic Highlighter

by kapitanluffy ST3

🌈 Highlights similar variables on focus

Details

Installs

  • Total 84
  • Win 43
  • Mac 21
  • Linux 20
Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1
Windows 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 2 0 0 0 1 1 1 1 1 1 0 2 0 0 0 1 2 0 1 0 0 0 0 0 0 2 1 1 3 1
Mac 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 2 0 0 0 0 0 0 0 2 4 1
Linux 0 1 0 0 0 0 0 1 0 1 0 0 0 0 1 1 1 0 0 1 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 1 0 1 2 1

Readme

Source
raw.​githubusercontent.​com

Semantic Highlighter

🌈 Highlights similar variables on focus

It underlines variables with the same string (for now). Sublime does this by double-clicking a word but why do two if you can do one!

oooh but that is not “semantic”.. - a wise man

Sure. Here are suggestions for you though.

Installation
  • Install from packagecontrol.io or unpack the zip in your packages directory
Usage
  1. Move your cursor to a variable using the following:
- Mouse 🖱
- Arrow keys ⌨
  1. See colored underlines.

Preview

Features
  • See beautiful colors 🌈
  • Lessens stress (especially when accompanied with ☕)
  • Improve understanding of your co-worker's gibberish code 😒
  • Easily see where that variable has been hiding 👀

Commands

  • semantic_highlighter_jump (ctrl+l, ctrl+j) Jump to the next variable in scope

  • semantic_highlighter_edit (ctrl+l, ctrl+e) Edit all the similar variables in scope

The color-scheme file

The package comes with a customizable template color scheme that has 144 varying HSL representations. For now, I simply fetch a random number and match it.

Creating a custom analyzer

The plugin will highlight symbols based on an analyzer. Since I cannot do every programming language, you can further improve variable detection by creating your own language analyzer.

For a quick intro, the analyzer class has a getBlockScope method that should return one of the following:

  • A scope name string of the block the symbol belongs to
  • None if the selection is a valid symbol but does not belong to any blocks (i.e. global variable)
  • False if the selection is not a valid symbol

To understand how “scopes” work, check out the following links:

Included analyzers
  • A generic fallback analyzer
  • Python
  • PHP
Support

You can always support me via Patreon or Ko-fi

License

MIT

Links