2
0
Эх сурвалжийг харах

[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 жил өмнө
parent
commit
16a300f965

+ 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 tl = parse_constraint_params s in
 	let rec loop had_display p0 acc =
 	let rec loop had_display p0 acc =
 		let check_display p1 =
 		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)
 				syntax_completion (if List.mem HInterface n then SCInterfaceRelation else SCClassRelation) None (display_position#with_pos p1)
 		in
 		in
 		match s with parser
 		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
 					   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. *)
 					   is not built yet. See issue #10847. *)
 					pending := (fun () -> delay ctx PConnectField check_interfaces_or_delay) :: !pending
 					pending := (fun () -> delay ctx PConnectField check_interfaces_or_delay) :: !pending
-				| _ ->
+				| _ when ctx.com.display.dms_full_typing ->
 					check_interfaces ctx c
 					check_interfaces ctx c
+				| _ ->
+					()
 			in
 			in
 			if is_extends then begin
 			if is_extends then begin
 				if c.cl_super <> None then raise_typing_error "Cannot extend several classes" p;
 				if c.cl_super <> None then raise_typing_error "Cannot extend several classes" p;