I am using the ternjs for vim plugin (based on tern js project) and standard vim omni-completion.
I am unable to get basic eager loading working with tern or I am misunderstanding how the loadEagerly
option is supposed to work.
Here is my setup of files:
% tree -a
.
├── index.html
├── index.js
├── lib.js
├── Session.vim
└── .tern-project
file: index.html
<html>
<head>
<title>test tern</title>
</head>
<body>
<p>Hello world</p>
<script src="lib.js"></script>
<script src="index.js"></script>
</body>
</html>
file: lib.js
var namespace = {
fruits : ['apple', 'bannana', 'orange'],
text : "A tremor in the Force. The last time I felt it was in the presence of my old master."
};
function go(compare_me) {
return compare_me === "reference";
}
file: .tern-project
{
"libs": [
"ecma5",
"browser"
],
"loadEagerly": ["*.js"],
"plugins": {
"node": {}
}
}
tern itself is working, e.g. if I am in lib.js
and type:
gCtrl-xCtrl-o
go (fn)
appears in autocompletion dropdown list and a function signature appears in the preview window:
fn(compare_me: ?) -> bool
Now when I open index.js
I am expecting "loadEagerly" to cause variables and functions from lib.js
to appear in completion.
But its not - autocompletion is unresponsive, why?
**/*
patterns to work with loadEagerly or sometimes pattern A works but sometimes I need pattern B etc... But noone has seemed to raise the issue thatloadEagerly
is totally broken. But maybe for vim it is...?loadEagerly
is probably just transferred by the plugin. There are more issues on ternjs about theloadEagerly
than in the plugin.