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,54 @@
package fourslash_test
import (
"testing"
"github.com/microsoft/typescript-go/internal/core"
"github.com/microsoft/typescript-go/internal/fourslash"
"github.com/microsoft/typescript-go/internal/ls/lsutil"
"github.com/microsoft/typescript-go/internal/testutil"
)
func TestCodeLensFunctionsAndConstants01(t *testing.T) {
t.Parallel()
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
const content = `
// @module: preserve
// @filename: ./exports.ts
let callCount = 0;
export function foo(n: number): void {
callCount++;
if (n > 0) {
foo(n - 1);
}
else {
console.log("function was called " + callCount + " times");
}
}
foo(5);
export const bar = 123;
// @filename: ./importer.ts
import { foo, bar } from "./exports";
foo(5);
console.log(bar);
`
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
defer done()
f.VerifyBaselineCodeLens(t, &lsutil.UserPreferences{
CodeLens: lsutil.CodeLensUserPreferences{
ReferencesCodeLensEnabled: core.TSTrue,
ReferencesCodeLensShowOnAllFunctions: core.TSTrue,
ImplementationsCodeLensEnabled: core.TSTrue,
ImplementationsCodeLensShowOnInterfaceMethods: core.TSTrue,
ImplementationsCodeLensShowOnAllClassMethods: core.TSTrue,
},
})
}