atom / language-javascript

JavaScript language package for Atom
Other
194 stars 236 forks source link

Missing variable syntax scopes #630

Closed pbarbiero closed 6 years ago

pbarbiero commented 6 years ago

Prerequisites

Description

Missing extra variable syntax wrappers when using tree-sitter

Settings > Core > Use Tree Sitter Parsers - Enabled tree-sitter

Settings > Core > Use Tree Sitter Parsers - Disabled non-tree-sitter

Versions

Atom : 1.32.2 Electron: 2.0.9 Chrome : 61.0.3163.100 Node : 8.9.3

Additional Information

Both examples above are without language-babel and without customFileTypes in config.cson

Workaround with tree sitter parsers enabled is to have language-babel and this in my config.cson:

    customFileTypes:
      "source.js.jsx": [
        "js"
        "jsx"
      ]

The downside to the workaround is all my .js files show up as .jsx files when using file-icons

rsese commented 6 years ago

Thanks for the report! Looks like this is fixed in 1.34 which is currently in beta:

js-param

Going to go ahead and close but let me know if I misunderstood anything.

pbarbiero commented 5 years ago

Hi @rsese

I am testing with 1.34 and I still see some problems. I am trying to update my syntax to utilize the different scopes (and lack of nested scopes now too) and I cant figure out how to solve some situations -- are these changes by design or maybe an oversight?

scope-issues

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

Example of what happens when I disable tree-sitter:

scope-working

Notes: line 4 lets me differentiate result from result in line 3 line 5 lets me differentiate store from param1

rsese commented 5 years ago

Thanks @pbarbiero - since the initial example originally reported looks ok would you mind opening a new issue with template filled out and with the details from https://github.com/atom/language-javascript/issues/630#issuecomment-452845037?