52 lines
1.6 KiB
Go
52 lines
1.6 KiB
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual quickInfoOnObjectLiteralWithOnlySetter"
|
|
|
|
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/lsp/lsproto"
|
|
"github.com/microsoft/typescript-go/internal/testutil"
|
|
)
|
|
|
|
func TestQuickInfoOnObjectLiteralWithOnlySetter(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `function /*1*/makePoint(x: number) {
|
|
return {
|
|
b: 10,
|
|
set x(a: number) { this.b = a; }
|
|
};
|
|
};
|
|
var /*3*/point = makePoint(2);
|
|
point./*2*/x = 30;`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.VerifyCompletions(t, "2", &fourslash.CompletionsExpectedList{
|
|
IsIncomplete: false,
|
|
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
|
CommitCharacters: &DefaultCommitCharacters,
|
|
EditRange: Ignored,
|
|
},
|
|
Items: &fourslash.CompletionsExpectedItems{
|
|
Exact: []fourslash.CompletionsExpectedItem{
|
|
&lsproto.CompletionItem{
|
|
Label: "b",
|
|
Detail: new("(property) b: number"),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "x",
|
|
Detail: new("(property) x: number"),
|
|
},
|
|
},
|
|
},
|
|
})
|
|
f.VerifyQuickInfoAt(t, "1", "function makePoint(x: number): {\n b: number;\n x: number;\n}", "")
|
|
f.VerifyQuickInfoAt(t, "2", "(property) x: number", "")
|
|
f.VerifyQuickInfoAt(t, "3", "var point: {\n b: number;\n x: number;\n}", "")
|
|
}
|