Skip to content

Commit

Permalink
package.json: remove deprecated settings
Browse files Browse the repository at this point in the history
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 golang#2799

Change-Id: Id949d2f4ea5963553170a9c168b08752cc2e825f
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/535097
Commit-Queue: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
  • Loading branch information
hyangah committed Oct 26, 2023
1 parent 5c1eda7 commit a3d76a5
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 471 deletions.
84 changes: 1 addition & 83 deletions docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ Alternate tools or alternate paths for the same tools used by the Go extension.
| `dlv` | Alternate tool to use instead of the dlv binary or alternate path to use for the dlv binary. <br/> Default: `"dlv"` |
| `go` | Alternate tool to use instead of the go binary or alternate path to use for the go binary. <br/> Default: `"go"` |
| `gopls` | Alternate tool to use instead of the gopls binary or alternate path to use for the gopls binary. <br/> Default: `"gopls"` |
### `go.autocompleteUnimportedPackages (deprecated)`

Code completion without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`).
Include unimported packages in auto-complete suggestions. Not applicable when using the language server.

Default: `false`
### `go.buildFlags`

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.
Expand Down Expand Up @@ -170,13 +164,6 @@ Default: `"Off"`
If true, tests will not run concurrently. When a new test run is started, the previous will be cancelled.

Default: `false`
### `go.docsTool (deprecated)`

Documentation support without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`).
Pick 'godoc' or 'gogetdoc' to get documentation. Not applicable when using the language server.<br/>
Allowed Options: `godoc`, `gogetdoc`, `guru`

Default: `"godoc"`
### `go.editorContextMenuCommands`

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

Additional command line flags to pass to `gotests` for generating tests.
### `go.gocodeAutoBuild (deprecated)`

`gocode` is deprecated by the Go language server. Enable the Go language server (`#go.useLanguageServer#`).
Enable gocode's autobuild feature. Not applicable when using the language server.

Default: `false`
### `go.gocodeFlags (deprecated)`

`gocode` is deprecated by the Go language server. Enable the Go language server (`#go.useLanguageServer#`).
Additional flags to pass to gocode. Not applicable when using the language server.

Default: `["-builtin", "-ignore-case", "-unimported-packages"]`
### `go.gocodePackageLookupMode (deprecated)`

`gocode` is deprecated by the Go language server. Enable the Go language server (`#go.useLanguageServer#`).
Used to determine the Go package lookup rules for completions by gocode. Not applicable when using the language server.<br/>
Allowed Options: `go`, `gb`, `bzl`

Default: `"go"`
### `go.gopath`

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.
### `go.goroot`

Specifies the GOROOT to use when no environment variable is set.
### `go.gotoSymbol.ignoreFolders (deprecated)`

Code navigation without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`).
Folder names (not paths) to ignore while using Go to Symbol in Workspace feature. Not applicable when using the language server.
### `go.gotoSymbol.includeGoroot (deprecated)`

Code navigation without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`).
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.

Default: `false`
### `go.gotoSymbol.includeImports (deprecated)`

Code navigation without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`).
If false, the import statements will be excluded while using the Go to Symbol in File feature. Not applicable when using the language server.

Default: `false`
### `go.inferGopath`

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

Default: `"staticcheck"`
### `go.liveErrors (deprecated)`

Real-time diagnostics without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`).
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.
| Properties | Description |
| --- | --- |
| `delay` | The number of milliseconds to delay before execution. Resets with each keystroke. <br/> Default: `500` |
| `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` |

Default:
```
{
"delay" : 500,
"enabled" : false,
}
```
### `go.logging.level`

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

Default: `"off"`
### `go.useCodeSnippetsOnFunctionSuggest (deprecated)`

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.
Complete functions with their parameter signature, including the variable type. Not propagated to the language server.

Default: `false`
### `go.useCodeSnippetsOnFunctionSuggestWithoutType (deprecated)`

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.
Complete functions with their parameter signature, excluding the variable types. Use `gopls.usePlaceholders` when using the language server.

Default: `false`
### `go.useGoProxyToCheckForToolUpdates (deprecated)`

Use `go.toolsManagement.checkForUpdates` instead.
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

Default: `true`
### `go.useLanguageServer`

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

Default: `true`
### `go.vetFlags`

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

Vets code on file save using 'go tool vet'. Not applicable when using the language server's diagnostics. See 'go.languageServerExperimentalFeatures.diagnostics' setting.<br/>
Expand Down
121 changes: 1 addition & 120 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@
"type": "string"
},
"default": [],
"description": "Flags to pass to `go tool vet` (e.g. [\"-all\", \"-shadow\"])",
"description": "Flags to pass to `go tool vet` (e.g. [\"-all\", \"-shadow\"]). Not applicable when using the language server's diagnostics.",
"scope": "resource"
},
"go.formatTool": {
Expand Down Expand Up @@ -1513,72 +1513,6 @@
"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`.",
"scope": "resource"
},
"go.gocodeFlags": {
"type": "array",
"items": {
"type": "string"
},
"default": [
"-builtin",
"-ignore-case",
"-unimported-packages"
],
"description": "Additional flags to pass to gocode. Not applicable when using the language server.",
"scope": "resource",
"markdownDeprecationMessage": "`gocode` is deprecated by the Go language server. Enable the Go language server (`#go.useLanguageServer#`)."
},
"go.gocodeAutoBuild": {
"type": "boolean",
"default": false,
"description": "Enable gocode's autobuild feature. Not applicable when using the language server.",
"scope": "resource",
"markdownDeprecationMessage": "`gocode` is deprecated by the Go language server. Enable the Go language server (`#go.useLanguageServer#`)."
},
"go.gocodePackageLookupMode": {
"type": "string",
"enum": [
"go",
"gb",
"bzl"
],
"default": "go",
"description": "Used to determine the Go package lookup rules for completions by gocode. Not applicable when using the language server.",
"scope": "resource",
"markdownDeprecationMessage": "`gocode` is deprecated by the Go language server. Enable the Go language server (`#go.useLanguageServer#`)."
},
"go.useCodeSnippetsOnFunctionSuggest": {
"type": "boolean",
"default": false,
"description": "Complete functions with their parameter signature, including the variable type. Not propagated to the language server.",
"scope": "resource",
"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."
},
"go.useCodeSnippetsOnFunctionSuggestWithoutType": {
"type": "boolean",
"default": false,
"description": "Complete functions with their parameter signature, excluding the variable types. Use `gopls.usePlaceholders` when using the language server.",
"scope": "resource",
"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."
},
"go.autocompleteUnimportedPackages": {
"type": "boolean",
"default": false,
"description": "Include unimported packages in auto-complete suggestions. Not applicable when using the language server.",
"scope": "resource",
"markdownDeprecationMessage": "Code completion without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`)."
},
"go.docsTool": {
"type": "string",
"default": "godoc",
"description": "Pick 'godoc' or 'gogetdoc' to get documentation. Not applicable when using the language server.",
"scope": "resource",
"enum": [
"godoc",
"gogetdoc",
"guru"
],
"markdownDeprecationMessage": "Documentation support without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`)."
},
"go.useLanguageServer": {
"type": "boolean",
"default": true,
Expand Down Expand Up @@ -1638,26 +1572,6 @@
"description": "Automatically update the tools used by the extension, without prompting the user.",
"scope": "resource"
},
"go.useGoProxyToCheckForToolUpdates": {
"type": "boolean",
"default": true,
"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",
"markdownDeprecationMessage": "Use `go.toolsManagement.checkForUpdates` instead."
},
"go.gotoSymbol.includeImports": {
"type": "boolean",
"default": false,
"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.",
"scope": "resource",
"markdownDeprecationMessage": "Code navigation without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`)."
},
"go.gotoSymbol.includeGoroot": {
"type": "boolean",
"default": false,
"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.",
"scope": "resource",
"markdownDeprecationMessage": "Code navigation without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`)."
},
"go.enableCodeLens": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1721,29 +1635,6 @@
"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.",
"scope": "resource"
},
"go.liveErrors": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": false,
"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."
},
"delay": {
"type": "number",
"default": 500,
"description": "The number of milliseconds to delay before execution. Resets with each keystroke."
}
},
"additionalProperties": false,
"default": {
"enabled": false,
"delay": 500
},
"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.",
"scope": "resource",
"markdownDeprecationMessage": "Real-time diagnostics without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`)."
},
"go.removeTags": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1904,16 +1795,6 @@
"description": "Experimental Feature: Enable/Disable entries from the context menu in the editor.",
"scope": "resource"
},
"go.gotoSymbol.ignoreFolders": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "Folder names (not paths) to ignore while using Go to Symbol in Workspace feature. Not applicable when using the language server.",
"scope": "resource",
"markdownDeprecationMessage": "Code navigation without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`)."
},
"go.delveConfig": {
"type": "object",
"properties": {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/getConfiguredGoTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const getConfiguredGoTools: CommandFactory = () => {
outputChannel.appendLine('');

const goVersion = await getGoVersion();
const allTools = getConfiguredTools(goVersion, getGoConfig(), getGoplsConfig());
const allTools = getConfiguredTools(getGoConfig(), getGoplsConfig());
const goVersionTooOld = goVersion?.lt('1.12') || false;

outputChannel.appendLine(`\tgo:\t${goVersion?.binaryPath}: ${goVersion?.version}`);
Expand Down
15 changes: 0 additions & 15 deletions src/commands/startLanguageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,15 @@ import { CommandFactory } from '.';
import { getGoConfig } from '../config';
import { GoExtensionContext } from '../context';
import { outputChannel, updateLanguageServerIconGoStatusBar } from '../goStatus';
import { getTool } from '../goTools';
import {
buildLanguageClient,
buildLanguageClientOption,
buildLanguageServerConfig,
errorKind,
languageServerUsingDefault,
RestartReason,
scheduleGoplsSuggestions,
stopLanguageClient,
suggestGoplsIssueReport,
suggestUpdateGopls,
toServerInfo,
updateRestartHistory
} from '../language/goLanguageServer';
Expand Down Expand Up @@ -73,18 +70,6 @@ export const startLanguageServer: CommandFactory = (ctx, goCtx) => {
scheduleGoplsSuggestions(goCtx);
}

// If the language server is gopls, we enable a few additional features.
if (cfg.serverName === 'gopls') {
const tool = getTool(cfg.serverName);
if (tool) {
// If the language server is turned on because it is enabled by default,
// make sure that the user is using a new enough version.
if (cfg.enabled && languageServerUsingDefault(goConfig)) {
suggestUpdateGopls(tool, cfg);
}
}
}

if (!cfg.enabled) {
const legacyService = new LegacyLanguageService();
goCtx.legacyLanguageService = legacyService;
Expand Down
5 changes: 2 additions & 3 deletions src/goExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import vscodeUri = require('vscode-uri');
import os = require('os');
import path = require('path');
import { getGoConfig, getGoplsConfig } from './config';
import { getBinPath, getGoVersion } from './util';
import { getBinPath } from './util';
import { getConfiguredTools } from './goTools';
import { inspectGoToolVersion } from './goInstallTools';
import { runGoEnv } from './goModules';
Expand Down Expand Up @@ -159,8 +159,7 @@ export class GoExplorerProvider implements vscode.TreeDataProvider<vscode.TreeIt
}

private async toolTreeItems() {
const goVersion = await getGoVersion();
const allTools = getConfiguredTools(goVersion, getGoConfig(), getGoplsConfig());
const allTools = getConfiguredTools(getGoConfig(), getGoplsConfig());
const toolsInfo = await Promise.all(allTools.map((tool) => this.toolDetailCache.get(tool.name)));
const items = [];
for (const t of toolsInfo) {
Expand Down
Loading

0 comments on commit a3d76a5

Please sign in to comment.