mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
108 lines
3.4 KiB
Go
108 lines
3.4 KiB
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual autoImportProvider_exportMap6"
|
|
|
|
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_exportMap6(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `// @types package should be ignored because implementation package has types
|
|
// @Filename: /home/src/workspaces/project/tsconfig.json
|
|
{
|
|
"compilerOptions": {
|
|
"module": "nodenext",
|
|
"lib": ["es5"]
|
|
}
|
|
}
|
|
// @Filename: /home/src/workspaces/project/package.json
|
|
{
|
|
"type": "module",
|
|
"dependencies": {
|
|
"dependency": "^1.0.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/dependency": "^1.0.0"
|
|
}
|
|
}
|
|
// @Filename: /home/src/workspaces/project/node_modules/dependency/package.json
|
|
{
|
|
"type": "module",
|
|
"name": "dependency",
|
|
"version": "1.0.0",
|
|
"exports": {
|
|
".": "./lib/index.js",
|
|
"./lol": "./lib/lol.js"
|
|
}
|
|
}
|
|
// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/index.js
|
|
export function fooFromIndex() {}
|
|
// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/index.d.ts
|
|
export declare function fooFromIndex(): void
|
|
// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/lol.js
|
|
export function fooFromLol() {}
|
|
// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/lol.d.ts
|
|
export declare function fooFromLol(): void
|
|
// @Filename: /home/src/workspaces/project/node_modules/@types/dependency/package.json
|
|
{
|
|
"type": "module",
|
|
"name": "@types/dependency",
|
|
"version": "1.0.0",
|
|
"exports": {
|
|
".": "./lib/index.d.ts",
|
|
"./lol": "./lib/lol.d.ts"
|
|
}
|
|
}
|
|
// @Filename: /home/src/workspaces/project/node_modules/@types/dependency/lib/index.d.ts
|
|
export declare function fooFromAtTypesIndex(): void;
|
|
// @Filename: /home/src/workspaces/project/node_modules/@types/dependency/lib/lol.d.ts
|
|
export declare function fooFromAtTypesLol(): 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,
|
|
},
|
|
},
|
|
},
|
|
})
|
|
}
|