-
-
Notifications
You must be signed in to change notification settings - Fork 661
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run some filters in diagnostics (#11220)
* let's see how much breaks * [tests] enable diagnostics tests for 11177 and 11184 * [tests] Update test for 5306 * Don't cache/run filters for find reference/implementation requests (#11226) * Only run filters and save cache on diagnostics, not usage requests * [tests] Update test for 11184 * disable test * add VUsedByTyper to avoid bad unused local errors * revert @:compilerGenerated change --------- Co-authored-by: Rudy Ges <k@klabz.org>
- Loading branch information
Showing
16 changed files
with
147 additions
and
82 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
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
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
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,33 +1,32 @@ | ||
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"]; | ||
// runHaxeJsonCb(args, DisplayMethods.Diagnostics, {file: new FsPath("Buttons.hx")}, res -> { | ||
// Assert.equals(0, res.length); | ||
// }); | ||
// vfs.putContent("Main.hx", getTemplate("issues/Issue11177/Main2.hx")); | ||
// runHaxeJson([], ServerMethods.Invalidate, {file: new FsPath("Main.hx")}); | ||
// runHaxe(args); | ||
// runHaxeJsonCb(args, DisplayMethods.Diagnostics, {file: new FsPath("Buttons.hx")}, res -> { | ||
// Assert.equals(0, res.length); | ||
// }); | ||
// } | ||
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"]; | ||
runHaxeJsonCb(args, DisplayMethods.Diagnostics, {file: new FsPath("Buttons.hx")}, res -> { | ||
Assert.equals(0, res.length); | ||
}); | ||
vfs.putContent("Main.hx", getTemplate("issues/Issue11177/Main2.hx")); | ||
runHaxeJson([], ServerMethods.Invalidate, {file: new FsPath("Main.hx")}); | ||
runHaxe(args); | ||
runHaxeJsonCb(args, DisplayMethods.Diagnostics, {file: new FsPath("Buttons.hx")}, res -> { | ||
Assert.equals(0, res.length); | ||
}); | ||
} | ||
|
||
// function testLegacyDiagnostics(_) { | ||
// 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 testLegacyDiagnostics(_) { | ||
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); | ||
} | ||
} |
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,32 +1,31 @@ | ||
package cases.issues; | ||
|
||
class Issue11184 extends TestCase { | ||
// Disabled for now until #11184 is actually fixed, likely by #11220 | ||
// function testDiagnostics(_) { | ||
// vfs.putContent("Main.hx", getTemplate("issues/Issue11184/Main.hx")); | ||
// var args = ["-main", "Main", "-js", "bin/test.js"]; | ||
function testDiagnostics(_) { | ||
vfs.putContent("Main.hx", getTemplate("issues/Issue11184/Main.hx")); | ||
var args = ["-main", "Main", "-js", "bin/test.js"]; | ||
|
||
// runHaxeJsonCb(args, DisplayMethods.Diagnostics, {file: new FsPath("Main.hx")}, res -> { | ||
// Assert.equals(1, res.length); | ||
// Assert.equals(1, res[0].diagnostics.length); | ||
// Assert.equals(res[0].diagnostics[0].args, "Cannot use Void as value"); | ||
// }); | ||
runHaxeJsonCb(args, DisplayMethods.Diagnostics, {file: new FsPath("Main.hx")}, res -> { | ||
Assert.equals(1, res.length); | ||
Assert.equals(1, res[0].diagnostics.length); | ||
Assert.equals(res[0].diagnostics[0].args, "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")); | ||
// } | ||
runHaxe(args); | ||
Assert.isTrue(hasErrorMessage("Cannot use Void as value")); | ||
runHaxe(args); | ||
Assert.isTrue(hasErrorMessage("Cannot use Void as value")); | ||
} | ||
|
||
// function testLegacyDiagnostics(_) { | ||
// 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"])); | ||
// final diagnostics = haxe.Json.parse(lastResult.stderr)[0].diagnostics; | ||
// Assert.equals(diagnostics[0].args, "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 testLegacyDiagnostics(_) { | ||
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"])); | ||
final diagnostics = haxe.Json.parse(lastResult.stderr)[0].diagnostics; | ||
Assert.equals(diagnostics[0].args, "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")); | ||
} | ||
} |
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,23 @@ | ||
package cases.issues; | ||
|
||
class Issue11203 extends TestCase { | ||
function testClass(_) { | ||
vfs.putContent("Main.hx", getTemplate("issues/Issue11203/MainClass.hx")); | ||
var args = ["Main", "--interp"]; | ||
runHaxe(args); | ||
runHaxe(args.concat(["--display", "Main.hx@0@diagnostics"])); | ||
|
||
var diag = parseDiagnostics(); | ||
Assert.isTrue(diag.length == 0); | ||
} | ||
|
||
function testAbstract(_) { | ||
vfs.putContent("Main.hx", getTemplate("issues/Issue11203/MainAbstract.hx")); | ||
var args = ["Main", "--interp"]; | ||
runHaxe(args); | ||
runHaxe(args.concat(["--display", "Main.hx@0@diagnostics"])); | ||
|
||
var diag = parseDiagnostics(); | ||
Assert.isTrue(diag.length == 0); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
tests/server/test/templates/issues/Issue11203/MainAbstract.hx
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,16 @@ | ||
class Main { | ||
static function main() { | ||
var future = new Future(); | ||
future.eager(); | ||
} | ||
} | ||
|
||
abstract Future({}) from {} { | ||
public function new() | ||
this = {}; | ||
|
||
public inline function eager():Future { | ||
trace("much side effect!"); | ||
return this; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
tests/server/test/templates/issues/Issue11203/MainClass.hx
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,15 @@ | ||
class Main { | ||
static function main() { | ||
var future = new Future(); | ||
future.eager(); | ||
} | ||
} | ||
|
||
class Future { | ||
public function new() {} | ||
|
||
public inline function eager():Future { | ||
trace("much side effect!"); | ||
return this; | ||
} | ||
} |