mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
48 lines
1.5 KiB
Go
48 lines
1.5 KiB
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual completionListInNamedFunctionExpression"
|
|
|
|
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/testutil"
|
|
)
|
|
|
|
func TestCompletionListInNamedFunctionExpression(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `function foo(a: number): string {
|
|
/*insideFunctionDeclaration*/
|
|
return "";
|
|
}
|
|
|
|
(function foo(): number {
|
|
/*insideFunctionExpression*/
|
|
fo/*referenceInsideFunctionExpression*/o;
|
|
return "";
|
|
})
|
|
|
|
/*globalScope*/
|
|
fo/*referenceInGlobalScope*/o;`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.VerifyCompletions(t, []string{"globalScope", "insideFunctionDeclaration", "insideFunctionExpression"}, &fourslash.CompletionsExpectedList{
|
|
IsIncomplete: false,
|
|
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
|
CommitCharacters: &DefaultCommitCharacters,
|
|
EditRange: Ignored,
|
|
},
|
|
Items: &fourslash.CompletionsExpectedItems{
|
|
Includes: []fourslash.CompletionsExpectedItem{
|
|
"foo",
|
|
},
|
|
},
|
|
})
|
|
f.VerifyQuickInfoAt(t, "referenceInsideFunctionExpression", "(local function) foo(): number", "")
|
|
f.VerifyQuickInfoAt(t, "referenceInGlobalScope", "function foo(a: number): string", "")
|
|
}
|