@@ -39,6 +39,8 @@ type API struct {
3939 symbols handleMap [ast.Symbol ]
4040 typesMu sync.Mutex
4141 types handleMap [checker.Type ]
42+
43+ typingsInstaller * project.TypingsInstaller
4244}
4345
4446var _ project.ProjectHost = (* API )(nil )
@@ -72,6 +74,21 @@ func (api *API) DefaultLibraryPath() string {
7274 return api .host .DefaultLibraryPath ()
7375}
7476
77+ // TypingsInstaller implements ProjectHost
78+ func (api * API ) TypingsInstaller () * project.TypingsInstaller {
79+ if api .typingsInstaller != nil {
80+ return api .typingsInstaller
81+ }
82+
83+ if typingsLocation := api .host .TypingsLocation (); typingsLocation != "" {
84+ api .typingsInstaller = & project.TypingsInstaller {
85+ TypingsLocation : typingsLocation ,
86+ ThrottleLimit : 5 ,
87+ }
88+ }
89+ return api .typingsInstaller
90+ }
91+
7592// DocumentRegistry implements ProjectHost.
7693func (api * API ) DocumentRegistry () * project.DocumentRegistry {
7794 return api .documentRegistry
@@ -109,6 +126,11 @@ func (api *API) Log(s string) {
109126 api .options .Logger .Info (s )
110127}
111128
129+ // Log implements ProjectHost.
130+ func (api * API ) HasLevel (level project.LogLevel ) bool {
131+ return api .options .Logger .HasLevel (level )
132+ }
133+
112134// NewLine implements ProjectHost.
113135func (api * API ) NewLine () string {
114136 return api .host .NewLine ()
0 commit comments