File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
src/org/klesun/deep_js_completion Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 1
1
package org .klesun .deep_js_completion .contexts
2
2
3
3
import com .intellij .lang .javascript .psi .resolve .JSTypeEvaluator
4
- import com .intellij .lang .javascript .psi .types .JSAnyType
5
4
import com .intellij .lang .javascript .psi .{JSExpression , JSType }
6
5
import org .klesun .deep_js_completion .helpers .Mt
7
6
import org .klesun .deep_js_completion .resolvers .MainRes
@@ -57,7 +56,6 @@ class SearchCtx extends ICtx
57
56
if (debug) {
58
57
/** @debug */
59
58
println(indent + " resolution: " + resolved)
60
-
61
59
if (resolved.isEmpty) {
62
60
/** @debug */
63
61
println(indent + " built-in of " + result)
Original file line number Diff line number Diff line change @@ -283,6 +283,9 @@ case class VarRes(ctx: ICtx) {
283
283
.flatMap(expr => ctx.findExprType(expr))
284
284
case prop : JSDefinitionExpression => Option (prop.getExpression)
285
285
.flatMap(expr => ctx.findExprType(expr))
286
+ case func : JSFunction => Mt .mergeTypes(MainRes .getReturns(func)
287
+ .flatMap(expr => ctx.findExprType(expr))
288
+ .map(rett => new JSFunctionTypeImpl (JSTypeSource .EMPTY , new util.ArrayList [JSParameterTypeDecorator ](), rett)))
286
289
case _ =>
287
290
// println("Unsupported var declaration - " + psi.getClass + " " + psi.getText)
288
291
None
You can’t perform that action at this time.
0 commit comments