forked from microsoft/typescript-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompilerHost.go
More file actions
54 lines (42 loc) · 1.56 KB
/
compilerHost.go
File metadata and controls
54 lines (42 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package build
import (
"github.com/microsoft/typescript-go/internal/ast"
"github.com/microsoft/typescript-go/internal/compiler"
"github.com/microsoft/typescript-go/internal/core"
"github.com/microsoft/typescript-go/internal/module"
"github.com/microsoft/typescript-go/internal/tsoptions"
"github.com/microsoft/typescript-go/internal/tspath"
"github.com/microsoft/typescript-go/internal/vfs"
)
type compilerHost struct {
host *host
trace func(msg string)
}
var _ compiler.CompilerHost = (*compilerHost)(nil)
func (h *compilerHost) FS() vfs.FS {
return h.host.FS()
}
func (h *compilerHost) DefaultLibraryPath() string {
return h.host.DefaultLibraryPath()
}
func (h *compilerHost) GetCurrentDirectory() string {
return h.host.GetCurrentDirectory()
}
func (h *compilerHost) GetDenoForkContextInfo() ast.DenoForkContextInfo {
return h.host.GetDenoForkContextInfo()
}
func (h *compilerHost) IsNodeSourceFile(path tspath.Path) bool {
return h.host.IsNodeSourceFile(path)
}
func (h *compilerHost) Trace(msg string) {
h.trace(msg)
}
func (h *compilerHost) GetSourceFile(opts ast.SourceFileParseOptions) *ast.SourceFile {
return h.host.GetSourceFile(opts)
}
func (h *compilerHost) MakeResolver(host module.ResolutionHost, options *core.CompilerOptions, typingsLocation string, projectName string) module.ResolverInterface {
return h.host.MakeResolver(host, options, typingsLocation, projectName)
}
func (h *compilerHost) GetResolvedProjectReference(fileName string, path tspath.Path) *tsoptions.ParsedCommandLine {
return h.host.GetResolvedProjectReference(fileName, path)
}