@@ -55,20 +55,28 @@ export class LocalWidgetScriptSourceProvider implements IWidgetScriptSourceProvi
5555
5656 const validFiles = files . filter ( ( file ) => {
5757 // Should be of the form `<widget module>/index.js`
58- const parts = file . split ( '/' ) ; // On windows this uses the unix separator too.
58+ let parts = file . split ( '/' ) ; // On windows this uses the unix separator too.
59+ if ( parts . length === 1 ) {
60+ // Fall back if search API changes and returns results with OS path sep.
61+ parts = file . split ( '\\' ) ;
62+ }
5963 if ( parts . length !== 2 ) {
60- traceError ( ' Incorrect file found when searching for nnbextension entrypoints' ) ;
64+ traceError ( ` Incorrect file found when searching for nnbextension entrypoints ${ file } ` ) ;
6165 return false ;
6266 }
6367 return true ;
6468 } ) ;
6569
6670 const mappedFiles = validFiles . map ( async ( file ) => {
6771 // Should be of the form `<widget module>/index.js`
68- const parts = file . split ( '/' ) ;
72+ let parts = file . split ( '/' ) ; // On windows this uses the unix separator too.
73+ if ( parts . length === 1 ) {
74+ // Fall back if search API changes and returns results with OS path sep.
75+ parts = file . split ( '\\' ) ;
76+ }
6977 const moduleName = parts [ 0 ] ;
7078
71- const fileUri = Uri . file ( path . join ( nbextensionsPath , file ) ) ;
79+ const fileUri = Uri . file ( path . join ( nbextensionsPath , moduleName , parts [ 1 ] ) ) ;
7280 const scriptUri = ( await this . localResourceUriConverter . asWebviewUri ( fileUri ) ) . toString ( ) ;
7381 // tslint:disable-next-line: no-unnecessary-local-variable
7482 const widgetScriptSource : WidgetScriptSource = { moduleName, scriptUri, source : 'local' } ;
0 commit comments