Some types of variables are missing scopes #635
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: http://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: http://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
In atom 1.34, I am trying to update my syntax sheet that worked with the old syntax parser to take advantage of the tree-sitter parsers. Without any other extension enabled, the examples below are just from toggling the use tree sitter parsers option. (examples below are using https://github.com/thomaslindstrom/no-caffeine-syntax)
Steps to Reproduce
Edit by @rsese to add code for copy/paste
function functionName(param1, param2, param3) {}
function functionName(param1, param2, param3 = 1) {}
functionName(param1, param2).then((result) => {});
functionName(param1, param2).then(({ result }) => {});
const newThing = calculate(param1, store.getState())
Have code like this with tree sitter parsers disabled:
Enable tree sitter parsers, and your code will look like this:
Problems seen between the two:
Line 1: No problems
Line 2: No scope present for param3
Line 3: No scope present for param1 and param2
Line 4: Same as line 3 except also no scope present for result
Line 5: No scope present for param and store
Notes:
line 4 lets me differentiate result from result in line 3
line 5 lets me differentiate store from param1
Expected behavior: All variables would have the unique scopes to target styles like we could with the old parser
Actual behavior: New parser does not target some variables with scopes to allow consistent styling with the old parser
Reproduces how often: 100%
Versions
Atom 1.34.0
Electron 2.0.16
Chrome 61.0.3163.100
Node v8.9.3
Additional
See #630