Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Some types of variables are missing scopes #635

Open
1 task done
pbarbiero opened this issue Jan 18, 2019 · 1 comment
Open
1 task done

Some types of variables are missing scopes #635

pbarbiero opened this issue Jan 18, 2019 · 1 comment

Comments

@pbarbiero
Copy link

pbarbiero commented Jan 18, 2019

Prerequisites

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:
old syntax parser

Enable tree sitter parsers, and your code will look like this:
tree sitter parser

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

@rsese
Copy link

rsese commented Jan 18, 2019

Thanks for creating a new issue for this @pbarbiero - reproduced with 1.34.0 on macOS 10.12.6.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants