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,26 @@
package fourslash_test
import (
"testing"
"github.com/microsoft/typescript-go/internal/fourslash"
"github.com/microsoft/typescript-go/internal/testutil"
)
func TestGoToSourceFindImplementationNonNodeModules(t *testing.T) {
t.Parallel()
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
// When a .d.ts file is not in node_modules and has no sibling .js,
// source definition falls back to the standard definition provider
// and navigates to the .d.ts declaration.
const content = `// @moduleResolution: bundler
// @declaration: true
// @Filename: /home/src/workspaces/project/lib/helper.d.ts
export declare function helper(): string;
// @Filename: /home/src/workspaces/project/index.ts
import { /*usage*/helper } from "./lib/helper";
helper();`
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
defer done()
f.VerifyBaselineGoToSourceDefinition(t, "usage")
}