Skip to content

Commit a3d76a5

Browse files
committed
package.json: remove deprecated settings
and remove legacy tools installation code. Deleted settings - Gocode related settings (go.gocodeFlags, go.gocodeAutoBuild, go.gocodePackageLookupMode) - Code suggestion settings (go.useCodeSnippetsOnFunctionSuggest, go.useCodeSnippetsOnFunctionSuggestWithoutType, go.autocompleteUnimportedPackages) - go.gotoSymbol.includeCoroot - go.docsTool - go.useGoProxyToCheckForToolUpdates (obsolete by go.toolsManagement flag in 2020. Delete all the transition code as well) - go.liveErrors For #2799 Change-Id: Id949d2f4ea5963553170a9c168b08752cc2e825f Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/535097 Commit-Queue: Hyang-Ah Hana Kim <[email protected]> Reviewed-by: Robert Findley <[email protected]> Reviewed-by: Suzy Mueller <[email protected]> TryBot-Result: kokoro <[email protected]>
1 parent 5c1eda7 commit a3d76a5

13 files changed

+25
-471
lines changed

docs/settings.md

+1-83
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ Alternate tools or alternate paths for the same tools used by the Go extension.
5555
| `dlv` | Alternate tool to use instead of the dlv binary or alternate path to use for the dlv binary. <br/> Default: `"dlv"` |
5656
| `go` | Alternate tool to use instead of the go binary or alternate path to use for the go binary. <br/> Default: `"go"` |
5757
| `gopls` | Alternate tool to use instead of the gopls binary or alternate path to use for the gopls binary. <br/> Default: `"gopls"` |
58-
### `go.autocompleteUnimportedPackages (deprecated)`
59-
60-
Code completion without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`).
61-
Include unimported packages in auto-complete suggestions. Not applicable when using the language server.
62-
63-
Default: `false`
6458
### `go.buildFlags`
6559

6660
Flags to `go build`/`go test` used during build-on-save or running tests. (e.g. ["-ldflags='-s'"]) This is propagated to the language server if `gopls.build.buildFlags` is not specified.
@@ -170,13 +164,6 @@ Default: `"Off"`
170164
If true, tests will not run concurrently. When a new test run is started, the previous will be cancelled.
171165

172166
Default: `false`
173-
### `go.docsTool (deprecated)`
174-
175-
Documentation support without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`).
176-
Pick 'godoc' or 'gogetdoc' to get documentation. Not applicable when using the language server.<br/>
177-
Allowed Options: `godoc`, `gogetdoc`, `guru`
178-
179-
Default: `"godoc"`
180167
### `go.editorContextMenuCommands`
181168

182169
Experimental Feature: Enable/Disable entries from the context menu in the editor.
@@ -251,47 +238,12 @@ Default: `"default"`
251238
### `go.generateTestsFlags`
252239

253240
Additional command line flags to pass to `gotests` for generating tests.
254-
### `go.gocodeAutoBuild (deprecated)`
255-
256-
`gocode` is deprecated by the Go language server. Enable the Go language server (`#go.useLanguageServer#`).
257-
Enable gocode's autobuild feature. Not applicable when using the language server.
258-
259-
Default: `false`
260-
### `go.gocodeFlags (deprecated)`
261-
262-
`gocode` is deprecated by the Go language server. Enable the Go language server (`#go.useLanguageServer#`).
263-
Additional flags to pass to gocode. Not applicable when using the language server.
264-
265-
Default: `["-builtin", "-ignore-case", "-unimported-packages"]`
266-
### `go.gocodePackageLookupMode (deprecated)`
267-
268-
`gocode` is deprecated by the Go language server. Enable the Go language server (`#go.useLanguageServer#`).
269-
Used to determine the Go package lookup rules for completions by gocode. Not applicable when using the language server.<br/>
270-
Allowed Options: `go`, `gb`, `bzl`
271-
272-
Default: `"go"`
273241
### `go.gopath`
274242

275243
Specify GOPATH here to override the one that is set as environment variable. The inferred GOPATH from workspace root overrides this, if go.inferGopath is set to true.
276244
### `go.goroot`
277245

278246
Specifies the GOROOT to use when no environment variable is set.
279-
### `go.gotoSymbol.ignoreFolders (deprecated)`
280-
281-
Code navigation without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`).
282-
Folder names (not paths) to ignore while using Go to Symbol in Workspace feature. Not applicable when using the language server.
283-
### `go.gotoSymbol.includeGoroot (deprecated)`
284-
285-
Code navigation without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`).
286-
If false, the standard library located at $GOROOT will be excluded while using the Go to Symbol in File feature. Not applicable when using the language server.
287-
288-
Default: `false`
289-
### `go.gotoSymbol.includeImports (deprecated)`
290-
291-
Code navigation without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`).
292-
If false, the import statements will be excluded while using the Go to Symbol in File feature. Not applicable when using the language server.
293-
294-
Default: `false`
295247
### `go.inferGopath`
296248

297249
Infer GOPATH from the workspace root. This is ignored when using Go Modules.
@@ -393,22 +345,6 @@ Specifies Lint tool name.<br/>
393345
Allowed Options: `staticcheck`, `golint`, `golangci-lint`, `revive`
394346

395347
Default: `"staticcheck"`
396-
### `go.liveErrors (deprecated)`
397-
398-
Real-time diagnostics without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`).
399-
Use gotype on the file currently being edited and report any semantic or syntactic errors found after configured delay. Not applicable when using the language server.
400-
| Properties | Description |
401-
| --- | --- |
402-
| `delay` | The number of milliseconds to delay before execution. Resets with each keystroke. <br/> Default: `500` |
403-
| `enabled` | If true, runs gotype on the file currently being edited and reports any semantic or syntactic errors found. Disabled when the language server is enabled. <br/> Default: `false` |
404-
405-
Default:
406-
```
407-
{
408-
"delay" : 500,
409-
"enabled" : false,
410-
}
411-
```
412348
### `go.logging.level`
413349

414350
The logging level the extension logs at, defaults to 'error'<br/>
@@ -555,32 +491,14 @@ Trace the communication between VS Code and the Go language server.<br/>
555491
Allowed Options: `off`, `messages`, `verbose`
556492

557493
Default: `"off"`
558-
### `go.useCodeSnippetsOnFunctionSuggest (deprecated)`
559-
560-
Code completion without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`) and use [`gopls's `ui.completion.usePlaceholders` setting](https://github.com/golang/vscode-go/wiki/settings#uicompletionuseplaceholders) instead.
561-
Complete functions with their parameter signature, including the variable type. Not propagated to the language server.
562-
563-
Default: `false`
564-
### `go.useCodeSnippetsOnFunctionSuggestWithoutType (deprecated)`
565-
566-
Code completion without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`) and use [`gopls's `ui.completion.usePlaceholders` setting](https://github.com/golang/vscode-go/wiki/settings#uicompletionuseplaceholders) instead.
567-
Complete functions with their parameter signature, excluding the variable types. Use `gopls.usePlaceholders` when using the language server.
568-
569-
Default: `false`
570-
### `go.useGoProxyToCheckForToolUpdates (deprecated)`
571-
572-
Use `go.toolsManagement.checkForUpdates` instead.
573-
When enabled, the extension automatically checks the Go proxy if there are updates available for Go and the Go tools (at present, only gopls) it depends on and prompts the user accordingly
574-
575-
Default: `true`
576494
### `go.useLanguageServer`
577495

578496
Enable intellisense, code navigation, refactoring, formatting & diagnostics for Go. The features are powered by the Go language server "gopls".
579497

580498
Default: `true`
581499
### `go.vetFlags`
582500

583-
Flags to pass to `go tool vet` (e.g. ["-all", "-shadow"])
501+
Flags to pass to `go tool vet` (e.g. ["-all", "-shadow"]). Not applicable when using the language server's diagnostics.
584502
### `go.vetOnSave`
585503

586504
Vets code on file save using 'go tool vet'. Not applicable when using the language server's diagnostics. See 'go.languageServerExperimentalFeatures.diagnostics' setting.<br/>

package.json

+1-120
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,7 @@
12291229
"type": "string"
12301230
},
12311231
"default": [],
1232-
"description": "Flags to pass to `go tool vet` (e.g. [\"-all\", \"-shadow\"])",
1232+
"description": "Flags to pass to `go tool vet` (e.g. [\"-all\", \"-shadow\"]). Not applicable when using the language server's diagnostics.",
12331233
"scope": "resource"
12341234
},
12351235
"go.formatTool": {
@@ -1513,72 +1513,6 @@
15131513
"description": "Environment variables that will be passed to the tools that run the Go tools (e.g. CGO_CFLAGS) and debuggee process launched by Delve. Format as string key:value pairs. When debugging, merged with `envFile` and `env` values with precedence `env` > `envFile` > `go.toolsEnvVars`.",
15141514
"scope": "resource"
15151515
},
1516-
"go.gocodeFlags": {
1517-
"type": "array",
1518-
"items": {
1519-
"type": "string"
1520-
},
1521-
"default": [
1522-
"-builtin",
1523-
"-ignore-case",
1524-
"-unimported-packages"
1525-
],
1526-
"description": "Additional flags to pass to gocode. Not applicable when using the language server.",
1527-
"scope": "resource",
1528-
"markdownDeprecationMessage": "`gocode` is deprecated by the Go language server. Enable the Go language server (`#go.useLanguageServer#`)."
1529-
},
1530-
"go.gocodeAutoBuild": {
1531-
"type": "boolean",
1532-
"default": false,
1533-
"description": "Enable gocode's autobuild feature. Not applicable when using the language server.",
1534-
"scope": "resource",
1535-
"markdownDeprecationMessage": "`gocode` is deprecated by the Go language server. Enable the Go language server (`#go.useLanguageServer#`)."
1536-
},
1537-
"go.gocodePackageLookupMode": {
1538-
"type": "string",
1539-
"enum": [
1540-
"go",
1541-
"gb",
1542-
"bzl"
1543-
],
1544-
"default": "go",
1545-
"description": "Used to determine the Go package lookup rules for completions by gocode. Not applicable when using the language server.",
1546-
"scope": "resource",
1547-
"markdownDeprecationMessage": "`gocode` is deprecated by the Go language server. Enable the Go language server (`#go.useLanguageServer#`)."
1548-
},
1549-
"go.useCodeSnippetsOnFunctionSuggest": {
1550-
"type": "boolean",
1551-
"default": false,
1552-
"description": "Complete functions with their parameter signature, including the variable type. Not propagated to the language server.",
1553-
"scope": "resource",
1554-
"markdownDeprecationMessage": "Code completion without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`) and use [`gopls's `ui.completion.usePlaceholders` setting](https://github.com/golang/vscode-go/wiki/settings#uicompletionuseplaceholders) instead."
1555-
},
1556-
"go.useCodeSnippetsOnFunctionSuggestWithoutType": {
1557-
"type": "boolean",
1558-
"default": false,
1559-
"description": "Complete functions with their parameter signature, excluding the variable types. Use `gopls.usePlaceholders` when using the language server.",
1560-
"scope": "resource",
1561-
"markdownDeprecationMessage": "Code completion without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`) and use [`gopls's `ui.completion.usePlaceholders` setting](https://github.com/golang/vscode-go/wiki/settings#uicompletionuseplaceholders) instead."
1562-
},
1563-
"go.autocompleteUnimportedPackages": {
1564-
"type": "boolean",
1565-
"default": false,
1566-
"description": "Include unimported packages in auto-complete suggestions. Not applicable when using the language server.",
1567-
"scope": "resource",
1568-
"markdownDeprecationMessage": "Code completion without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`)."
1569-
},
1570-
"go.docsTool": {
1571-
"type": "string",
1572-
"default": "godoc",
1573-
"description": "Pick 'godoc' or 'gogetdoc' to get documentation. Not applicable when using the language server.",
1574-
"scope": "resource",
1575-
"enum": [
1576-
"godoc",
1577-
"gogetdoc",
1578-
"guru"
1579-
],
1580-
"markdownDeprecationMessage": "Documentation support without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`)."
1581-
},
15821516
"go.useLanguageServer": {
15831517
"type": "boolean",
15841518
"default": true,
@@ -1638,26 +1572,6 @@
16381572
"description": "Automatically update the tools used by the extension, without prompting the user.",
16391573
"scope": "resource"
16401574
},
1641-
"go.useGoProxyToCheckForToolUpdates": {
1642-
"type": "boolean",
1643-
"default": true,
1644-
"description": "When enabled, the extension automatically checks the Go proxy if there are updates available for Go and the Go tools (at present, only gopls) it depends on and prompts the user accordingly",
1645-
"markdownDeprecationMessage": "Use `go.toolsManagement.checkForUpdates` instead."
1646-
},
1647-
"go.gotoSymbol.includeImports": {
1648-
"type": "boolean",
1649-
"default": false,
1650-
"description": "If false, the import statements will be excluded while using the Go to Symbol in File feature. Not applicable when using the language server.",
1651-
"scope": "resource",
1652-
"markdownDeprecationMessage": "Code navigation without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`)."
1653-
},
1654-
"go.gotoSymbol.includeGoroot": {
1655-
"type": "boolean",
1656-
"default": false,
1657-
"description": "If false, the standard library located at $GOROOT will be excluded while using the Go to Symbol in File feature. Not applicable when using the language server.",
1658-
"scope": "resource",
1659-
"markdownDeprecationMessage": "Code navigation without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`)."
1660-
},
16611575
"go.enableCodeLens": {
16621576
"type": "object",
16631577
"properties": {
@@ -1721,29 +1635,6 @@
17211635
"description": "Tags and options configured here will be used by the Add Tags command to add tags to struct fields. If promptForTags is true, then user will be prompted for tags and options. By default, json tags are added.",
17221636
"scope": "resource"
17231637
},
1724-
"go.liveErrors": {
1725-
"type": "object",
1726-
"properties": {
1727-
"enabled": {
1728-
"type": "boolean",
1729-
"default": false,
1730-
"description": "If true, runs gotype on the file currently being edited and reports any semantic or syntactic errors found. Disabled when the language server is enabled."
1731-
},
1732-
"delay": {
1733-
"type": "number",
1734-
"default": 500,
1735-
"description": "The number of milliseconds to delay before execution. Resets with each keystroke."
1736-
}
1737-
},
1738-
"additionalProperties": false,
1739-
"default": {
1740-
"enabled": false,
1741-
"delay": 500
1742-
},
1743-
"description": "Use gotype on the file currently being edited and report any semantic or syntactic errors found after configured delay. Not applicable when using the language server.",
1744-
"scope": "resource",
1745-
"markdownDeprecationMessage": "Real-time diagnostics without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`)."
1746-
},
17471638
"go.removeTags": {
17481639
"type": "object",
17491640
"properties": {
@@ -1904,16 +1795,6 @@
19041795
"description": "Experimental Feature: Enable/Disable entries from the context menu in the editor.",
19051796
"scope": "resource"
19061797
},
1907-
"go.gotoSymbol.ignoreFolders": {
1908-
"type": "array",
1909-
"items": {
1910-
"type": "string"
1911-
},
1912-
"default": [],
1913-
"description": "Folder names (not paths) to ignore while using Go to Symbol in Workspace feature. Not applicable when using the language server.",
1914-
"scope": "resource",
1915-
"markdownDeprecationMessage": "Code navigation without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`)."
1916-
},
19171798
"go.delveConfig": {
19181799
"type": "object",
19191800
"properties": {

src/commands/getConfiguredGoTools.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const getConfiguredGoTools: CommandFactory = () => {
3939
outputChannel.appendLine('');
4040

4141
const goVersion = await getGoVersion();
42-
const allTools = getConfiguredTools(goVersion, getGoConfig(), getGoplsConfig());
42+
const allTools = getConfiguredTools(getGoConfig(), getGoplsConfig());
4343
const goVersionTooOld = goVersion?.lt('1.12') || false;
4444

4545
outputChannel.appendLine(`\tgo:\t${goVersion?.binaryPath}: ${goVersion?.version}`);

src/commands/startLanguageServer.ts

-15
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,15 @@ import { CommandFactory } from '.';
99
import { getGoConfig } from '../config';
1010
import { GoExtensionContext } from '../context';
1111
import { outputChannel, updateLanguageServerIconGoStatusBar } from '../goStatus';
12-
import { getTool } from '../goTools';
1312
import {
1413
buildLanguageClient,
1514
buildLanguageClientOption,
1615
buildLanguageServerConfig,
1716
errorKind,
18-
languageServerUsingDefault,
1917
RestartReason,
2018
scheduleGoplsSuggestions,
2119
stopLanguageClient,
2220
suggestGoplsIssueReport,
23-
suggestUpdateGopls,
2421
toServerInfo,
2522
updateRestartHistory
2623
} from '../language/goLanguageServer';
@@ -73,18 +70,6 @@ export const startLanguageServer: CommandFactory = (ctx, goCtx) => {
7370
scheduleGoplsSuggestions(goCtx);
7471
}
7572

76-
// If the language server is gopls, we enable a few additional features.
77-
if (cfg.serverName === 'gopls') {
78-
const tool = getTool(cfg.serverName);
79-
if (tool) {
80-
// If the language server is turned on because it is enabled by default,
81-
// make sure that the user is using a new enough version.
82-
if (cfg.enabled && languageServerUsingDefault(goConfig)) {
83-
suggestUpdateGopls(tool, cfg);
84-
}
85-
}
86-
}
87-
8873
if (!cfg.enabled) {
8974
const legacyService = new LegacyLanguageService();
9075
goCtx.legacyLanguageService = legacyService;

src/goExplorer.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import vscodeUri = require('vscode-uri');
77
import os = require('os');
88
import path = require('path');
99
import { getGoConfig, getGoplsConfig } from './config';
10-
import { getBinPath, getGoVersion } from './util';
10+
import { getBinPath } from './util';
1111
import { getConfiguredTools } from './goTools';
1212
import { inspectGoToolVersion } from './goInstallTools';
1313
import { runGoEnv } from './goModules';
@@ -159,8 +159,7 @@ export class GoExplorerProvider implements vscode.TreeDataProvider<vscode.TreeIt
159159
}
160160

161161
private async toolTreeItems() {
162-
const goVersion = await getGoVersion();
163-
const allTools = getConfiguredTools(goVersion, getGoConfig(), getGoplsConfig());
162+
const allTools = getConfiguredTools(getGoConfig(), getGoplsConfig());
164163
const toolsInfo = await Promise.all(allTools.map((tool) => this.toolDetailCache.get(tool.name)));
165164
const items = [];
166165
for (const t of toolsInfo) {

0 commit comments

Comments
 (0)