mirror of
https://github.com/RustyRaptor/brackets.git
synced 2026-12-04 00:15:22 -07:00
Fix Issue #3632
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:
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);
|
||||
|
||||
Reference in new issue
Block a user