@@ -7,7 +7,6 @@ import * as path from 'path';
7
7
import * as vscode from 'vscode' ;
8
8
import { HostExecutableInformation } from "../shared/constants/HostExecutableInformation" ;
9
9
import { IHostExecutableResolver } from "../shared/constants/IHostExecutableResolver" ;
10
- import { getServerPath } from "../lsptoolshost/roslynLanguageServer" ;
11
10
import { PlatformInformation } from "../shared/platform" ;
12
11
import { Options } from "../shared/options" ;
13
12
import { existsSync } from 'fs' ;
@@ -20,16 +19,21 @@ interface IDotnetAcquireResult {
20
19
}
21
20
22
21
/**
23
- * Resolves the dotnet runtime from given options and the dotnet runtime VSCode extension.
22
+ * Resolves the dotnet runtime for a server executable from given options and the dotnet runtime VSCode extension.
24
23
*/
25
24
export class DotnetRuntimeExtensionResolver implements IHostExecutableResolver {
26
- constructor ( private platformInfo : PlatformInformation ) { }
25
+ constructor (
26
+ private platformInfo : PlatformInformation ,
27
+ /**
28
+ * This is a function instead of a string because the server path can change while the extension is active (when the option changes).
29
+ */
30
+ private getServerPath : ( options : Options , platform : PlatformInformation ) => string ) { }
27
31
28
32
private hostInfo : HostExecutableInformation | undefined ;
29
33
30
34
async getHostExecutableInfo ( options : Options ) : Promise < HostExecutableInformation > {
31
35
let dotnetRuntimePath = options . commonOptions . dotnetPath ;
32
- const serverPath = getServerPath ( options , this . platformInfo ) ;
36
+ const serverPath = this . getServerPath ( options , this . platformInfo ) ;
33
37
if ( ! dotnetRuntimePath )
34
38
{
35
39
let dotnetInfo = await this . acquireDotNetProcessDependencies ( serverPath ) ;
0 commit comments