@@ -143,46 +143,19 @@ export async function startLanguageServerWithFallback(ctx: vscode.ExtensionConte
143143 }
144144
145145 languageServerStartInProgress = true ;
146- const progressMsg = languageServerIsRunning ? 'Restarting language service' : 'Starting language service' ;
147- await vscode . window . withProgress ( {
148- title : progressMsg ,
149- cancellable : ! activation ,
150- location : vscode . ProgressLocation . Notification ,
151- } , async ( progress , token ) => {
152- let disposable : vscode . Disposable ;
153- if ( token ) {
154- disposable = token . onCancellationRequested ( async ( ) => {
155- const choice = await vscode . window . showErrorMessage (
156- 'Language service restart request was interrupted and language service may be in a bad state. ' +
157- 'Please reload the window.' ,
158- 'Reload Window' ) ;
159- if ( choice === 'Reload Window' ) {
160- await vscode . commands . executeCommand ( 'workbench.action.reloadWindow' ) ;
161- }
162- } ) ;
163- }
164146
165- const started = await startLanguageServer ( ctx , cfg ) ;
147+ const started = await startLanguageServer ( ctx , cfg ) ;
166148
167- if ( ! started && goConfig [ 'useLanguageServer' ] === true ) {
168- // We already created various notification - e.g. missing gopls, ...
169- // So, just leave a log message here instead of issuing one more notification.
170- outputChannel . appendLine (
171- `Failed to start the language server (gopls). Falling back to default language providers...` ) ;
172- outputChannel . show ( ) ;
173- }
174- // If the server has been disabled, or failed to start,
175- // fall back to the default providers, while making sure not to
176- // re-register any providers.
177- if ( ! started && defaultLanguageProviders . length === 0 ) {
178- registerDefaultProviders ( ctx ) ;
179- }
149+ // If the server has been disabled, or failed to start,
150+ // fall back to the default providers, while making sure not to
151+ // re-register any providers.
152+ if ( ! started && defaultLanguageProviders . length === 0 ) {
153+ registerDefaultProviders ( ctx ) ;
154+ }
180155
181- if ( disposable ) { disposable . dispose ( ) ; }
182- languageServerIsRunning = started ;
183- updateLanguageServerIconGoStatusBar ( started , goConfig [ 'useLanguageServer' ] ) ;
184- languageServerStartInProgress = false ;
185- } ) ;
156+ languageServerIsRunning = started ;
157+ updateLanguageServerIconGoStatusBar ( started , goConfig [ 'useLanguageServer' ] === true ) ;
158+ languageServerStartInProgress = false ;
186159}
187160
188161// scheduleGoplsSuggestions sets timeouts for the various gopls-specific
0 commit comments