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

[display] don't show Module.platform.hx in import completion (closes #6408)

Simon Krajewski 8 жил өмнө
parent
commit
894f7f4574

+ 4 - 1
src/display/displayOutput.ml

@@ -285,7 +285,10 @@ module TypePathHandler = struct
 					end;
 				end else if file_extension f = "hx" then begin
 					let c = Filename.chop_extension f in
-					if String.length c < 2 || String.sub c (String.length c - 2) 2 <> "__" then classes := c :: !classes;
+					try
+						ignore(String.index c '.')
+					with Not_found ->
+						if String.length c < 2 || String.sub c (String.length c - 2) 2 <> "__" then classes := c :: !classes;
 				end;
 			) r;
 		) com.class_path;

+ 8 - 0
tests/display/src/cases/IImport.hx

@@ -56,4 +56,12 @@ class IImport extends DisplayTestCase {
 		eq(false, hasPath(fields(pos(1)), "run"));
 		eq(true, hasPath(fields(pos(1)), "Serializer"));
 	}
+
+	/**
+	import haxe.macro.{-1-}
+	**/
+	function testIssue6408() {
+		eq(true, hasPath(fields(pos(1)), "Context"));
+		eq(false, hasPath(fields(pos(1)), "Context.hl"));
+	}
 }