@@ -5,7 +5,7 @@ import * as fs from 'fs';
5
5
import * as https from 'https' ;
6
6
import * as path from 'path' ;
7
7
import * as url from 'url' ;
8
- import { ExtensionContext , Uri , window , workspace , WorkspaceFolder } from 'vscode' ;
8
+ import { ExtensionContext , ProgressLocation , Uri , window , workspace , WorkspaceFolder } from 'vscode' ;
9
9
import { downloadFile , executableExists , userAgentHeader } from './utils' ;
10
10
11
11
/** GitHub API release */
@@ -29,9 +29,17 @@ const exeExtension = process.platform === 'win32' ? '.exe' : '';
29
29
*/
30
30
async function getProjectGhcVersion ( context : ExtensionContext , dir : string , release : IRelease ) : Promise < string | null > {
31
31
const callWrapper = ( wrapper : string ) => {
32
- // Need to set the encoding to 'utf8' in order to get back a string
33
- const out = child_process . spawnSync ( wrapper , [ '--project-ghc-version' ] , { encoding : 'utf8' , cwd : dir } ) ;
34
- return ! out . error ? out . stdout . trim ( ) : null ;
32
+ return window . withProgress (
33
+ {
34
+ location : ProgressLocation . Window ,
35
+ title : 'Working out the project GHC version' ,
36
+ } ,
37
+ async ( ) => {
38
+ // Need to set the encoding to 'utf8' in order to get back a string
39
+ const out = child_process . spawnSync ( wrapper , [ '--project-ghc-version' ] , { encoding : 'utf8' , cwd : dir } ) ;
40
+ return ! out . error ? out . stdout . trim ( ) : null ;
41
+ }
42
+ ) ;
35
43
} ;
36
44
37
45
const localWrapper = [ 'haskell-language-server-wrapper' ] . find ( executableExists ) ;
0 commit comments