tern_for_vim: Tern js doesn't auto complete when expected

I added two images of my problem. The first shows that Vim doesn’t show to docs for whatever function, but when I prepend “this.” it does? Why does this happen, am I missing some .tern-project setting?

screen shot 2015-03-31 at 23 41 07 screen shot 2015-03-31 at 23 41 21

My .tern-project

{"libs": ["browser", "ecma5"] }

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 1
  • Comments: 16 (6 by maintainers)

Most upvoted comments

I think I found the solution!

YouCompleteMe gives two types of completion. I want the semantics and stopped the other. YCM got this option to set triggers:

let g:ycm_semantic_triggers =  {
  \   'c' : ['->', '.'],
  \   'objc' : ['->', '.'],
  \   'ocaml' : ['.', '#'],
  \   'cpp,objcpp' : ['->', '.', '::'],
  \   'perl' : ['->'],
  \   'php' : ['->', '::'],
  \   'cs,java,javascript,d,python,perl6,scala,vb,elixir,go' : ['.'],
  \   'vim' : ['re![_a-zA-Z]+[_\w]*\.'],
  \   'ruby' : ['.', '::'],
  \   'lua' : ['.', ':'],
  \   'erlang' : [':'],
  \ }

I have to add a python regex to match any 3 letters, then it is fixed and this can be closed now I guess.