MagicStack / MagicPython

Cutting edge Python syntax highlighter for Sublime Text, Atom and Visual Studio Code. Used by GitHub to highlight your Python code!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The word `file` is highlighted as if it has special meaning

dan1994 opened this issue · comments

  • Editor name and version: Visual Studio Code 1.47.2
  • Platform: Windows 10 2004 (Build 19041.388)
  • Color scheme: Dark+
  • MagicPython version: None (Comes builtin in VS Code according to the README)
  • A sreenshot: Provided in the issue description below.
  • 5-10 lines of surrounding code: N/A

The following description is copy pasted from an issue I accidentally opened in the VS Code python extension repo (#13047). I was referred to this repo from there.

Expected behaviour

The word file doesn't hold any special meaning in python as far as I know (I opened and interpreter typed file and got NameError).
That being the case I would expect it to be highlighted in the same ways as other variable names (which in my case is default color).

Actual behaviour

The word file is highlighted in light blue, the same as global python variables such as __name__ and __file__.

image

Steps to reproduce:

  1. Create a new python file
  2. Write the word file in it

It has a special meaning - it's a builtin in Python 2. The scope name includes "legacy" in it, IIRC.

My bad, Didn't know that.
Thanks for the clarification