Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/vscode-typescript/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export class Client implements vscode.Disposable {
this.documentSelector = [
...jsTsLanguageModes.map(language => ({ scheme: "file", language })),
...jsTsLanguageModes.map(language => ({ scheme: "untitled", language })),
...jsTsLanguageModes.map(language => ({ scheme: "zip", language })),
];
this.clientOptions = {
documentSelector: this.documentSelector,
Expand Down
17 changes: 16 additions & 1 deletion tsc/cmd/tsc/sys.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import (

"github.com/microsoft/TypeScript/tsc/internal/bundled"
"github.com/microsoft/TypeScript/tsc/internal/execute/tsc"
"github.com/microsoft/TypeScript/tsc/internal/pnp"
"github.com/microsoft/TypeScript/tsc/internal/tspath"
"github.com/microsoft/TypeScript/tsc/internal/vfs"
"github.com/microsoft/TypeScript/tsc/internal/vfs/osvfs"
"github.com/microsoft/TypeScript/tsc/internal/vfs/pnpvfs"
"golang.org/x/term"
)

Expand All @@ -22,6 +24,7 @@ type osSys struct {
defaultLibraryPath tspath.RootedDirectoryPath
cwd tspath.RootedDirectoryPath
start time.Time
pnpApi *pnp.PnpApi
}

func (s *osSys) SinceStart() time.Duration {
Expand Down Expand Up @@ -65,6 +68,10 @@ func (s *osSys) GetEnvironmentVariable(name string) (string, bool) {
return os.LookupEnv(name)
}

func (s *osSys) PnpApi() *pnp.PnpApi {
return s.pnpApi
}

func (s *osSys) Spawn(command []string, dir string, stderr io.Writer) (io.ReadWriteCloser, error) {
return spawnProcess(command, dir, stderr)
}
Expand Down Expand Up @@ -128,11 +135,19 @@ func newSystem() *osSys {
os.Exit(int(tsc.ExitStatusInvalidProject_OutputsSkipped))
}

var fs vfs.FS = osvfs.FS()

pnpApi := pnp.InitPnpApi(fs, tspath.RootedDirectoryPathFromAbsolute(cwd).AsString())
if pnpApi != nil {
fs = pnpvfs.From(fs)
}

return &osSys{
cwd: tspath.RootedDirectoryPathFromAbsolute(cwd),
fs: bundled.WrapFS(osvfs.FS()),
fs: bundled.WrapFS(fs),
defaultLibraryPath: bundled.LibPath(),
writer: os.Stdout,
start: time.Now(),
pnpApi: pnpApi,
}
}
7 changes: 7 additions & 0 deletions tsc/internal/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import (
"github.com/microsoft/TypeScript/tsc/internal/contentmapper"
"github.com/microsoft/TypeScript/tsc/internal/ipc"
"github.com/microsoft/TypeScript/tsc/internal/lsp/lsproto"
"github.com/microsoft/TypeScript/tsc/internal/pnp"
"github.com/microsoft/TypeScript/tsc/internal/project"
"github.com/microsoft/TypeScript/tsc/internal/tspath"
"github.com/microsoft/TypeScript/tsc/internal/vfs"
"github.com/microsoft/TypeScript/tsc/internal/vfs/osvfs"
"github.com/microsoft/TypeScript/tsc/internal/vfs/pnpvfs"
)

// StdioServerOptions configures the STDIO-based API server.
Expand Down Expand Up @@ -98,6 +100,10 @@ func (s *StdioServer) Run(ctx context.Context) error {
if baseFS == nil {
baseFS = osvfs.FS()
}
pnpApi := pnp.InitPnpApi(baseFS, s.options.Cwd.AsString())
if pnpApi != nil {
baseFS = pnpvfs.From(baseFS)
}
fs := bundled.WrapFS(baseFS)

// Wrap the base FS when callbacks or an explicit case-sensitivity setting are requested.
Expand All @@ -111,6 +117,7 @@ func (s *StdioServer) Run(ctx context.Context) error {
BackgroundCtx: ctx,
Logger: nil, // TODO: Add logging support
FS: fs,
PnpApi: pnpApi,
Options: &project.SessionOptions{
CurrentDirectory: s.options.Cwd,
DefaultLibraryPath: s.options.DefaultLibraryPath,
Expand Down
13 changes: 11 additions & 2 deletions tsc/internal/api/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
"github.com/microsoft/TypeScript/tsc/internal/lsp/lsproto"
"github.com/microsoft/TypeScript/tsc/internal/module"
"github.com/microsoft/TypeScript/tsc/internal/nodebuilder"
"github.com/microsoft/TypeScript/tsc/internal/pnp"
"github.com/microsoft/TypeScript/tsc/internal/pprof"
"github.com/microsoft/TypeScript/tsc/internal/printer"
"github.com/microsoft/TypeScript/tsc/internal/project"
Expand Down Expand Up @@ -681,6 +682,13 @@ func (s *Session) FS() vfs.FS {
return s.snapshotHost.FS()
}

func (s *Session) PnpApi() *pnp.PnpApi {
if s.projectSession != nil {
return s.projectSession.PnpApi()
}
return s.snapshotHost.PnpApi()
}

func (s *Session) DefaultLibraryPath() tspath.RootedDirectoryPath {
if s.projectSession != nil {
return s.projectSession.DefaultLibraryPath()
Expand Down Expand Up @@ -2021,6 +2029,7 @@ type apiBuildSystem struct {
func (s *apiBuildSystem) Writer() io.Writer { return io.Discard }
func (s *apiBuildSystem) ErrorWriter() io.Writer { return io.Discard }
func (s *apiBuildSystem) FS() vfs.FS { return s.session.snapshotHost.FS() }
func (s *apiBuildSystem) PnpApi() *pnp.PnpApi { return s.session.PnpApi() }
func (s *apiBuildSystem) DefaultLibraryPath() tspath.RootedDirectoryPath {
return s.session.DefaultLibraryPath()
}
Expand Down Expand Up @@ -2098,7 +2107,7 @@ func (s *Session) handleParseJsonConfigFileContent(ctx context.Context, params *

parsedCommandLine := tsoptions.ParseJsonConfigFileContent(
jsonValueToAny(params.JSON),
tsoptions.NewDefaultParseConfigHost(s.snapshotHost.FS()),
tsoptions.NewDefaultParseConfigHost(s.snapshotHost.FS(), s.PnpApi()),
basePath,
nil, /*existingOptions*/
configFileName,
Expand All @@ -2124,7 +2133,7 @@ func (s *Session) handleParseConfigFile(ctx context.Context, params *ParseConfig
)
parsedCommandLine := tsoptions.ParseJsonSourceFileConfigFileContent(
tsConfigSourceFile,
tsoptions.NewDefaultParseConfigHost(s.snapshotHost.FS()),
tsoptions.NewDefaultParseConfigHost(s.snapshotHost.FS(), s.PnpApi()),
configDir,
nil, /*existingOptions*/
nil, /*existingOptionsRaw*/
Expand Down
12 changes: 6 additions & 6 deletions tsc/internal/checker/checker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ foo.bar;`
}, tspath.CaseInsensitive /*caseSensitivity*/)
fs = bundled.WrapFS(fs)

host := compiler.NewCompilerHost(fs, bundled.LibPath(), nil, nil, nil)
host := compiler.NewCompilerHost(fs, bundled.LibPath(), nil, nil, nil, nil)
parsed, errors := tsoptions.GetParsedCommandLineOfConfigFile("/tsconfig.json", &core.CompilerOptions{}, nil, tsoptions.NewDefaultParseConfigHost(fs), nil)
assert.Equal(t, len(errors), 0, "Expected no errors in parsed command line")

Expand Down Expand Up @@ -86,7 +86,7 @@ export type E = D;`,
}, tspath.CaseInsensitive)
fs = bundled.WrapFS(fs)

host := compiler.NewCompilerHost(fs, bundled.LibPath(), nil, nil, nil)
host := compiler.NewCompilerHost(fs, bundled.LibPath(), nil, nil, nil, nil)

parsed, errors := tsoptions.GetParsedCommandLineOfConfigFile("/tsconfig.json", &core.CompilerOptions{}, nil, tsoptions.NewDefaultParseConfigHost(fs), nil)
assert.Equal(t, len(errors), 0, "Expected no errors in parsed command line")
Expand Down Expand Up @@ -122,7 +122,7 @@ export type E = D;`,
func BenchmarkNewChecker(b *testing.B) {
fs := bundled.WrapFS(osvfs.FS())
rootPath := tspath.RootedDirectoryPathFromAbsolute(filepath.Join(repo.TestDataPath(), "fixtures/compiler"))
host := compiler.NewCompilerHost(fs, bundled.LibPath(), nil, nil, nil)
host := compiler.NewCompilerHost(fs, bundled.LibPath(), nil, nil, nil, nil)
parsed, errors := tsoptions.GetParsedCommandLineOfConfigFile(rootPath.ResolveFile("tsconfig.json"), &core.CompilerOptions{}, nil, tsoptions.NewDefaultParseConfigHost(fs), nil)
assert.Equal(b, len(errors), 0, "Expected no errors in parsed command line")
program, err := compiler.NewProgram(b.Context(), compiler.ProgramOptions{
Expand All @@ -140,7 +140,7 @@ func BenchmarkNewChecker(b *testing.B) {
func BenchmarkCheck(b *testing.B) {
fs := bundled.WrapFS(osvfs.FS())
rootPath := tspath.RootedDirectoryPathFromAbsolute(filepath.Join(repo.TestDataPath(), "fixtures/compiler"))
host := compiler.NewCompilerHost(fs, bundled.LibPath(), nil, nil, nil)
host := compiler.NewCompilerHost(fs, bundled.LibPath(), nil, nil, nil, nil)
parsed, errors := tsoptions.GetParsedCommandLineOfConfigFile(rootPath.ResolveFile("tsconfig.json"), &core.CompilerOptions{}, nil, tsoptions.NewDefaultParseConfigHost(fs), nil)
assert.Equal(b, len(errors), 0, "Expected no errors in parsed command line")
program, err := compiler.NewProgram(b.Context(), compiler.ProgramOptions{
Expand All @@ -164,7 +164,7 @@ func BenchmarkCheck(b *testing.B) {
func BenchmarkCheckFreshProgram(b *testing.B) {
fs := bundled.WrapFS(osvfs.FS())
rootPath := tspath.RootedDirectoryPathFromAbsolute(filepath.Join(repo.TestDataPath(), "fixtures/compiler"))
host := compiler.NewCompilerHost(fs, bundled.LibPath(), nil, nil, nil)
host := compiler.NewCompilerHost(fs, bundled.LibPath(), nil, nil, nil, nil)
parsed, errors := tsoptions.GetParsedCommandLineOfConfigFile(rootPath.ResolveFile("tsconfig.json"), &core.CompilerOptions{}, nil, tsoptions.NewDefaultParseConfigHost(fs), nil)
assert.Equal(b, len(errors), 0, "Expected no errors in parsed command line")
ctx := b.Context()
Expand Down Expand Up @@ -197,7 +197,7 @@ export type Initial = Box<"first">;
opts := &core.CompilerOptions{NoLib: core.TSTrue}
program, err := compiler.NewProgram(t.Context(), compiler.ProgramOptions{
Config: tsoptions.NewParsedCommandLine(opts, []tspath.RootedFilePath{"/foo.ts"}, nil, "/", fs.CaseSensitivity()),
Host: compiler.NewCompilerHost(fs, bundled.LibPath(), nil, nil, nil),
Host: compiler.NewCompilerHost(fs, bundled.LibPath(), nil, nil, nil, nil),
})
assert.NilError(t, err)
program.BindSourceFiles()
Expand Down
4 changes: 2 additions & 2 deletions tsc/internal/compiler/checkerpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestCheckerGroupStopsOnCancellation(t *testing.T) {
program, err := NewProgram(t.Context(), ProgramOptions{
Config: config,
SingleThreaded: core.TSTrue,
Host: NewCompilerHost(fs, "/", nil, nil, nil),
Host: NewCompilerHost(fs, "/", nil, nil, nil, nil),
})
assert.NilError(t, err)
ctx, cancel := context.WithCancel(t.Context())
Expand All @@ -52,7 +52,7 @@ func TestSemanticDiagnosticsWithCancelledContext(t *testing.T) {
program, err := NewProgram(t.Context(), ProgramOptions{
Config: config,
SingleThreaded: singleThreaded,
Host: NewCompilerHost(fs, "/", nil, nil, nil),
Host: NewCompilerHost(fs, "/", nil, nil, nil, nil),
})
assert.NilError(t, err)
ctx, cancel := context.WithCancel(t.Context())
Expand Down
18 changes: 9 additions & 9 deletions tsc/internal/compiler/contentmapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func newContentMapperProgramWithOutputExtensions(t *testing.T, contentMapperProj
config.ParsedConfig.ContentMappers = []*contentmapper.Mapper{{Package: "vue", Extensions: []string{".vue"}, OutputExtensions: outputExtensions, Name: "vue-mapper", Version: "1.0.0"}}
program, err := compiler.NewProgram(t.Context(), compiler.ProgramOptions{
Config: config,
Host: compiler.NewCompilerHost(fs, bundled.LibPath(), nil, nil, contentMapperProject),
Host: compiler.NewCompilerHost(fs, bundled.LibPath(), nil, nil, nil, contentMapperProject),
// Load files on the calling goroutine for deterministic diagnostics ordering.
SingleThreaded: core.TSTrue,
})
Expand Down Expand Up @@ -122,7 +122,7 @@ func TestContentMapperSymlinkedPackage(t *testing.T) {
}
program, err := compiler.NewProgram(t.Context(), compiler.ProgramOptions{
Config: config,
Host: compiler.NewCompilerHost(fs, "/", nil, nil, fakeContentMapperHost{
Host: compiler.NewCompilerHost(fs, "/", nil, nil, nil, fakeContentMapperHost{
transform: func(fileName, content string) (contentmapper.Result, error) {
return contentmapper.Result{Text: "export const value = 1;", VirtualExtension: ".ts", Mappings: spanmap.New(nil)}, nil
},
Expand Down Expand Up @@ -169,7 +169,7 @@ func TestContentMapperRelativeSymlinkedDirectory(t *testing.T) {
assert.Assert(t, slices.Contains(config.FileNames(), "/project/src/linked/data.vue"))
program, err := compiler.NewProgram(t.Context(), compiler.ProgramOptions{
Config: config,
Host: compiler.NewCompilerHost(fs, "/", nil, nil, fakeContentMapperHost{
Host: compiler.NewCompilerHost(fs, "/", nil, nil, nil, fakeContentMapperHost{
transform: func(fileName, content string) (contentmapper.Result, error) {
return contentmapper.Result{Text: "export const value = 1;", VirtualExtension: ".ts", Mappings: spanmap.New(nil)}, nil
},
Expand Down Expand Up @@ -229,7 +229,7 @@ func TestContentMapperDynamicRewriteValidation(t *testing.T) {
config.ParsedConfig.ContentMappers = []*contentmapper.Mapper{mapper}
program, err := compiler.NewProgram(t.Context(), compiler.ProgramOptions{
Config: config,
Host: compiler.NewCompilerHost(fs, "/", nil, nil, nil),
Host: compiler.NewCompilerHost(fs, "/", nil, nil, nil, nil),
SingleThreaded: core.TSTrue,
})
assert.NilError(t, err)
Expand Down Expand Up @@ -279,7 +279,7 @@ func TestContentMapperRuntimeRewrites(t *testing.T) {
}
program, err := compiler.NewProgram(t.Context(), compiler.ProgramOptions{
Config: config,
Host: compiler.NewCompilerHost(fs, "/", nil, nil, fakeContentMapperHost{
Host: compiler.NewCompilerHost(fs, "/", nil, nil, nil, fakeContentMapperHost{
transform: func(fileName, content string) (contentmapper.Result, error) {
return contentmapper.Result{Text: content, VirtualExtension: ".ts", Mappings: spanmap.New(nil)}, nil
},
Expand Down Expand Up @@ -319,7 +319,7 @@ func TestContentMapperOverlappingExtensionDeclarationRoundTrip(t *testing.T) {
RootDir: "/project", OutDir: "/dist",
}, []tspath.RootedFilePath{"/project/special/widget.part.toml", "/project/other/widget.part.toml"}, nil, "/project", fs.CaseSensitivity())
config.ParsedConfig.ContentMappers = mappers
host := compiler.NewCompilerHost(fs, "/", nil, nil, fakeContentMapperHost{
host := compiler.NewCompilerHost(fs, "/", nil, nil, nil, fakeContentMapperHost{
transform: func(fileName, content string) (contentmapper.Result, error) {
return contentmapper.Result{Text: content, VirtualExtension: ".ts", Mappings: spanmap.New(nil)}, nil
},
Expand Down Expand Up @@ -386,7 +386,7 @@ func TestContentMapperExcludedResolution(t *testing.T) {
}}
program, err := compiler.NewProgram(t.Context(), compiler.ProgramOptions{
Config: config,
Host: compiler.NewCompilerHost(fs, "/", nil, nil, fakeContentMapperHost{
Host: compiler.NewCompilerHost(fs, "/", nil, nil, nil, fakeContentMapperHost{
transform: func(fileName, content string) (contentmapper.Result, error) {
t.Errorf("unexpected transform of %s", fileName)
return contentmapper.Result{}, errors.New("unexpected transform")
Expand Down Expand Up @@ -459,7 +459,7 @@ func TestContentMapperLiteralRewriteValidation(t *testing.T) {
}}
program, err := compiler.NewProgram(t.Context(), compiler.ProgramOptions{
Config: config,
Host: compiler.NewCompilerHost(fs, "/", nil, nil, fakeContentMapperHost{
Host: compiler.NewCompilerHost(fs, "/", nil, nil, nil, fakeContentMapperHost{
transform: func(fileName, content string) (contentmapper.Result, error) {
return contentmapper.Result{Text: content, VirtualExtension: ".ts", Mappings: spanmap.New(nil)}, nil
},
Expand Down Expand Up @@ -764,7 +764,7 @@ func TestContentMapperMissingSourceFile(t *testing.T) {
config.ParsedConfig.ContentMappers = []*contentmapper.Mapper{{Package: "vue", Extensions: []string{".vue"}, Name: "vue-mapper", Version: "1.0.0"}}
program, err := compiler.NewProgram(t.Context(), compiler.ProgramOptions{
Config: config,
Host: missingContentMappedCompilerHost{CompilerHost: compiler.NewCompilerHost(fs, "/", nil, nil, nil)},
Host: missingContentMappedCompilerHost{CompilerHost: compiler.NewCompilerHost(fs, "/", nil, nil, nil, nil)},
})
assert.NilError(t, err)
assert.Assert(t, program.GetSourceFile("/src/Component.vue") == nil)
Expand Down
4 changes: 4 additions & 0 deletions tsc/internal/compiler/emitHost.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/microsoft/TypeScript/tsc/internal/module"
"github.com/microsoft/TypeScript/tsc/internal/outputpaths"
"github.com/microsoft/TypeScript/tsc/internal/packagejson"
"github.com/microsoft/TypeScript/tsc/internal/pnp"
"github.com/microsoft/TypeScript/tsc/internal/printer"
"github.com/microsoft/TypeScript/tsc/internal/symlinks"
"github.com/microsoft/TypeScript/tsc/internal/transformers/declarations"
Expand All @@ -26,6 +27,7 @@ type EmitHost interface {
BaseDirectory() tspath.RootedDirectoryPath
CommonSourceDirectory() tspath.RootedDirectoryPath
IsEmitBlocked(file tspath.RootedFilePath) bool
PnpApi() *pnp.PnpApi
}

var _ EmitHost = (*emitHost)(nil)
Expand Down Expand Up @@ -123,6 +125,8 @@ func (host *emitHost) CaseSensitivity() tspath.CaseSensitivity {
return host.program.CaseSensitivity()
}

func (host *emitHost) PnpApi() *pnp.PnpApi { return host.program.PnpApi() }

func (host *emitHost) IsEmitBlocked(file tspath.RootedFilePath) bool {
return host.program.IsEmitBlocked(file)
}
Expand Down
8 changes: 4 additions & 4 deletions tsc/internal/compiler/emit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestEmitStopsWritingOnCancellation(t *testing.T) {
testFileNames("/src/a.ts", "/src/b.ts"), nil, "/src", tspath.CaseSensitive,
),
SingleThreaded: core.TSTrue,
Host: compiler.NewCompilerHost(fs, "/", nil, nil, nil),
Host: compiler.NewCompilerHost(fs, "/", nil, nil, nil, nil),
})
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -87,7 +87,7 @@ func BenchmarkEmitLongLines(b *testing.B) {
OutDir: "/dev/out",
}

host := compiler.NewCompilerHost(fs, bundled.LibPath(), nil, nil, nil)
host := compiler.NewCompilerHost(fs, bundled.LibPath(), nil, nil, nil, nil)

p, err := compiler.NewProgram(b.Context(), compiler.ProgramOptions{
Config: tsoptions.NewParsedCommandLine(&opts, testFileNames("/dev/src/index.ts"), nil, "/dev/src", fs.CaseSensitivity()),
Expand Down Expand Up @@ -140,7 +140,7 @@ func BenchmarkEmitManyFiles(b *testing.B) {
OutDir: "/dev/out",
}

host := compiler.NewCompilerHost(fs, bundled.LibPath(), nil, nil, nil)
host := compiler.NewCompilerHost(fs, bundled.LibPath(), nil, nil, nil, nil)

p, err := compiler.NewProgram(b.Context(), compiler.ProgramOptions{
Config: tsoptions.NewParsedCommandLine(&opts, testFileNames(fileNames...), nil, "/dev/src", fs.CaseSensitivity()),
Expand Down Expand Up @@ -196,7 +196,7 @@ func BenchmarkEmitLongLinesWithLineBreaks(b *testing.B) {
OutDir: "/dev/out",
}

host := compiler.NewCompilerHost(fs, bundled.LibPath(), nil, nil, nil)
host := compiler.NewCompilerHost(fs, bundled.LibPath(), nil, nil, nil, nil)

p, err := compiler.NewProgram(b.Context(), compiler.ProgramOptions{
Config: tsoptions.NewParsedCommandLine(&opts, testFileNames("/dev/src/index.ts"), nil, "/dev/src", fs.CaseSensitivity()),
Expand Down
7 changes: 6 additions & 1 deletion tsc/internal/compiler/fileloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/microsoft/TypeScript/tsc/internal/module"
"github.com/microsoft/TypeScript/tsc/internal/nativepath"
"github.com/microsoft/TypeScript/tsc/internal/parser"
"github.com/microsoft/TypeScript/tsc/internal/pnp"
"github.com/microsoft/TypeScript/tsc/internal/spanmap"
"github.com/microsoft/TypeScript/tsc/internal/tracing"
"github.com/microsoft/TypeScript/tsc/internal/tsoptions"
Expand Down Expand Up @@ -159,6 +160,10 @@ func (h *compilerResolutionHost) GetCurrentDirectory() tspath.RootedDirectoryPat
return h.baseDirectory
}

func (h *compilerResolutionHost) PnpApi() *pnp.PnpApi {
return h.host.PnpApi()
}

type jsxRuntimeImportSpecifier struct {
moduleReference string
specifier *ast.StringLiteralNode
Expand Down Expand Up @@ -300,7 +305,7 @@ func (p *fileLoader) resolveAutomaticTypeDirectives(ctx context.Context, contain
typeResolutionsTrace []module.DiagAndArgs,
pDiagnostics []*processingDiagnostic,
) {
automaticTypeDirectiveNames := module.GetAutomaticTypeDirectiveNames(p.opts.Config.CompilerOptions(), p.opts.Config.BaseDirectory(), p.host.FS())
automaticTypeDirectiveNames := module.GetAutomaticTypeDirectiveNames(p.opts.Config.CompilerOptions(), p.opts.Config.BaseDirectory(), p.host.FS(), p.host.PnpApi())
if len(automaticTypeDirectiveNames) != 0 {
toParse = make([]resolvedRef, 0, len(automaticTypeDirectiveNames))
typeResolutionsInFile = make(module.ModeAwareCache[*module.ResolvedTypeReferenceDirective], len(automaticTypeDirectiveNames))
Expand Down
Loading