vendor tsgo

This commit is contained in:
2026-07-09 16:50:43 -04:00
parent c06ea2e5a4
commit 98978e4930
5804 changed files with 1556156 additions and 101 deletions

View File

@@ -0,0 +1,74 @@
package fourslash_test
import (
"testing"
"github.com/microsoft/typescript-go/internal/fourslash"
"github.com/microsoft/typescript-go/internal/testutil"
)
func TestDestructuredInterfaceJSDoc(t *testing.T) {
t.Parallel()
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
const content = `
interface FooBar {
/** foo comment */
foo: number;
/** bar comment */
bar: string;
/** baz comment */
baz: string;
}
declare const fubar: FooBar;
const {/*1*/foo, /*2*/bar, /*3*/baz: /*4*/biz} = fubar;
`
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
defer done()
f.VerifyBaselineHover(t)
}
func TestDestructuredInterfaceJSDocWithRename(t *testing.T) {
t.Parallel()
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
const content = `
interface FooBar {
/** foo comment */
foo: number;
/** bar comment */
bar: string;
}
declare const fubar: FooBar;
const {foo: /*1*/myFoo, bar: /*2*/myBar} = fubar;
`
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
defer done()
f.VerifyBaselineHover(t)
}
func TestDestructuredWithOwnJSDoc(t *testing.T) {
t.Parallel()
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
const content = `
interface Foo {
/** This is bar from the interface */
bar: string;
/** This is baz from the interface */
baz: number;
}
declare var foo: Foo;
/** Comment on the variable statement. */
const {
/** Comment on bar destructuring. */ /*1*/bar,
/** Comment on baz destructuring. */ /*2*/baz
} = foo;
`
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
defer done()
f.VerifyBaselineHover(t)
}