Skip to content

Commit

Permalink
src/goReferencesCodelens: delete references codelens code
Browse files Browse the repository at this point in the history
The references codelens deprecation notice was sent in early Nov (v0.36.0 release).
There was no complaint or user feedback. Deleting the code now.

Fixes golang#2519

Change-Id: I4f0bf0a0f17d9b7520a938cdc7431d5be53dc5ea
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/464098
Run-TryBot: Hyang-Ah Hana Kim <[email protected]>
Reviewed-by: Peter Weinberger <[email protected]>
TryBot-Result: kokoro <[email protected]>
  • Loading branch information
hyangah committed Feb 1, 2023
1 parent 196bd79 commit 203717d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 179 deletions.
44 changes: 0 additions & 44 deletions src/goMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import { setLogConfig } from './goLogging';
import { GO_MODE } from './goMode';
import { GO111MODULE, goModInit, isModSupported } from './goModules';
import { playgroundCommand } from './goPlayground';
import { GoReferencesCodeLensProvider } from './goReferencesCodelens';
import { GoRunTestCodeLensProvider } from './goRunTestCodelens';
import { disposeGoStatusBar, expandGoStatusBar, updateGoStatusBar } from './goStatus';

Expand Down Expand Up @@ -121,7 +120,6 @@ export async function activate(ctx: vscode.ExtensionContext): Promise<ExtensionA
registerCommand('go.environment.status', expandGoStatusBar);

GoRunTestCodeLensProvider.activate(ctx, goCtx);
GoReferencesCodeLensProvider.activate(ctx, goCtx);
GoDebugConfigurationProvider.activate(ctx, goCtx);
GoDebugFactory.activate(ctx);

Expand Down Expand Up @@ -391,46 +389,4 @@ async function showDeprecationWarning() {
}
}
}
const codelensFeatures = cfg['enableCodeLens'];
if (codelensFeatures && codelensFeatures['references']) {
const promptKey = 'promptedCodeLensReferencesFeatureDeprecation';
const prompted = getFromGlobalState(promptKey, false);
if (!prompted) {
const msg =
"The 'go.enableCodeLens.references' setting will be removed soon. Please see [Issue 2509](https://go.dev/s/vscode-issue/2509).";
const selected = await vscode.window.showWarningMessage(msg, 'Update Settings', "Don't show again");
switch (selected) {
case 'Update Settings':
{
const { globalValue, workspaceValue, workspaceFolderValue } = cfg.inspect<{
[key: string]: boolean;
}>('enableCodeLens') || {
globalValue: undefined,
workspaceValue: undefined,
workspaceFolderValue: undefined
};
if (globalValue && globalValue['references']) {
delete globalValue.references;
cfg.update('enableCodeLens', globalValue, vscode.ConfigurationTarget.Global);
}
if (workspaceValue && workspaceValue['references']) {
delete workspaceValue.references;
cfg.update('enableCodeLens', workspaceValue, vscode.ConfigurationTarget.Workspace);
}
if (workspaceFolderValue && workspaceFolderValue['references']) {
delete workspaceFolderValue.references;
cfg.update(
'enableCodeLens',
workspaceFolderValue,
vscode.ConfigurationTarget.WorkspaceFolder
);
}
}
break;
case "Don't show again":
updateGlobalState(promptKey, true);
break;
}
}
}
}
135 changes: 0 additions & 135 deletions src/goReferencesCodelens.ts

This file was deleted.

0 comments on commit 203717d

Please sign in to comment.