瀏覽代碼

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

needs a test and checking other IDE-related scenarios
Aleksandr Kuzmenko 4 年之前
父節點
當前提交
c9b7d473f6
共有 2 個文件被更改,包括 6 次插入1 次删除
  1. 2 0
      extra/CHANGES.txt
  2. 4 1
      src/typing/typer.ml

+ 2 - 0
extra/CHANGES.txt

@@ -4,6 +4,8 @@
 
 	all : fixed rest args typing for overloaded functions (#10143)
 	all : fixed using `var` fields as static extensions (#10144)
+	all : fixed completion for a type in `expr is Type` (#10167)
+	all : fixed subtypes in `expr is Module.SubType` expressions (#10174)
 	hl : fixed debugging of `catch` blocks (#10109)
 	jvm : fixed manifest generation for cases with a lot of jar libraries (#10157)
 

+ 4 - 1
src/typing/typer.ml

@@ -1808,7 +1808,10 @@ and type_expr ?(mode=MGet) ctx (e,p) (with_type:WithType.t) =
 		| CTPath tp ->
 			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_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 =
 				match Typeload.load_type_raise ctx ([],"Std") "Std" p with
 				| TClassDecl c ->