ternjs / tern_for_sublime

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

Trigger module name autocomplete #168

Closed seanders closed 6 years ago

seanders commented 6 years ago

Hello,

I'm having trouble completing module paths like I see working in this demo. I'm using Sublime.

I spun up the tern server locally with the --verbose flag. I don't see a request coming in for trying to resolve the module path.

For example: Say I have this: src/ |..Foo.js |..Bar.js

// Foo.js
export default () => {}
// Bar.js
import Foo from './' //Manually triggering the autocomplete after `/` isn't returning `Foo`

Heres my config:

{
  "ecmaVersion": 7,
  "plugins": {
    "webpack": {
      "configPath": "./config/webpack.config.dev.js"
    }
  },
  "loadEagerly": ["src/**/*.js"],
  "dontLoad": ["node_modules/**"]
}

Looking up module definitions and autocompletions of attributes on imported modules is working fine, however. Any help would be greatly appreciated.

marijnh commented 6 years ago

It seems the ST plugin is explicitly disabling completions inside strings (via #12). Attached patch removes this, since it breaks features like this.