mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
90 lines
2.6 KiB
Go
90 lines
2.6 KiB
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual autoImportProvider_exportMap1"
|
|
|
|
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 TestAutoImportProvider_exportMap1(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `// @Filename: /home/src/workspaces/project/tsconfig.json
|
|
{
|
|
"compilerOptions": {
|
|
"lib": ["es5"],
|
|
"module": "nodenext"
|
|
}
|
|
}
|
|
// @Filename: /home/src/workspaces/project/package.json
|
|
{
|
|
"type": "module",
|
|
"dependencies": {
|
|
"dependency": "^1.0.0"
|
|
}
|
|
}
|
|
// @Filename: /home/src/workspaces/project/node_modules/dependency/package.json
|
|
{
|
|
"type": "module",
|
|
"name": "dependency",
|
|
"version": "1.0.0",
|
|
"exports": {
|
|
".": {
|
|
"types": "./lib/index.d.ts"
|
|
},
|
|
"./lol": {
|
|
"types": "./lib/lol.d.ts"
|
|
}
|
|
}
|
|
}
|
|
// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/index.d.ts
|
|
export function fooFromIndex(): void;
|
|
// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/lol.d.ts
|
|
export function fooFromLol(): void;
|
|
// @Filename: /home/src/workspaces/project/src/foo.ts
|
|
fooFrom/**/`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.MarkTestAsStradaServer()
|
|
f.GoToMarker(t, "")
|
|
f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{
|
|
IsIncomplete: false,
|
|
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
|
CommitCharacters: &DefaultCommitCharacters,
|
|
EditRange: Ignored,
|
|
},
|
|
Items: &fourslash.CompletionsExpectedItems{
|
|
Includes: []fourslash.CompletionsExpectedItem{
|
|
&lsproto.CompletionItem{
|
|
Label: "fooFromIndex",
|
|
Data: &lsproto.CompletionItemData{
|
|
AutoImport: &lsproto.AutoImportFix{
|
|
ModuleSpecifier: "dependency",
|
|
},
|
|
},
|
|
SortText: new(string(ls.SortTextAutoImportSuggestions)),
|
|
AdditionalTextEdits: fourslash.AnyTextEdits,
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "fooFromLol",
|
|
Data: &lsproto.CompletionItemData{
|
|
AutoImport: &lsproto.AutoImportFix{
|
|
ModuleSpecifier: "dependency/lol",
|
|
},
|
|
},
|
|
SortText: new(string(ls.SortTextAutoImportSuggestions)),
|
|
AdditionalTextEdits: fourslash.AnyTextEdits,
|
|
},
|
|
},
|
|
},
|
|
})
|
|
}
|