atom / language-typescript

TypeScript language package for Atom
Other
21 stars 33 forks source link

TypeScript `export =` syntax not highlighted with inline declarations #30

Open wolfy1339 opened 5 years ago

wolfy1339 commented 5 years ago

Prerequisites

Description

The export = syntax isn't highlighted

Steps to Reproduce

  1. Create a new TypeScript file
  2. export an inline declaration (an object, a function, a string, etc.) (e.g. export = new Array();)
  3. move that inline assignment to a variable, and export that variable
  4. Note difference in scopes and highlighting

Expected behavior: For the export = to always be highlighted using the proper scopes

Actual behavior: No scopes are added thus the highlighting never happens

Edit by @rsese to add screenshot

export-scope

Reproduces how often: 100%

Versions

You can get this information from copy and pasting the output of atom --version and apm --version from the command line. Also, please include the OS and what version of the OS you're running.

$ atom --version
Atom    : 1.35.0-nightly1
Electron: 2.0.14
Chrome  : 61.0.3163.100
Node    : 8.9.3
$ apm --version
apm  2.1.3
npm  6.2.0
node 8.9.3 x64
atom 1.35.0-nightly1
python 2.7.15
git 2.19.2.windows.1
visual studio 2015

Additional Information

When a variable is exported using this syntax, it gets the scope syntax--keyword syntax--control

wolfy1339 commented 5 years ago

I think that it might help if this was brought up to date with changes from language-javascript

rsese commented 5 years ago

Thanks @wolfy1339! Can you share a couple of small code snippets to go along with your repro steps? We just want to make sure we're on the same page.

wolfy1339 commented 5 years ago

Sure thing. Here are some:

export = () => { }
export = {}
export = []
wolfy1339 commented 5 years ago

Here's some more too:

export = new Array();
export = Buffer.from()
rsese commented 5 years ago

Great thanks @wolfy1339 :bow: