Francesco Stasi 2021-05-04 18:38:19 +02:00 committed by Francesco Stasi
parent db48ed616b
commit 852bf9b73e
2 changed files with 4 additions and 1 deletions

View File

@ -288,10 +288,11 @@ export class ArduinoFrontendContribution implements FrontendApplicationContribut
} }
} }
const { clangdUri, cliUri, lsUri } = await this.executableService.list(); const { clangdUri, cliUri, lsUri } = await this.executableService.list();
const [clangdPath, cliPath, lsPath] = await Promise.all([ const [clangdPath, cliPath, lsPath, cliConfigPath] = await Promise.all([
this.fileService.fsPath(new URI(clangdUri)), this.fileService.fsPath(new URI(clangdUri)),
this.fileService.fsPath(new URI(cliUri)), this.fileService.fsPath(new URI(cliUri)),
this.fileService.fsPath(new URI(lsUri)), this.fileService.fsPath(new URI(lsUri)),
this.fileService.fsPath(new URI(await this.configService.getCliConfigFileUri()))
]); ]);
this.languageServerFqbn = await Promise.race([ this.languageServerFqbn = await Promise.race([
new Promise<undefined>((_, reject) => setTimeout(() => reject(new Error(`Timeout after ${20_000} ms.`)), 20_000)), new Promise<undefined>((_, reject) => setTimeout(() => reject(new Error(`Timeout after ${20_000} ms.`)), 20_000)),
@ -300,6 +301,7 @@ export class ArduinoFrontendContribution implements FrontendApplicationContribut
cliPath, cliPath,
clangdPath, clangdPath,
log: currentSketchPath ? currentSketchPath : log, log: currentSketchPath ? currentSketchPath : log,
cliConfigPath,
board: { board: {
fqbn, fqbn,
name: name ? `"${name}"` : undefined name: name ? `"${name}"` : undefined

View File

@ -2,6 +2,7 @@ export const ConfigServicePath = '/services/config-service';
export const ConfigService = Symbol('ConfigService'); export const ConfigService = Symbol('ConfigService');
export interface ConfigService { export interface ConfigService {
getVersion(): Promise<Readonly<{ version: string, commit: string, status?: string }>>; getVersion(): Promise<Readonly<{ version: string, commit: string, status?: string }>>;
getCliConfigFileUri(): Promise<string>;
getConfiguration(): Promise<Config>; getConfiguration(): Promise<Config>;
setConfiguration(config: Config): Promise<void>; setConfiguration(config: Config): Promise<void>;
isInDataDir(uri: string): Promise<boolean>; isInDataDir(uri: string): Promise<boolean>;