carlitux / deoplete-ternjs

deoplete.nvim source for javascript
MIT License
277 stars 24 forks source link

Weird issue with files when opened from inside a project. #27

Closed ahmedelgabri closed 8 years ago

ahmedelgabri commented 8 years ago

I have a weird issue, I have a project with a .tern-profile file. When I open any .js file from inside that project folder, tern completion doesn't work but if I open the same exact from a different directory everything is working fine!

This is the project .tern-project

{
  "libs": [
    "ecma5",
    "ecma6",
    "browser",
    "jquery"
  ],
  "loadEagerly": [],
  "async": true,
  "dontLoad":[
    "node_modules",
    "dist",
    "tmp",
    "vendor",
    "public"
  ],
  "exclude": [
    "node_modules/**",
    ".git/**",
    "*.min.js",
    "*.prod.js",
    "*.debug.js",
    "tmp",
    "vendor"
  ],
  "plugins": {
    "doc_comment": {
      "fullDocs": true
    },
    "complete_strings": {},
    "es_modules": {},
    "modules": {},
    "node": {},
    "commonjs": {},
    "node_resolve":{}
  }
}

This is my global .tern-config

{
  "libs": [
    "ecma5",
    "ecma6",
    "browser"
  ],
  "loadEagerly": [],
  "async": true,
  "plugins": {
    "doc_comment": {
      "fullDocs": true
    },
    "complete_strings": {},
    "es_modules": {},
    "modules": {},
    "node": {},
    "commonjs": {},
    "node_resolve":{}
  }
}
This is what I tried so far, but nothing changes:

No idea how can I debug this any further & how to fix this problem.

carlitux commented 8 years ago

@ahmedelgabri I tested and it is working fine... take a look if you have .tern-port on your project directory, if there is any you have to delete it.

ahmedelgabri commented 8 years ago

Thanks! @carlitux, but why is that a problem in the first place? I thought .tern-port is required for tern_vim to work?

carlitux commented 8 years ago

It happens to me when vim crashed or my computer do, too.

.tern-port is created when tern starts so if you are using tern_for_vim it will start an instance server and this source just request to that tern instance parsing .tern-project to know where do http requests.