Inconsistent info in tooltips
For the same code, I keep getting different stuff in my tooltip hints:
1.
2.
3.
I would prefer for it to always be 3, but most of the time I get the result from image 2. Is there anything I can do to make it so that it is always like image 3?
Here are my Tern user settings:
{
"tern_argument_hints": true,
"tern_output_style": "tooltip",
"tern_argument_completion": true
}
Thanks in advance!
This seems to actually happen if you close the editor. If you create the sum function during the current session and write the comments like so:
sum.js
/**
* Returns the sum of two numbers
* @param {Number} a The first operand
* @param {Number} b The second operand
* @return {Number} The sum of both operands
*/
function sum (a, b) {
return a + b
}
module.exports = sum
and then i go into app.js and do the following:
const sum = require('./sum')
sum(
I get the correct tooltip:
However, if I restart the editor and try to type sum( again, I get a different output:
Is there any way around this?
Could you provide me with the relevant part of your math.js file, so that I can see if I can reproduce this?
Ah sorry, it was actually the same thing as sum.js I just named it differently that time.
Steps to reproduce:
1. Create an app.js and sum.js and open them in Sublime
2. Add the following to sum.js:
/**
* Returns the sum of two operands
* @param {Number} a The first operand
* @param {Number} b The second operand
* @return {Number} The sum of both operands
*/
function sum (a, b) {
return a + b
}
3. Add the following to app.js:
const sum = require('./sum')
sum(
At this point, everything works fine:
Now, if you exit out of Sublime and reopen it, and then try doing sum( again, you will get this output instead:
I didn't manage to reproduce this. If I add the module.exports = sum line to the content you describe, I get working argument hints.