@@ -190,7 +190,7 @@ export class AnalysisExtensionActivator implements IExtensionActivator {
190190 const interpreterDataService = new InterpreterDataService ( this . context , this . services ) ;
191191 interpreterData = await interpreterDataService . getInterpreterData ( ) ;
192192 } catch ( ex ) {
193- this . appShell . showErrorMessage ( 'Unable to determine path to the Python interpreter. IntelliSense will be limited.' ) ;
193+ this . appShell . showWarningMessage ( 'Unable to determine path to the Python interpreter. IntelliSense will be limited.' ) ;
194194 }
195195
196196 this . interpreterHash = interpreterData ? interpreterData . hash : '' ;
@@ -204,13 +204,16 @@ export class AnalysisExtensionActivator implements IExtensionActivator {
204204 properties [ 'PrefixPath' ] = interpreterData . prefix ;
205205 }
206206
207- let searchPaths = interpreterData ? interpreterData . searchPaths : '' ;
207+ let searchPathsString = interpreterData ? interpreterData . searchPaths : '' ;
208+ let typeshedPaths : string [ ] = [ ] ;
209+
208210 const settings = this . configuration . getSettings ( ) ;
209211 if ( settings . autoComplete ) {
210212 const extraPaths = settings . autoComplete . extraPaths ;
211213 if ( extraPaths && extraPaths . length > 0 ) {
212- searchPaths = `${ searchPaths } ;${ extraPaths . join ( ';' ) } ` ;
214+ searchPathsString = `${ searchPathsString } ;${ extraPaths . join ( ';' ) } ` ;
213215 }
216+ typeshedPaths = settings . autoComplete . typeshedPaths ;
214217 }
215218
216219 // tslint:disable-next-line:no-string-literal
@@ -219,9 +222,13 @@ export class AnalysisExtensionActivator implements IExtensionActivator {
219222 // Make sure paths do not contain multiple slashes so file URIs
220223 // in VS Code (Node.js) and in the language server (.NET) match.
221224 // Note: for the language server paths separator is always ;
222- searchPaths = searchPaths . split ( path . delimiter ) . map ( p => path . normalize ( p ) ) . join ( ';' ) ;
225+ const searchPaths = searchPathsString . split ( path . delimiter ) . map ( p => path . normalize ( p ) ) ;
223226 // tslint:disable-next-line:no-string-literal
224- properties [ 'SearchPaths' ] = `${ searchPaths } ;${ pythonPath } ` ;
227+ properties [ 'SearchPaths' ] = `${ searchPaths . join ( ';' ) } ;${ pythonPath } ` ;
228+
229+ if ( ! typeshedPaths || typeshedPaths . length === 0 ) {
230+ typeshedPaths = [ path . join ( this . context . extensionPath , 'typeshed' ) ] ;
231+ }
225232
226233 const selector = [ { language : PYTHON , scheme : 'file' } ] ;
227234 const excludeFiles = this . getExcludedFiles ( ) ;
@@ -245,6 +252,8 @@ export class AnalysisExtensionActivator implements IExtensionActivator {
245252 trimDocumentationText : false ,
246253 maxDocumentationTextLength : 0
247254 } ,
255+ searchPaths,
256+ typeStubSearchPaths : typeshedPaths ,
248257 asyncStartup : true ,
249258 excludeFiles : excludeFiles ,
250259 testEnvironment : isTestExecution ( )
0 commit comments