tern icon indicating copy to clipboard operation
tern copied to clipboard

Find definition in a jsx project

Open knobo opened this issue 5 years ago • 1 comments

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"
}

knobo avatar May 08 '19 08:05 knobo

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

othree avatar May 23 '19 15:05 othree