浏览代码

[ide] fix hovering `T` in `v is T` (see #10167)

needs a test and checking other IDE-related scenarios
Dan Korostelev 4 年之前
父节点
当前提交
996c39daf0
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/typing/typer.ml

+ 4 - 1
src/typing/typer.ml

@@ -1808,7 +1808,10 @@ and type_expr ?(mode=MGet) ctx (e,p) (with_type:WithType.t) =
 		| CTPath tp ->
 		| CTPath tp ->
 			if tp.tparams <> [] then display_error ctx "Type parameters are not supported for the `is` operator" p_t;
 			if tp.tparams <> [] then display_error ctx "Type parameters are not supported for the `is` operator" p_t;
 			let e = type_expr ctx e WithType.value in
 			let e = type_expr ctx e WithType.value in
-			let e_t = type_type ctx (tp.tpackage,tp.tname) p_t in
+			let mt = Typeload.load_type_def ctx p_t tp in
+			if ctx.in_display && DisplayPosition.display_position#enclosed_in p_t then
+				DisplayEmitter.display_module_type ctx mt p_t;
+			let e_t = type_module_type ctx mt None p_t in
 			let e_Std_isOfType =
 			let e_Std_isOfType =
 				match Typeload.load_type_raise ctx ([],"Std") "Std" p with
 				match Typeload.load_type_raise ctx ([],"Std") "Std" p with
 				| TClassDecl c ->
 				| TClassDecl c ->