File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export class GoPackageOutlineProvider implements vscode.TreeDataProvider<Package
3434 constructor ( ctx : vscode . ExtensionContext ) {
3535 this . reload ( vscode . window . activeTextEditor ?. document ) ;
3636 let previousVersion : number | undefined ;
37- // Reload package symbol data on saving document with changes
37+ // Reload package symbol data on saving active document with changes.
3838 ctx . subscriptions . push (
3939 vscode . workspace . onDidSaveTextDocument ( ( d ) => {
4040 if ( d . uri === vscode . window . activeTextEditor ?. document . uri ) {
@@ -45,12 +45,9 @@ export class GoPackageOutlineProvider implements vscode.TreeDataProvider<Package
4545 }
4646 } )
4747 ) ;
48- // Reload package symbol data when switching active file
48+ // Reload package symbol data when switching active file.
4949 ctx . subscriptions . push (
5050 vscode . window . onDidChangeActiveTextEditor ( ( e ) => {
51- if ( ! e ?. document ?. fileName . endsWith ( '.go' ) ) {
52- return ;
53- }
5451 this . reload ( e ?. document ) ;
5552 } )
5653 ) ;
@@ -105,7 +102,7 @@ export class GoPackageOutlineProvider implements vscode.TreeDataProvider<Package
105102 }
106103
107104 async reload ( e ?: vscode . TextDocument ) {
108- if ( ! e ) {
105+ if ( e ?. languageId !== 'go' || e ?. uri ?. scheme !== 'file' ) {
109106 this . result = undefined ;
110107 this . activeDocument = undefined ;
111108 return ;
Original file line number Diff line number Diff line change @@ -590,6 +590,10 @@ export async function buildLanguageClient(
590590
591591 return res ;
592592 } catch ( e ) {
593+ // Suppress error messages for frequently triggered commands.
594+ if ( command === 'gopls.package_symbols' ) {
595+ return null ;
596+ }
593597 // TODO: how to print ${e} reliably???
594598 const answer = await vscode . window . showErrorMessage (
595599 `Command '${ command } ' failed: ${ e } .` ,
You can’t perform that action at this time.
0 commit comments