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,37 @@
package fourslash_test
import (
"testing"
"github.com/microsoft/typescript-go/internal/fourslash"
"github.com/microsoft/typescript-go/internal/testutil"
)
// Regression test for https://github.com/microsoft/typescript-go/issues/3638
//
// A `textDocument/hover` on a JSX intrinsic element used to cause the
// subsequent `textDocument/diagnostic` pull to spuriously report
// TS2304: Cannot find name 'div'.
func TestHoverThenDiagnosticsJsxIntrinsic(t *testing.T) {
t.Parallel()
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
const content = `// @Filename: /tsconfig.json
{ "compilerOptions": { "strict": true, "jsx": "preserve" } }
// @Filename: /jsx.d.ts
declare namespace JSX {
interface Element { }
interface IntrinsicElements {
div: any;
}
}
// @Filename: /file.tsx
export default function Home() {
return <di/*1*/v>hi</div>;
}`
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
defer done()
// Hover on the intrinsic element first...
f.VerifyQuickInfoAt(t, "1", "(property) JSX.IntrinsicElements.div: any", "")
// ...then a subsequent diagnostic pull must not invent a TS2304 for `div`.
f.VerifyNoErrors(t)
}