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

Cannot find and jump to the JavaScript methods in some cases #215

Open
5 tasks done
neiloox opened this issue Mar 30, 2017 · 2 comments
Open
5 tasks done

Cannot find and jump to the JavaScript methods in some cases #215

neiloox opened this issue Mar 30, 2017 · 2 comments

Comments

@neiloox
Copy link

neiloox commented Mar 30, 2017

Prerequisites

Description

In the cases below, Atom cannot find and jump to the correct JavaScript methods by Command+R:

  1. Cannot find and jump to the methods used "allman" style and defined in a JavaScript class.
  2. Cannot find and jump to the methods defined by arrow function.
  3. Cannot find and jump to the methods defined by "const", but identify the "const" keyword as a method.
  4. Can find and jump to the methods defined by "let", but identify the "let" keyword as a method either.

Steps to Reproduce

Save the code below as a *.js file, and use Command+R.

class Test{
    haha() {
        console.log('haha');
    }

    case1()
    {
        console.log('Case 3: used "allman" style and defined in a class');
    }
}

var fn = function() {
    console.log('fn1');
};

var case2 = () => {
    console.log('Case 2: defined by arrow function');
};

const case3 = function() {
    console.log('Case 3: defined by "const"');
};

let case4 = function() {
    console.log('Case 4: defined by "let"');
};

Expected behavior:

All the cases in description can be found and jumped to the correct methods.

Actual behavior:

Case 1 to 4 are not found or not correct by Command+R.
Actual Cases

Reproduces how often:
Always.

Versions

Atom    : 1.15.0
Electron: 1.3.13
Chrome  : 52.0.2743.82
Node    : 6.5.0

apm  1.15.3
npm  3.10.5
node 4.4.5 x64
python 2.7.10
git 2.10.1

Additional Information

Nothing.

@kevinschaich
Copy link

+1 for me. No arrow functions are being detected at all.

@Martinsos
Copy link

Martinsos commented Jan 26, 2018

Biggest problem for me is arrow functions, since in our project we use const foo = () => {} style to create functions.

I understand this might be harder to recognize since they are not really declared hm, stuff on the right of = could be anything, how hard is this for you to support? At least const there guarantees the value will not change, but still.

Maybe you could just pick all the top-level symbols, meaning all variables? However, I guess that would also become a problem if anonymized function is used to create closure for the whole file.
Javascript is tricky hm!

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

No branches or pull requests

3 participants