Only replace the 'fn' in the function type hint if the token that was called looks like an identifier/property.  If it is an expression, resulting in a function call, then just display 'fn' since we don't have a way to determine a 'name' for the called function.
This commit is contained in:
Erik Tierney committed 2013-05-07 14:20:19 -04:00
1 parent fb8adaeb87
commit 7882eac4f6
1 file changed
+6 -1
@@ -456,7 +456,12 @@ define(function (require, exports, module) {
cursor = sessionType.functionCallPos,
token = cursor ? this.getToken(cursor) : undefined,
varName;
if (token) {
if (token &&
// only change the 'fn' when the token looks like a function
// name, and isn't some other kind of expression
(token.type === "variable" ||
token.type === "variable-2" ||
token.type === "property")) {
varName = token.string;
if (varName) {
fnHint = varName + fnHint.substr(2);