// Code generated by convertFourslash; DO NOT EDIT.
// To modify this test, run "npm run makemanual autoImportTypeOnlyPreferred3"

package fourslash_test

import (
	"testing"

	"github.com/microsoft/typescript-go/internal/core"
	"github.com/microsoft/typescript-go/internal/fourslash"
	"github.com/microsoft/typescript-go/internal/ls/lsutil"
	"github.com/microsoft/typescript-go/internal/testutil"
)

func TestAutoImportTypeOnlyPreferred3(t *testing.T) {
	fourslash.SkipIfFailing(t)
	t.Parallel()
	defer testutil.RecoverAndFail(t, "Panic on fourslash test")
	const content = `// @module: esnext
// @moduleResolution: bundler
// @Filename: /a.ts
export class A {}
export class B {}
// @Filename: /b.ts
let x: A/*b*/;
// @Filename: /c.ts
import { A } from "./a";
new A();
let x: B/*c*/;
// @Filename: /d.ts
new A();
let x: B;
// @Filename: /ns.ts
export * as default from "./a";
// @Filename: /e.ts
let x: /*e*/ns.A;`
	f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
	defer done()
	f.GoToMarker(t, "b")
	f.VerifyImportFixAtPosition(t, []string{
		`import type { A } from "./a";

let x: A;`,
	}, &lsutil.UserPreferences{PreferTypeOnlyAutoImports: core.TSTrue})
	f.GoToMarker(t, "c")
	f.VerifyImportFixAtPosition(t, []string{
		`import { A, type B } from "./a";
new A();
let x: B;`,
	}, &lsutil.UserPreferences{PreferTypeOnlyAutoImports: core.TSTrue})
	f.GoToFile(t, "/d.ts")
	f.VerifyCodeFixAll(t, fourslash.VerifyCodeFixAllOptions{
		FixID: "fixMissingImport",
		NewFileContent: `import { A, type B } from "./a";

new A();
let x: B;`,
	})
	f.GoToMarker(t, "e")
	f.VerifyImportFixAtPosition(t, []string{
		`import type ns from "./ns";

let x: ns.A;`,
	}, &lsutil.UserPreferences{PreferTypeOnlyAutoImports: core.TSTrue})
}
