Skip to content

Fourslash: open all test files #1422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions internal/fourslash/_scripts/failingTests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ TestFindAllRefsModuleDotExports
TestFindAllRefsReExport_broken
TestFindAllRefs_importType_typeofImport
TestFindReferencesAfterEdit
TestFindReferencesBindingPatternInJsdocNoCrash1
TestFindReferencesBindingPatternInJsdocNoCrash2
TestGenericTypeWithMultipleBases1MultiFile
TestGetJavaScriptCompletions10
TestGetJavaScriptCompletions12
Expand Down Expand Up @@ -223,10 +225,6 @@ TestImportStatementCompletions4
TestImportStatementCompletions_noPatternAmbient
TestImportStatementCompletions_pnpmTransitive
TestImportTypeMemberCompletions
TestJavaScriptModules12
TestJavaScriptModules13
TestJavaScriptModules14
TestJavaScriptModules19
TestJavascriptModules20
TestJavascriptModules21
TestJavascriptModulesTypeImport
Expand Down
10 changes: 7 additions & 3 deletions internal/fourslash/fourslash.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,10 @@ func NewFourslash(t *testing.T, capabilities *lsproto.ClientCapabilities, conten
scriptInfos[filePath] = newScriptInfo(filePath, file.Content)
}

compilerOptions := &core.CompilerOptions{}
compilerOptions := &core.CompilerOptions{
SkipDefaultLibCheck: core.TSTrue,
}
harnessutil.SetCompilerOptionsFromTestConfig(t, testData.GlobalOptions, compilerOptions)
compilerOptions.SkipDefaultLibCheck = core.TSTrue

inputReader, inputWriter := newLSPPipe()
outputReader, outputWriter := newLSPPipe()
Expand Down Expand Up @@ -202,7 +203,10 @@ func NewFourslash(t *testing.T, capabilities *lsproto.ClientCapabilities, conten
// !!! replace with a proper request *after initialize*
f.server.SetCompilerOptionsForInferredProjects(compilerOptions)
f.initialize(t, capabilities)
f.openFile(t, f.testData.Files[0].fileName)
for _, file := range testData.Files {
f.openFile(t, file.fileName)
}
f.activeFilename = f.testData.Files[0].fileName

t.Cleanup(func() {
inputWriter.Close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

func TestFindReferencesBindingPatternInJsdocNoCrash1(t *testing.T) {
t.Parallel()

t.Skip()
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
const content = `// @moduleResolution: node
// @Filename: node_modules/use-query/package.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

func TestFindReferencesBindingPatternInJsdocNoCrash2(t *testing.T) {
t.Parallel()

t.Skip()
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
const content = `// @moduleResolution: node
// @Filename: node_modules/use-query/package.json
Expand Down
2 changes: 1 addition & 1 deletion internal/fourslash/tests/gen/javaScriptModules12_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func TestJavaScriptModules12(t *testing.T) {
t.Parallel()
t.Skip()

defer testutil.RecoverAndFail(t, "Panic on fourslash test")
const content = `// @allowJs: true
// @Filename: mod1.js
Expand Down
2 changes: 1 addition & 1 deletion internal/fourslash/tests/gen/javaScriptModules13_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func TestJavaScriptModules13(t *testing.T) {
t.Parallel()
t.Skip()

defer testutil.RecoverAndFail(t, "Panic on fourslash test")
const content = `// @allowJs: true
// @Filename: myMod.js
Expand Down
2 changes: 1 addition & 1 deletion internal/fourslash/tests/gen/javaScriptModules14_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func TestJavaScriptModules14(t *testing.T) {
t.Parallel()
t.Skip()

defer testutil.RecoverAndFail(t, "Panic on fourslash test")
const content = `// @allowJs: true
// @Filename: myMod.js
Expand Down
2 changes: 1 addition & 1 deletion internal/fourslash/tests/gen/javaScriptModules19_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func TestJavaScriptModules19(t *testing.T) {
t.Parallel()
t.Skip()

defer testutil.RecoverAndFail(t, "Panic on fourslash test")
const content = `// @allowJs: true
// @Filename: myMod.js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
// export const /*FIND ALL REFS*/[|x|]: number;


// === /b.ts ===

// import a from "./a";
// a.[|x|];




// === findAllReferences ===
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@
// /*FIND ALL REFS*/[|undefined|];
//
// void [|undefined|];


// === /b.ts ===

// [|undefined|];
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
// export as namespace /*FIND ALL REFS*/[|myLib|];


// === /1.ts ===

// /// <reference path="0.d.ts" />
// [|myLib|].doThing();




// === findAllReferences ===
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@
// });


// === /b.ts ===

// import { infer } from "./infer";
// infer({
// m: {
// initData() {
// this.[|x|] = 1;
// this.[|x|];
// },
// }
// });


// === /infer.d.ts ===

// export declare function infer(o: { m: Record<string, Function> } & ThisType<{ [|x|]: number }>): void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
// [|decorator|]();


// === /b.ts ===

// @[|decorator|] @[|decorator|]("again")
// class C {
// @[|decorator|]
// method() {}
// }




// === findAllReferences ===
Expand All @@ -23,6 +32,15 @@
// /*FIND ALL REFS*/[|decorator|]();


// === /b.ts ===

// @[|decorator|] @[|decorator|]("again")
// class C {
// @[|decorator|]
// method() {}
// }




// === findAllReferences ===
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
// // --- (line: 11) skipped ---


// === /findAllRefsOnDefinition.ts ===

// import Second = require("./findAllRefsOnDefinition-import");
//
// var second = new Second.Test()
// second.[|start|]();
// second.stop();




// === findAllReferences ===
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
// }


// === /findAllRefsOnDefinition2.ts ===

// import Second = require("./findAllRefsOnDefinition2-import");
//
// var start: Second.Test.[|start|];
// var stop: Second.Test.stop;




// === findAllReferences ===
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@
// var /*FIND ALL REFS*/[|x|]: number;


// === /b.ts ===

// /// <reference path="a.ts" />
// [|x|]++;


// === /c.ts ===

// /// <reference path="a.ts" />
// [|x|]++;




// === findAllReferences ===
Expand All @@ -23,6 +35,12 @@
// /*FIND ALL REFS*/[|x|]++;


// === /c.ts ===

// /// <reference path="a.ts" />
// [|x|]++;




// === findAllReferences ===
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
// }


// === /referenceToClass_2.ts ===

// var k: [|foo|];




// === findAllReferences ===
Expand All @@ -36,6 +41,11 @@
// }


// === /referenceToClass_2.ts ===

// var k: [|foo|];




// === findAllReferences ===
Expand All @@ -56,6 +66,11 @@
// }


// === /referenceToClass_2.ts ===

// var k: [|foo|];




// === findAllReferences ===
Expand All @@ -76,6 +91,11 @@
// }


// === /referenceToClass_2.ts ===

// var k: [|foo|];




// === findAllReferences ===
Expand All @@ -96,6 +116,11 @@
// }


// === /referenceToClass_2.ts ===

// var k: [|foo|];




// === findAllReferences ===
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,13 @@
// === /declaration.ts ===

// var container = { /*FIND ALL REFS*/[|searchProp|] : 1 };


// === /expression.ts ===

// function blah() { return (1 + 2 + container.[|searchProp|]()) === 2; };


// === /stringIndexer.ts ===

// function blah2() { container["[|searchProp|]"] };
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,13 @@
// === /declaration.ts ===

// var container = { /*FIND ALL REFS*/[|42|]: 1 };


// === /expression.ts ===

// function blah() { return (container[[|42|]]) === 2; };


// === /stringIndexer.ts ===

// function blah2() { container["[|42|]"] };
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
// enum Test { /*FIND ALL REFS*/"[|42|]" = 1 };


// === /expression.ts ===

// (Test[[|42|]]);




// === findAllReferences ===
Expand All @@ -12,6 +17,11 @@
// enum Test { "/*FIND ALL REFS*/[|42|]" = 1 };


// === /expression.ts ===

// (Test[[|42|]]);




// === findAllReferences ===
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
// }


// === /referencesForGlobals_2.ts ===

// import f = require("[|foo|]");




// === findAllReferences ===
Expand Down
Loading
Loading