Skip to content

Commit 50e2b64

Browse files
committed
package.json: remove go.languageServerExperimentalFeatures setting
The deprecation note was present for over two years. No objection was raised. Updates #1109 Updates #50 Change-Id: Ia78b894a200f4120c76fb473ec84ae39578f215f Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/501199 Run-TryBot: Hyang-Ah Hana Kim <[email protected]> Reviewed-by: Jamal Carvalho <[email protected]> TryBot-Result: kokoro <[email protected]>
1 parent 97f0627 commit 50e2b64

File tree

7 files changed

+3
-57
lines changed

7 files changed

+3
-57
lines changed

docs/settings.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -369,19 +369,6 @@ Default: `false`
369369
If true, then `-i` flag will be passed to `go build` everytime the code is compiled. Since Go 1.10, setting this may be unnecessary unless you are in GOPATH mode and do not use the language server.
370370

371371
Default: `false`
372-
### `go.languageServerExperimentalFeatures`
373-
374-
Temporary flag to enable/disable diagnostics from the language server. This setting will be deprecated soon. Please see and response to [Issue 50](https://github.com/golang/vscode-go/issues/50).
375-
| Properties | Description |
376-
| --- | --- |
377-
| `diagnostics` | If true, the language server will provide build, vet errors and the extension will ignore the `buildOnSave`, `vetOnSave` settings. <br/> Default: `true` |
378-
379-
Default:
380-
```
381-
{
382-
"diagnostics" : true,
383-
}
384-
```
385372
### `go.languageServerFlags`
386373

387374
Flags like -rpc.trace and -logfile to be used while running the language server.

package.json

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,21 +1582,6 @@
15821582
"default": [],
15831583
"description": "Flags like -rpc.trace and -logfile to be used while running the language server."
15841584
},
1585-
"go.languageServerExperimentalFeatures": {
1586-
"type": "object",
1587-
"properties": {
1588-
"diagnostics": {
1589-
"type": "boolean",
1590-
"default": true,
1591-
"description": "If true, the language server will provide build, vet errors and the extension will ignore the `buildOnSave`, `vetOnSave` settings."
1592-
}
1593-
},
1594-
"additionalProperties": false,
1595-
"default": {
1596-
"diagnostics": true
1597-
},
1598-
"markdownDescription": "Temporary flag to enable/disable diagnostics from the language server. This setting will be deprecated soon. Please see and response to [Issue 50](https://github.com/golang/vscode-go/issues/50)."
1599-
},
16001585
"go.trace.server": {
16011586
"type": "string",
16021587
"enum": [

src/goCheck.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function check(
6969
// If a user has enabled diagnostics via a language server,
7070
// then we disable running build or vet to avoid duplicate errors and warnings.
7171
const lspConfig = buildLanguageServerConfig(goConfig);
72-
const disableBuildAndVet = lspConfig.enabled && lspConfig.features.diagnostics;
72+
const disableBuildAndVet = lspConfig.enabled;
7373

7474
let testPromise: Thenable<boolean>;
7575
const testConfig: TestConfig = {

src/goMain.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -392,21 +392,4 @@ async function showDeprecationWarning() {
392392
}
393393
}
394394
}
395-
const experimentalFeatures = cfg['languageServerExperimentalFeatures'];
396-
if (experimentalFeatures) {
397-
// TODO(golang/vscode-go#50): Eventually notify about deprecation of
398-
// all of the settings. See golang/vscode-go#1109 too.
399-
// The `diagnostics` setting is still used as a workaround for running custom vet.
400-
const promptKey = 'promptedLanguageServerExperimentalFeatureDeprecation';
401-
const prompted = getFromGlobalState(promptKey, false);
402-
if (!prompted && experimentalFeatures['diagnostics'] === false) {
403-
const msg = `The 'go.languageServerExperimentalFeature.diagnostics' setting will be deprecated soon.
404-
If you would like additional configuration for diagnostics from gopls, please see and response to [Issue 50](https://go.dev/s/vscode-issue/50).`;
405-
const selected = await vscode.window.showInformationMessage(msg, "Don't show again");
406-
switch (selected) {
407-
case "Don't show again":
408-
updateGlobalState(promptKey, true);
409-
}
410-
}
411-
}
412395
}

src/goTools.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,7 @@ export function goplsStaticcheckEnabled(
227227
) {
228228
return false;
229229
}
230-
const features = goConfig['languageServerExperimentalFeatures'];
231-
return !features || features['diagnostics'] === true;
230+
return true;
232231
}
233232

234233
export const gocodeClose = async (env: NodeJS.Dict<string>): Promise<string> => {

src/language/goLanguageServer.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ export interface LanguageServerConfig {
7272
flags: string[];
7373
env: any;
7474
features: {
75-
diagnostics: boolean;
7675
formatter?: GoDocumentFormattingEditProvider;
7776
};
7877
checkForUpdates: string;
@@ -616,9 +615,6 @@ export async function buildLanguageClient(
616615
diagnostics: vscode.Diagnostic[],
617616
next: HandleDiagnosticsSignature
618617
) => {
619-
if (!cfg.features.diagnostics) {
620-
return null;
621-
}
622618
const { buildDiagnosticCollection, lintDiagnosticCollection, vetDiagnosticCollection } = goCtx;
623619
// Deduplicate diagnostics with those found by the other tools.
624620
removeDuplicateDiagnostics(vetDiagnosticCollection, uri, diagnostics);
@@ -925,7 +921,6 @@ export async function watchLanguageServerConfiguration(goCtx: GoExtensionContext
925921
if (
926922
e.affectsConfiguration('go.useLanguageServer') ||
927923
e.affectsConfiguration('go.languageServerFlags') ||
928-
e.affectsConfiguration('go.languageServerExperimentalFeatures') ||
929924
e.affectsConfiguration('go.alternateTools') ||
930925
e.affectsConfiguration('go.toolsEnvVars') ||
931926
e.affectsConfiguration('go.formatTool')
@@ -954,7 +949,6 @@ export function buildLanguageServerConfig(goConfig: vscode.WorkspaceConfiguratio
954949
features: {
955950
// TODO: We should have configs that match these names.
956951
// Ultimately, we should have a centralized language server config rather than separate fields.
957-
diagnostics: goConfig['languageServerExperimentalFeatures']['diagnostics'],
958952
formatter: formatter
959953
},
960954
env: toolExecutionEnvironment(),

test/gopls/update.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,7 @@ suite('gopls update tests', () => {
210210
version: undefined,
211211
checkForUpdates: 'proxy',
212212
env: {},
213-
features: {
214-
diagnostics: true
215-
},
213+
features: {},
216214
flags: [],
217215
modtime: new Date(),
218216
serverName: 'gopls'

0 commit comments

Comments
 (0)