瀏覽代碼

[display] Avoid display issues with missing fields (#11251)

* [display] only raise completion items when in completion request

* Don't check interfaces during display requests

* Use dms_full_typing instead
Rudy Ges 2 年之前
父節點
當前提交
16a300f965
共有 2 個文件被更改,包括 4 次插入2 次删除
  1. 1 1
      src/syntax/grammar.mly
  2. 3 1
      src/typing/typeloadCheck.ml

+ 1 - 1
src/syntax/grammar.mly

@@ -189,7 +189,7 @@ and parse_class_content doc meta flags n p1 s =
 	let tl = parse_constraint_params s in
 	let rec loop had_display p0 acc =
 		let check_display p1 =
-			if not had_display && !in_display_file && display_position#enclosed_in p1 then
+			if not had_display && !in_display_file && !display_mode = DMDefault && display_position#enclosed_in p1 then
 				syntax_completion (if List.mem HInterface n then SCInterfaceRelation else SCClassRelation) None (display_position#with_pos p1)
 		in
 		match s with parser

+ 3 - 1
src/typing/typeloadCheck.ml

@@ -564,8 +564,10 @@ module Inheritance = struct
 					   purpose. However, we STILL have to delay the check because at the time pending is handled, the class
 					   is not built yet. See issue #10847. *)
 					pending := (fun () -> delay ctx PConnectField check_interfaces_or_delay) :: !pending
-				| _ ->
+				| _ when ctx.com.display.dms_full_typing ->
 					check_interfaces ctx c
+				| _ ->
+					()
 			in
 			if is_extends then begin
 				if c.cl_super <> None then raise_typing_error "Cannot extend several classes" p;