ternjs / tern_for_sublime

Sublime Text package adding Tern support
MIT License
803 stars 54 forks source link

Doesn't work export default. #165

Open AStaroverov opened 7 years ago

AStaroverov commented 7 years ago

My config:

{
  "ecmaVersion": 6,
  "libs": [
    "ecma5",
    "ecma6",
    "browser",
    "react"
  ],
  "dontLoad": [
    "**/node_modules/**"
  ],
  "plugins": {
    "node": {},
    "es_modules": {
      "baseUrl": "./"
    },
    "webpack": {
      "configPath": "./build/fake.js"
    }
  }
}

I couldn't find a clear dependence, but often go to definition does not work when working with export default.

Example:

// app-platform/containers/app/container/index.js
import { connect } from 'react-redux'

import { composeSelectors } from 'app-platform/helpers/selectors'
import * as environment from 'app-platform/selectors/environment'
import * as locale from 'app-platform/selectors/locale'

import App from 'app-platform/components/app/container'

const selector = composeSelectors({
  locale: locale.get,
  environment: environment.get
})

export default connect(selector)(App)

And this doesnt work

import App from 'app-platform/containers/app/container'

What i do wrong?

AStaroverov commented 7 years ago

After refactoring first file it now work..

nickw444 commented 7 years ago

Yep, appears to be a bug in ternjs: https://github.com/ternjs/tern/issues/896.