62 lines
2.1 KiB
Go
62 lines
2.1 KiB
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual autoImportFileExcludePatterns2"
|
|
|
|
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/ls/lsutil"
|
|
"github.com/microsoft/typescript-go/internal/lsp/lsproto"
|
|
"github.com/microsoft/typescript-go/internal/testutil"
|
|
)
|
|
|
|
func TestAutoImportFileExcludePatterns2(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `// @lib: es5
|
|
// @Filename: /lib/components/button/Button.ts
|
|
export function Button() {}
|
|
// @Filename: /lib/components/button/index.ts
|
|
export * from "./Button";
|
|
// @Filename: /lib/components/index.ts
|
|
export * from "./button";
|
|
// @Filename: /lib/main.ts
|
|
export { Button } from "./components";
|
|
// @Filename: /lib/index.ts
|
|
export * from "./main";
|
|
// @Filename: /i-hate-index-files.ts
|
|
Button/**/`
|
|
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: CompletionGlobalsPlus(
|
|
[]fourslash.CompletionsExpectedItem{
|
|
&lsproto.CompletionItem{
|
|
Label: "Button",
|
|
Data: &lsproto.CompletionItemData{
|
|
AutoImport: &lsproto.AutoImportFix{
|
|
ModuleSpecifier: "./lib/main",
|
|
},
|
|
},
|
|
AdditionalTextEdits: fourslash.AnyTextEdits,
|
|
SortText: new(string(ls.SortTextAutoImportSuggestions)),
|
|
},
|
|
}, false,
|
|
),
|
|
},
|
|
UserPreferences: &lsutil.UserPreferences{AutoImportFileExcludePatterns: []string{"/**/index.*"}},
|
|
})
|
|
f.VerifyImportFixModuleSpecifiers(t, "", []string{"./lib/main", "./lib/components/button/Button"}, &lsutil.UserPreferences{AutoImportFileExcludePatterns: []string{"/**/index.*"}})
|
|
}
|