37 lines
1014 B
Go
37 lines
1014 B
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual codeFixInferFromFunctionThisUsageObjectPropertyShorthandParameter"
|
|
|
|
package fourslash_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/microsoft/typescript-go/internal/fourslash"
|
|
"github.com/microsoft/typescript-go/internal/testutil"
|
|
)
|
|
|
|
func TestCodeFixInferFromFunctionThisUsageObjectPropertyShorthandParameter(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `// @noImplicitThis: true
|
|
function returnThisMember([| |]suffix: string) {
|
|
return this.member + suffix;
|
|
}
|
|
|
|
interface Container {
|
|
member: string;
|
|
returnThisMember(suffix: string): string;
|
|
}
|
|
|
|
const container: Container = {
|
|
member: "sample",
|
|
returnThisMember,
|
|
};
|
|
|
|
container.returnThisMember("");`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.VerifyRangeAfterCodeFix(t, `this: Container, `, false, 0, 0)
|
|
}
|