@@ -21,7 +21,6 @@ const downloadUriPrefix = 'https://pvsc.blob.core.windows.net/python-analysis';
2121const downloadBaseFileName = 'Python-Analysis-VSCode' ;
2222const downloadVersion = '0.1.0' ;
2323const downloadFileExtension = '.nupkg' ;
24- const modelName = 'model-sequence.json.gz' ;
2524
2625export class AnalysisEngineDownloader {
2726 private readonly output : OutputChannel ;
@@ -56,29 +55,6 @@ export class AnalysisEngineDownloader {
5655 }
5756 }
5857
59- public async downloadIntelliCodeModel ( context : ExtensionContext ) : Promise < void > {
60- const modelFolder = path . join ( context . extensionPath , 'analysis' , 'Pythia' , 'model' ) ;
61- const localPath = path . join ( modelFolder , modelName ) ;
62- if ( await this . fs . fileExists ( localPath ) ) {
63- return ;
64- }
65-
66- let localTempFilePath = '' ;
67- try {
68- localTempFilePath = await this . downloadFile ( downloadUriPrefix , modelName , 'Downloading IntelliCode Model File... ' ) ;
69- await this . fs . createDirectory ( modelFolder ) ;
70- await this . fs . copyFile ( localTempFilePath , localPath ) ;
71- } catch ( err ) {
72- this . output . appendLine ( 'failed.' ) ;
73- this . output . appendLine ( err ) ;
74- throw new Error ( err ) ;
75- } finally {
76- if ( localTempFilePath . length > 0 ) {
77- await this . fs . deleteFile ( localTempFilePath ) ;
78- }
79- }
80- }
81-
8258 private async downloadFile ( location : string , fileName : string , title : string ) : Promise < string > {
8359 const uri = `${ location } /${ fileName } ` ;
8460 this . output . append ( `Downloading ${ uri } ... ` ) ;
0 commit comments