(editorId: number | boolean, newLangId: string)
| 1284 | } |
| 1285 | |
| 1286 | onLanguageChange(editorId: number | boolean, newLangId: string): void { |
| 1287 | if (this.sourceEditorId === editorId && this.currentLangId) { |
| 1288 | const languages = languagesService.getLanguagesOrFail(); |
| 1289 | const oldLangId = this.currentLangId; |
| 1290 | this.currentLangId = newLangId; |
| 1291 | // Store the current selected stuff to come back to it later in the same session (Not state stored!) |
| 1292 | this.infoByLang[oldLangId] = { |
| 1293 | compiler: this.compiler?.id ? this.compiler.id : (languages[oldLangId]?.defaultCompiler ?? ''), |
| 1294 | options: this.options, |
| 1295 | execArgs: this.executionArguments, |
| 1296 | execStdin: this.executionStdin, |
| 1297 | }; |
| 1298 | const info = this.infoByLang[this.currentLangId]; |
| 1299 | this.initLangAndCompiler({compilerName: '', id: 0, lang: newLangId, compiler: info?.compiler ?? ''}).then( |
| 1300 | () => { |
| 1301 | this.updateCompilersSelector(info); |
| 1302 | this.updateCompilerUI(); |
| 1303 | this.updateState(); |
| 1304 | }, |
| 1305 | ); |
| 1306 | } |
| 1307 | } |
| 1308 | |
| 1309 | async getCurrentLangCompilers(): Promise<CompilerInfo[]> { |
| 1310 | const allCompilers = await this.hub.compilerService.getCompilersForLang(this.currentLangId); |
nothing calls this directly
no test coverage detected