11import * as vscode from "vscode" ;
2- import { deactivateLanguageServer } from "../workflow/languageServer" ;
2+ import { deactivateLanguageServer , initLanguageServer } from "../workflow/languageServer" ;
33
44const settingsKey = "github-actions" ;
55const DEFAULT_GITHUB_API = "https://api.github.com" ;
@@ -9,8 +9,11 @@ export function initConfiguration(context: vscode.ExtensionContext) {
99 vscode . workspace . onDidChangeConfiguration ( e => {
1010 if ( e . affectsConfiguration ( getSettingsKey ( "workflows.pinned" ) ) ) {
1111 pinnedWorkflowsChangeHandlers . forEach ( h => h ( ) ) ;
12- } else if ( e . affectsConfiguration ( getSettingsKey ( "use-enterprise" ) ) ) {
13- updateLanguageServerApiUrl ( ) ;
12+ } else if (
13+ e . affectsConfiguration ( getSettingsKey ( "use-enterprise" ) ) ||
14+ e . affectsConfiguration ( "github-enterprise.uri" )
15+ ) {
16+ updateLanguageServerApiUrl ( context ) ;
1417 }
1518 } )
1619 ) ;
@@ -67,8 +70,8 @@ export function getGitHubApiUri(): string {
6770 return base === DEFAULT_GITHUB_API ? base : `${ base } /api/v3` ;
6871}
6972
70- function updateLanguageServerApiUrl ( ) {
71- // deactivateLanguageServer();
72- // TODO: restart language server with new URL configured
73- throw new Error ( "Can't yet change the api url parameter without restart." ) ;
73+ function updateLanguageServerApiUrl ( context : vscode . ExtensionContext ) {
74+ deactivateLanguageServer ( ) ;
75+
76+ initLanguageServer ( context ) ;
7477}
0 commit comments