Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find definition in a jsx project #1018

Open
knobo opened this issue May 8, 2019 · 1 comment
Open

Find definition in a jsx project #1018

knobo opened this issue May 8, 2019 · 1 comment
Assignees

Comments

@knobo
Copy link

knobo commented May 8, 2019

Run tern-find-definition in emacs when standing on InputElement when I have the jsx extention, it woks.

How can I make tern look for jsx files by default?

import InputElement from './InputElement.jsx';
^[[1;2CRequest: {
  "query": {
    "end": 98,
    "file": "src/input/InputElementBlock.jsx",
    "type": "definition",
    "variable": null
  }
}
Response: {
  "origin": "src/input/InputElement.jsx",
  "start": 145,
  "end": 150,
  "file": "src/input/InputElement.jsx",
  "contextOffset": 50,
  "context": "nst block = bemCn('input');\n\nexport default class "
}

But without the jsx extention
Like this:

import InputBlock from './InputBlock';

It does not work.

Request: {
  "query": {
    "end": 153,
    "file": "src/input/InputElementBlock.jsx",
    "type": "definition",
    "variable": null
  }
}
Response: {
  "origin": "node_modules/react-transition-group/TransitionGroup.js"
}
@othree othree added emacs and removed emacs labels May 23, 2019
@othree othree self-assigned this May 23, 2019
@othree
Copy link
Collaborator

othree commented May 23, 2019

I am think to add a official jsx plugin to deal with this.

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

No branches or pull requests

2 participants