File tree 2 files changed +7
-6
lines changed
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
34
34
constructor ( ctx : vscode . ExtensionContext ) {
35
35
this . reload ( vscode . window . activeTextEditor ?. document ) ;
36
36
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.
38
38
ctx . subscriptions . push (
39
39
vscode . workspace . onDidSaveTextDocument ( ( d ) => {
40
40
if ( d . uri === vscode . window . activeTextEditor ?. document . uri ) {
@@ -45,12 +45,9 @@ export class GoPackageOutlineProvider implements vscode.TreeDataProvider<Package
45
45
}
46
46
} )
47
47
) ;
48
- // Reload package symbol data when switching active file
48
+ // Reload package symbol data when switching active file.
49
49
ctx . subscriptions . push (
50
50
vscode . window . onDidChangeActiveTextEditor ( ( e ) => {
51
- if ( ! e ?. document ?. fileName . endsWith ( '.go' ) ) {
52
- return ;
53
- }
54
51
this . reload ( e ?. document ) ;
55
52
} )
56
53
) ;
@@ -105,7 +102,7 @@ export class GoPackageOutlineProvider implements vscode.TreeDataProvider<Package
105
102
}
106
103
107
104
async reload ( e ?: vscode . TextDocument ) {
108
- if ( ! e ) {
105
+ if ( e ?. languageId !== 'go' || e ?. uri ?. scheme !== 'file' ) {
109
106
this . result = undefined ;
110
107
this . activeDocument = undefined ;
111
108
return ;
Original file line number Diff line number Diff line change @@ -590,6 +590,10 @@ export async function buildLanguageClient(
590
590
591
591
return res ;
592
592
} catch ( e ) {
593
+ // Suppress error messages for frequently triggered commands.
594
+ if ( command === 'gopls.package_symbols' ) {
595
+ return null ;
596
+ }
593
597
// TODO: how to print ${e} reliably???
594
598
const answer = await vscode . window . showErrorMessage (
595
599
`Command '${ command } ' failed: ${ e } .` ,
You can’t perform that action at this time.
0 commit comments