src/goLanguageServer: remove languageServerExperimentalFeatures

This setting is no longer necessary, especially since we're still
undecided about the future of diagnostic configurability. Remove the
configuration and notify the user that it's deprecated.

Updates golang/vscode-go#50

Change-Id: I273187ebaa9e582f02dc84dbeafa329c28e4fed7
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/280601
Trust: Rebecca Stambler <rstambler@golang.org>
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
diff --git a/docs/settings.md b/docs/settings.md
index ae8cff2..83cb405 100644
--- a/docs/settings.md
+++ b/docs/settings.md
@@ -365,18 +365,6 @@
 
 Default: `false`
 
-### `go.languageServerExperimentalFeatures`
-
-Use this setting to enable/disable experimental features from the language server.
-
-Default:{<br/>
-&nbsp;&nbsp;`"diagnostics": true`,<br/>
-    }
-
-
-#### `diagnostics`
-If true, the language server will provide build, vet errors and the extension will ignore the `buildOnSave`, `vetOnSave` settings.
-
 ### `go.languageServerFlags`
 
 Flags like -rpc.trace and -logfile to be used while running the language server.
@@ -567,7 +555,7 @@
 
 ### `go.vetOnSave`
 
-Vets code on file save using 'go tool vet'.
+Vets code on file save using 'go tool vet'. Not applicable when using the language server.
 
 Allowed Values:`[package workspace off]`
 
diff --git a/package.json b/package.json
index fe0c44a..e6429e8 100644
--- a/package.json
+++ b/package.json
@@ -1325,7 +1325,7 @@
             "off"
           ],
           "default": "package",
-          "description": "Vets code on file save using 'go tool vet'.",
+          "description": "Vets code on file save using 'go tool vet'. Not applicable when using the language server.",
           "scope": "resource"
         },
         "go.vetFlags": {
@@ -1636,21 +1636,6 @@
           "default": [],
           "description": "Flags like -rpc.trace and -logfile to be used while running the language server."
         },
-        "go.languageServerExperimentalFeatures": {
-          "type": "object",
-          "properties": {
-            "diagnostics": {
-              "type": "boolean",
-              "default": true,
-              "description": "If true, the language server will provide build, vet errors and the extension will ignore the `buildOnSave`, `vetOnSave` settings."
-            }
-          },
-          "additionalProperties": false,
-          "default": {
-            "diagnostics": true
-          },
-          "description": "Use this setting to enable/disable experimental features from the language server."
-        },
         "go.trace.server": {
           "type": "string",
           "enum": [
diff --git a/src/goCheck.ts b/src/goCheck.ts
index 327a5f8..3ac8557 100644
--- a/src/goCheck.ts
+++ b/src/goCheck.ts
@@ -60,7 +60,7 @@
 	// If a user has enabled diagnostics via a language server,
 	// then we disable running build or vet to avoid duplicate errors and warnings.
 	const lspConfig = buildLanguageServerConfig(goConfig);
-	const disableBuildAndVet = lspConfig.enabled && lspConfig.features.diagnostics;
+	const disableBuildAndVet = lspConfig.enabled;
 
 	let testPromise: Thenable<boolean>;
 	const testConfig: TestConfig = {
diff --git a/src/goLanguageServer.ts b/src/goLanguageServer.ts
index fdd0708..a5d82b7 100644
--- a/src/goLanguageServer.ts
+++ b/src/goLanguageServer.ts
@@ -26,7 +26,6 @@
 	Message,
 	ProvideCodeLensesSignature,
 	ProvideCompletionItemsSignature,
-	ProvideDocumentLinksSignature,
 	ResponseError,
 	RevealOutputChannelOn
 } from 'vscode-languageclient';
@@ -74,9 +73,6 @@
 	enabled: boolean;
 	flags: string[];
 	env: any;
-	features: {
-		diagnostics: boolean;
-	};
 	checkForUpdates: string;
 }
 
@@ -108,7 +104,6 @@
 // startLanguageServerWithFallback starts the language server, if enabled,
 // or falls back to the default language providers.
 export async function startLanguageServerWithFallback(ctx: vscode.ExtensionContext, activation: boolean) {
-
 	for (const folder of vscode.workspace.workspaceFolders || []) {
 		if (folder.uri.scheme === 'vsls') {
 			outputChannel.appendLine(`Language service on the guest side is disabled. ` +
@@ -383,16 +378,6 @@
 						}
 					}, []);
 				},
-				handleDiagnostics: (
-					uri: vscode.Uri,
-					diagnostics: vscode.Diagnostic[],
-					next: HandleDiagnosticsSignature
-				) => {
-					if (!cfg.features.diagnostics) {
-						return null;
-					}
-					return next(uri, diagnostics);
-				},
 				provideCompletionItem: async (
 					document: vscode.TextDocument,
 					position: vscode.Position,
@@ -703,11 +688,6 @@
 		modtime: null,
 		enabled: goConfig['useLanguageServer'] === true,
 		flags: goConfig['languageServerFlags'] || [],
-		features: {
-			// TODO: We should have configs that match these names.
-			// Ultimately, we should have a centralized language server config rather than separate fields.
-			diagnostics: goConfig['languageServerExperimentalFeatures']['diagnostics'],
-		},
 		env: toolExecutionEnvironment(),
 		checkForUpdates: getCheckForToolsUpdatesConfig(goConfig),
 	};
diff --git a/src/goMain.ts b/src/goMain.ts
index c7cd808..a28fa41 100644
--- a/src/goMain.ts
+++ b/src/goMain.ts
@@ -116,10 +116,19 @@
 	}
 
 	// Present a warning about the deprecation of the go.documentLink setting.
-	if (getGoConfig()['languageServerExperimentalFeatures']['documentLink'] === false) {
-		vscode.window.showErrorMessage(`The 'go.languageServerExperimentalFeature.documentLink' setting is now deprecated.
-Please use 'gopls.importShortcut' instead.
-See https://github.com/golang/tools/blob/master/gopls/doc/settings.md#importshortcut-enum for more details.`);
+	const experimentalFeatures = getGoConfig()['languageServerExperimentalFeatures'];
+	if (experimentalFeatures) {
+		// TODO(rstambler): Eventually notify about deprecation of all of the settings.
+		if (experimentalFeatures['documentLink'] === false) {
+			vscode.window.showErrorMessage(`The 'go.languageServerExperimentalFeature.documentLink' setting is now deprecated.
+	Please use 'gopls.importShortcut' instead.
+	See https://github.com/golang/tools/blob/master/gopls/doc/settings.md#importshortcut-enum for more details.`);
+		}
+		if (experimentalFeatures['diagnostics'] === false) {
+			vscode.window.showErrorMessage(`The 'go.languageServerExperimentalFeature.diagnostics' setting is now deprecated.
+If you would like additional configuration for diagnostics from gopls, please see and response to
+https://github.com/golang/vscode-go/issues/50.`);
+		}
 	}
 
 	updateGoVarsFromConfig().then(async () => {
diff --git a/test/gopls/update.test.ts b/test/gopls/update.test.ts
index afb4a34..4a3e101 100644
--- a/test/gopls/update.test.ts
+++ b/test/gopls/update.test.ts
@@ -174,9 +174,6 @@
 				version: '',
 				checkForUpdates: 'proxy',
 				env: {},
-				features: {
-					diagnostics: true,
-				},
 				flags: [],
 				modtime: new Date(),
 				serverName: 'gopls',