Description
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Reproduced the problem in Safe Mode: https://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: https://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
With Tree-Sitter enabled, inside a JavaScript file, the scope is reported as *
if the cursor is placed on an empty line. This causes JavaScript code snippets to not work at all.
As soon as I place the cursor on any piece of code the scope is properly reported as being source.js
+ whatever syntax node is currently under the cursor.
Steps to Reproduce
- Enable Tree-Sitter parsers
- Create a new, empty JavaScript file or open an existing JS file and place the cursor on an empty line (ie. the last line)
- Log the cursor's scope
- Observe scope being reported as just
*
instead ofsource.js
Expected behavior: Scope is always reported as source.js
regardless of whether or not there is a syntax node under the cursor
Actual behavior: Scope is reported as *
when there is no syntax node under the cursor
Reproduces how often: All the time, for JavaScript files only (tested with Makefile
, .json
, .yaml
, .sql
, scopes work correctly here)
Versions
Atom : 1.32.0-nightly3
Electron: 2.0.7
Chrome : 61.0.3163.100
Node : 8.9.3
Additional Information
I think this started happening sometime around 1.31.0-nightly6, not sure precisely when.
Obligatory screenshot with the scopes Atom reported as I tested it with various files.