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,41 @@
package tsoptionstest
import (
"github.com/microsoft/typescript-go/internal/tsoptions"
"github.com/microsoft/typescript-go/internal/tspath"
"github.com/microsoft/typescript-go/internal/vfs"
"github.com/microsoft/typescript-go/internal/vfs/vfstest"
)
func fixRoot(path string) string {
rootLength := tspath.GetRootLength(path)
if rootLength == 0 {
return path
}
if len(path) == rootLength {
return "."
}
return path[rootLength:]
}
type VfsParseConfigHost struct {
Vfs vfs.FS
CurrentDirectory string
}
var _ tsoptions.ParseConfigHost = (*VfsParseConfigHost)(nil)
func (h *VfsParseConfigHost) FS() vfs.FS {
return h.Vfs
}
func (h *VfsParseConfigHost) GetCurrentDirectory() string {
return h.CurrentDirectory
}
func NewVFSParseConfigHost(files map[string]string, currentDirectory string, useCaseSensitiveFileNames bool) *VfsParseConfigHost {
return &VfsParseConfigHost{
Vfs: vfstest.FromMap(files, useCaseSensitiveFileNames),
CurrentDirectory: currentDirectory,
}
}