diff --git a/src/compiler/compiler.ml b/src/compiler/compiler.ml index 9b17cbdff9f..b0f18383b19 100644 --- a/src/compiler/compiler.ml +++ b/src/compiler/compiler.ml @@ -351,7 +351,12 @@ let compile ctx actx callbacks = end; DisplayProcessing.handle_display_after_typing ctx tctx display_file_dot_path; finalize_typing ctx tctx; - filter ctx tctx (fun () -> DisplayProcessing.handle_display_after_finalization ctx tctx display_file_dot_path); + if is_diagnostics com then + filter ctx tctx (fun () -> DisplayProcessing.handle_display_after_finalization ctx tctx display_file_dot_path) + else begin + DisplayProcessing.handle_display_after_finalization ctx tctx display_file_dot_path; + filter ctx tctx (fun () -> ()); + end; if ctx.has_error then raise Abort; Generate.check_auxiliary_output com actx; com.stage <- CGenerationStart; diff --git a/src/core/displayTypes.ml b/src/core/displayTypes.ml index b6833b897b9..919572b279d 100644 --- a/src/core/displayTypes.ml +++ b/src/core/displayTypes.ml @@ -233,7 +233,6 @@ module DisplayMode = struct | DMDefault | DMDefinition | DMTypeDefinition | DMPackage | DMHover | DMSignature -> settings | DMUsage _ | DMImplementation -> { settings with dms_full_typing = true; - dms_populate_cache = !ServerConfig.populate_cache_from_display; dms_force_macro_typing = true; dms_display_file_policy = DFPAlso; dms_exit_during_typing = false diff --git a/tests/server/src/cases/issues/Issue11184.hx b/tests/server/src/cases/issues/Issue11184.hx index b9432ac221a..1bfc1fa0621 100644 --- a/tests/server/src/cases/issues/Issue11184.hx +++ b/tests/server/src/cases/issues/Issue11184.hx @@ -2,10 +2,7 @@ package cases.issues; class Issue11184 extends TestCase { function testDiagnostics(_) { - final content = getTemplate("issues/Issue11184/Main.hx"); - final transform = Marker.extractMarkers(content); - - vfs.putContent("Main.hx", transform.source); + vfs.putContent("Main.hx", getTemplate("issues/Issue11184/Main.hx")); var args = ["-main", "Main", "-js", "bin/test.js"]; runHaxe(args.concat(["--display", "Main.hx@0@diagnostics"])); @@ -18,32 +15,8 @@ class Issue11184 extends TestCase { Assert.isTrue(hasErrorMessage("Cannot use Void as value")); } - function testFindReferences(_) { - final content = getTemplate("issues/Issue11184/Main.hx"); - final transform = Marker.extractMarkers(content); - - vfs.putContent("Main.hx", transform.source); - var args = ["-main", "Main", "-js", "bin/test.js"]; - - runHaxeJson(args, DisplayMethods.FindReferences, { - file: new FsPath("Main.hx"), - offset: transform.markers.get(1), - contents: transform.source - }); - final errors = haxe.Json.parse(lastResult.stderr).error?.data; - Assert.equals(errors[0].message, "Cannot use Void as value"); - - runHaxe(args); - Assert.isTrue(hasErrorMessage("Cannot use Void as value")); - runHaxe(args); - Assert.isTrue(hasErrorMessage("Cannot use Void as value")); - } - function testWithoutCacheFromDisplay(_) { - final content = getTemplate("issues/Issue11184/Main.hx"); - final transform = Marker.extractMarkers(content); - - vfs.putContent("Main.hx", transform.source); + vfs.putContent("Main.hx", getTemplate("issues/Issue11184/Main.hx")); var args = ["-main", "Main", "-js", "bin/test.js"]; runHaxeJson([], ServerMethods.Configure, {populateCacheFromDisplay: false}); runHaxe(args.concat(["--display", "Main.hx@0@diagnostics"])); diff --git a/tests/server/test/templates/issues/Issue11184/Main.hx b/tests/server/test/templates/issues/Issue11184/Main.hx index 3fe8cf2b358..c769638ee40 100644 --- a/tests/server/test/templates/issues/Issue11184/Main.hx +++ b/tests/server/test/templates/issues/Issue11184/Main.hx @@ -1,6 +1,6 @@ class Main { static function main() { - function fo{-1-}o():Void {} + function foo():Void {} final arr = [foo()]; } }