package.json: remove go.languageServerExperimentalFeatures setting
The deprecation note was present for over two years. No objection was raised. Updates golang/vscode-go#1109 Updates golang/vscode-go#50 Change-Id: Ia78b894a200f4120c76fb473ec84ae39578f215f Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/501199 Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Jamal Carvalho <jamal@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Родитель
97f062777f
Коммит
50e2b64a49
|
@ -369,19 +369,6 @@ Default: `false`
|
|||
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.
|
||||
|
||||
Default: `false`
|
||||
### `go.languageServerExperimentalFeatures`
|
||||
|
||||
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).
|
||||
| Properties | Description |
|
||||
| --- | --- |
|
||||
| `diagnostics` | If true, the language server will provide build, vet errors and the extension will ignore the `buildOnSave`, `vetOnSave` settings. <br/> Default: `true` |
|
||||
|
||||
Default:
|
||||
```
|
||||
{
|
||||
"diagnostics" : true,
|
||||
}
|
||||
```
|
||||
### `go.languageServerFlags`
|
||||
|
||||
Flags like -rpc.trace and -logfile to be used while running the language server.
|
||||
|
|
15
package.json
15
package.json
|
@ -1582,21 +1582,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
|
||||
},
|
||||
"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)."
|
||||
},
|
||||
"go.trace.server": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
|
|
|
@ -69,7 +69,7 @@ export function check(
|
|||
// 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 = {
|
||||
|
|
|
@ -392,21 +392,4 @@ async function showDeprecationWarning() {
|
|||
}
|
||||
}
|
||||
}
|
||||
const experimentalFeatures = cfg['languageServerExperimentalFeatures'];
|
||||
if (experimentalFeatures) {
|
||||
// TODO(golang/vscode-go#50): Eventually notify about deprecation of
|
||||
// all of the settings. See golang/vscode-go#1109 too.
|
||||
// The `diagnostics` setting is still used as a workaround for running custom vet.
|
||||
const promptKey = 'promptedLanguageServerExperimentalFeatureDeprecation';
|
||||
const prompted = getFromGlobalState(promptKey, false);
|
||||
if (!prompted && experimentalFeatures['diagnostics'] === false) {
|
||||
const msg = `The 'go.languageServerExperimentalFeature.diagnostics' setting will be deprecated soon.
|
||||
If you would like additional configuration for diagnostics from gopls, please see and response to [Issue 50](https://go.dev/s/vscode-issue/50).`;
|
||||
const selected = await vscode.window.showInformationMessage(msg, "Don't show again");
|
||||
switch (selected) {
|
||||
case "Don't show again":
|
||||
updateGlobalState(promptKey, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -227,8 +227,7 @@ export function goplsStaticcheckEnabled(
|
|||
) {
|
||||
return false;
|
||||
}
|
||||
const features = goConfig['languageServerExperimentalFeatures'];
|
||||
return !features || features['diagnostics'] === true;
|
||||
return true;
|
||||
}
|
||||
|
||||
export const gocodeClose = async (env: NodeJS.Dict<string>): Promise<string> => {
|
||||
|
|
|
@ -72,7 +72,6 @@ export interface LanguageServerConfig {
|
|||
flags: string[];
|
||||
env: any;
|
||||
features: {
|
||||
diagnostics: boolean;
|
||||
formatter?: GoDocumentFormattingEditProvider;
|
||||
};
|
||||
checkForUpdates: string;
|
||||
|
@ -616,9 +615,6 @@ export async function buildLanguageClient(
|
|||
diagnostics: vscode.Diagnostic[],
|
||||
next: HandleDiagnosticsSignature
|
||||
) => {
|
||||
if (!cfg.features.diagnostics) {
|
||||
return null;
|
||||
}
|
||||
const { buildDiagnosticCollection, lintDiagnosticCollection, vetDiagnosticCollection } = goCtx;
|
||||
// Deduplicate diagnostics with those found by the other tools.
|
||||
removeDuplicateDiagnostics(vetDiagnosticCollection, uri, diagnostics);
|
||||
|
@ -925,7 +921,6 @@ export async function watchLanguageServerConfiguration(goCtx: GoExtensionContext
|
|||
if (
|
||||
e.affectsConfiguration('go.useLanguageServer') ||
|
||||
e.affectsConfiguration('go.languageServerFlags') ||
|
||||
e.affectsConfiguration('go.languageServerExperimentalFeatures') ||
|
||||
e.affectsConfiguration('go.alternateTools') ||
|
||||
e.affectsConfiguration('go.toolsEnvVars') ||
|
||||
e.affectsConfiguration('go.formatTool')
|
||||
|
@ -954,7 +949,6 @@ export function buildLanguageServerConfig(goConfig: vscode.WorkspaceConfiguratio
|
|||
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'],
|
||||
formatter: formatter
|
||||
},
|
||||
env: toolExecutionEnvironment(),
|
||||
|
|
|
@ -210,9 +210,7 @@ suite('gopls update tests', () => {
|
|||
version: undefined,
|
||||
checkForUpdates: 'proxy',
|
||||
env: {},
|
||||
features: {
|
||||
diagnostics: true
|
||||
},
|
||||
features: {},
|
||||
flags: [],
|
||||
modtime: new Date(),
|
||||
serverName: 'gopls'
|
||||
|
|
Загрузка…
Ссылка в новой задаче