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

package fourslash_test

import (
	"testing"

	"github.com/microsoft/typescript-go/internal/fourslash"
	. "github.com/microsoft/typescript-go/internal/fourslash/tests/util"
	"github.com/microsoft/typescript-go/internal/ls"
	"github.com/microsoft/typescript-go/internal/lsp/lsproto"
	"github.com/microsoft/typescript-go/internal/testutil"
)

func TestCompletionsUniqueSymbol_import(t *testing.T) {
	fourslash.SkipIfFailing(t)
	t.Parallel()
	defer testutil.RecoverAndFail(t, "Panic on fourslash test")
	const content = `// @noLib: true
// @Filename: /globals.d.ts
declare const Symbol: () => symbol;
// @Filename: /a.ts
const privateSym = Symbol();
export const publicSym = Symbol();
export interface I {
    [privateSym]: number;
    [publicSym]: number;
    [defaultPublicSym]: number;
    n: number;
}
export const i: I;
// @Filename: /user.ts
import { i } from "./a";
i[|./**/|];`
	f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
	defer done()
	f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{
		IsIncomplete: false,
		ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
			CommitCharacters: &DefaultCommitCharacters,
			EditRange:        Ignored,
		},
		Items: &fourslash.CompletionsExpectedItems{
			Exact: []fourslash.CompletionsExpectedItem{
				"n",
				&lsproto.CompletionItem{
					Label:      "publicSym",
					InsertText: new("[publicSym]"),
					Data: &lsproto.CompletionItemData{
						AutoImport: &lsproto.AutoImportFix{
							ModuleSpecifier: "./a",
						},
					},
					SortText:            new(string(ls.SortTextGlobalsOrKeywords)),
					AdditionalTextEdits: fourslash.AnyTextEdits,
					TextEdit: &lsproto.TextEditOrInsertReplaceEdit{
						TextEdit: &lsproto.TextEdit{
							NewText: "publicSym",
							Range:   f.Ranges()[0].LSRange,
						},
					},
				},
			},
		},
	})
	f.VerifyApplyCodeActionFromCompletion(t, new(""), &fourslash.ApplyCodeActionFromCompletionOptions{
		Name:        "publicSym",
		Source:      "./a",
		Description: "Update import from \"./a\"",
		NewFileContent: new(`import { i, publicSym } from "./a";
i.;`),
	})
}
