Skip to content

Highlighting occurrences of symbol incorrectly highlights words, not symbols. #3859

@therealpeterhua

Description

@therealpeterhua

Environment data

  • VS Code version: 1.30.1
  • Extension version (available under the Extensions sidebar): 2018.12.1
  • OS and version: MacOS
  • Python version (& distribution if applicable, e.g. Anaconda): 2.7
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions: Only this one

Expected behaviour

Highlighting occurrences of a symbol (eg. activating the command "Trigger Symbol Highlight" from the palette, or moving into a word via the cursorRight command) should highlight all occurrences of a symbol, similar to the behavior in Javascript.
screenshot 2019-01-03 14 54 07
^ Here, as expected, the ASDF symbol is highlighted, but ASDF_QWER, being a different symbol, is not.

Actual behaviour

Highlighting symbol occurrences actually highlights occurrences of the word. If the word is present in more than one symbol, multiple symbols are highlighted.

screenshot 2019-01-03 14 53 16

^ Here, the `asdf` symbols are highlighted, but the `asdf` portion of `asdf_qwer` is also unexpectedly highlighted, even though it belongs to a different symbol.

Steps to reproduce:

  1. Paste the following into an empty python file.
asdf = 3
asdf_qwe = 4
asdf = 7
  1. Put cursor inside the asdf on the first line.
  2. After a split second, the inconsistent highlighting will appear.

Doing these steps on a Javascript file will correctly highlight only the asdf symbols on lines 1 and 3.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions