Kaynağa Gözat

[display] don't complete in regexes

closes #7086
Simon Krajewski 7 yıl önce
ebeveyn
işleme
12731a1540

+ 2 - 0
src/context/display/display.ml

@@ -79,6 +79,8 @@ module ExprPreprocessing = struct
 			| EConst (String _) when (not (Lexer.is_fmt_string (pos e)) || !Parser.was_auto_triggered) && is_annotated (pos e) && is_completion ->
 				(* TODO: check if this makes any sense *)
 				raise Exit
+			| EConst(Regexp _) when is_annotated (pos e) && is_completion ->
+				raise Exit
 			| _ ->
 				if is_annotated (pos e) then
 					annotate_marked e

+ 14 - 0
tests/display/src/cases/Issue7086.hx

@@ -0,0 +1,14 @@
+package cases;
+
+class Issue7086 extends DisplayTestCase {
+	/**
+	class Main {
+		public static function main() {
+			~/{-1-}/;
+		}
+	}
+	**/
+	function test() {
+		noCompletionPoint(toplevel.bind(pos(1)));
+	}
+}