forked from HaxeFoundation/haxe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[display] Config to disable populating cache from display requests (H…
…axeFoundation#11224) * Add compilation server config to disable populating cache from display requests * [tests] Add test for 11177 (including a disabled one for now) * [tests] Add test for 11184 (including a disabled one for now)
- Loading branch information
Showing
13 changed files
with
97 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
let do_not_check_modules = ref false | ||
let legacy_completion = ref false | ||
let populate_cache_from_display = ref true | ||
let legacy_completion = ref false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package cases.issues; | ||
|
||
class Issue11177 extends TestCase { | ||
// Disabled for now until #11177 is actually fixed, likely by #11220 | ||
// function test(_) { | ||
// vfs.putContent("Main.hx", getTemplate("issues/Issue11177/Main.hx")); | ||
// vfs.putContent("Buttons.hx", getTemplate("issues/Issue11177/Buttons.hx")); | ||
// vfs.putContent("KeyCode.hx", getTemplate("issues/Issue11177/KeyCode.hx")); | ||
// var args = ["-main", "Main", "--interp"]; | ||
// runHaxe(args.concat(["--display", "Buttons.hx@0@diagnostics"])); | ||
// vfs.putContent("Main.hx", getTemplate("issues/Issue11177/Main2.hx")); | ||
// runHaxeJson([], ServerMethods.Invalidate, {file: new FsPath("Main.hx")}); | ||
// runHaxe(args); | ||
// runHaxe(args.concat(["--display", "Buttons.hx@0@diagnostics"])); | ||
// Assert.isTrue(lastResult.stderr.length == 2); | ||
// } | ||
|
||
function testWithoutCacheFromDisplay(_) { | ||
vfs.putContent("Main.hx", getTemplate("issues/Issue11177/Main.hx")); | ||
vfs.putContent("Buttons.hx", getTemplate("issues/Issue11177/Buttons.hx")); | ||
vfs.putContent("KeyCode.hx", getTemplate("issues/Issue11177/KeyCode.hx")); | ||
var args = ["-main", "Main", "--interp"]; | ||
runHaxeJson([], ServerMethods.Configure, {populateCacheFromDisplay: false}); | ||
runHaxe(args.concat(["--display", "Buttons.hx@0@diagnostics"])); | ||
vfs.putContent("Main.hx", getTemplate("issues/Issue11177/Main2.hx")); | ||
runHaxeJson([], ServerMethods.Invalidate, {file: new FsPath("Main.hx")}); | ||
runHaxe(args); | ||
runHaxe(args.concat(["--display", "Buttons.hx@0@diagnostics"])); | ||
Assert.isTrue(lastResult.stderr.length == 2); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package cases.issues; | ||
|
||
class Issue11184 extends TestCase { | ||
// Disabled for now until #11184 is actually fixed, likely by #11220 | ||
// function test(_) { | ||
// 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"])); | ||
// runHaxe(args); | ||
// Assert.isTrue(hasErrorMessage("Cannot use Void as value")); | ||
// runHaxe(args); | ||
// Assert.isTrue(hasErrorMessage("Cannot use Void as value")); | ||
// } | ||
|
||
function testWithoutCacheFromDisplay(_) { | ||
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"])); | ||
runHaxe(args); | ||
Assert.isTrue(hasErrorMessage("Cannot use Void as value")); | ||
runHaxe(args); | ||
Assert.isTrue(hasErrorMessage("Cannot use Void as value")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class Buttons { | ||
public static function init(main:Main):Void { | ||
// Recursive inline is not supported | ||
trace(KeyCode.Backspace); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
enum abstract KeyCode(Int) { | ||
var Backspace = 8; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class Main { | ||
static function main():Void { | ||
trace("change this line"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class Main { | ||
static function main():Void { | ||
trace("change this trace"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class Main { | ||
static function main() { | ||
function foo():Void {} | ||
final arr = [foo()]; | ||
} | ||
} | ||
|