Files
tsgo/internal/fourslash/tests/autoImportNewLine_test.go
e52b671d97 Fix auto import not getting its own line (#3090)
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: andrewbranch <[email protected]>
Co-authored-by: Andrew Branch <[email protected]>
2026-03-16 22:46:37 +00:00

44 lines
1.0 KiB
Go

package fourslash_test
import (
"testing"
"github.com/microsoft/typescript-go/internal/fourslash"
"github.com/microsoft/typescript-go/internal/testutil"
)
func TestAutoImportNewLine(t *testing.T) {
t.Parallel()
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
const content = `// @Filename: /a.ts
export function readFileSync() {}
// @Filename: /b.ts
import {} from "./other1";
import {} from "./other2";
readFileSync/**/`
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
defer done()
f.BaselineAutoImportsCompletions(t, []string{""})
}
func TestAutoImportNewLineWithHeaderComment(t *testing.T) {
t.Parallel()
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
const content = `// @Filename: /a.ts
export function readFileSync() {}
// @Filename: /b.ts
/* file header comment */
import {} from "./other1";
import {} from "./other2";
readFileSync/**/`
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
defer done()
f.BaselineAutoImportsCompletions(t, []string{""})
}