[vscode-go] tools: generate inlay hints settings from gopls settings

194 views
Skip to first unread message

Suzy Mueller (Gerrit)

unread,
Jul 26, 2022, 12:06:14 PM7/26/22
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Suzy Mueller has uploaded this change for review.

View Change

tools: generate inlay hints settings from gopls settings

This updates the script to generate the inlay hints settings
automatically from gopls. I did some manual touch ups on the settings
from gopls for now and will send a CL to gopls to make the settings
fixes upstream.

Change-Id: Ib4d66b1f03b4e6aa0019d6a9094cc172c8dc952a
---
M docs/settings.md
M package.json
M tools/goplssetting/goplssetting.go
3 files changed, 103 insertions(+), 97 deletions(-)

diff --git a/docs/settings.md b/docs/settings.md
index 0b0299e..f913f5a 100644
--- a/docs/settings.md
+++ b/docs/settings.md
@@ -272,85 +272,68 @@
Default: `false`
### `go.inlayHints.assignVariableTypes`

-Enable/disable inlay hints for variable types in assign statements.
+Enable/disable inlay hints for variable types in assign statements:
```go
-
-i /*int*/, j /*int*/ := 0, len(r)-1
+ i/* int*/, j/* int*/ := 0, len(r)-1
```

Default: `false`
### `go.inlayHints.compositeLiteralFields`

-Enable/disable inlay hints for composite literal field names.
+Enable/disable inlay hints for composite literal field names:
```go
-
-for _, c := range []struct {in, want string}{
- {/*in:*/ "Hello, world", /*want:*/ "dlrow ,olleH"},
- {/*in:*/ "Hello, 世界", /*want:*/ "界世 ,olleH"},
- {/*in:*/ "", /*want:*/ ""},
-} {
- ...
-}
+ {/*in: */"Hello, world", /*want: */"dlrow ,olleH"}
```

Default: `false`
### `go.inlayHints.compositeLiteralTypes`

-Enable/disable inlay hints for composite literal types.
+Enable/disable inlay hints for composite literal types:
```go
-
-for _, c := range []struct {in, want string}{
- /*struct{ in, want string }*/{"Hello, world", "dlrow ,olleH"},
- /*struct{ in, want string }*/{"Hello, 世界", "界世 ,olleH"},
- /*struct{ in, want string }*/{"", ""},
-} {
- ...
-}
+ for _, c := range []struct {
+ in, want string
+ }{
+ /*struct{ in string; want string }*/{"Hello, world", "dlrow ,olleH"},
+ }
```

Default: `false`
### `go.inlayHints.constantValues`

-Enable/disable inlay hints for constant values.
+Enable/disable inlay hints for constant values:
```go
-
-const (
- KindNone = iota /*= 0*/
- KindPrint /*= 1*/
- KindPrintf /*= 2*/
- KindErrorf /*= 3*/
-)
+ const (
+ KindNone Kind = iota/* = 0*/
+ KindPrint/* = 1*/
+ KindPrintf/* = 2*/
+ KindErrorf/* = 3*/
+ )
```

Default: `false`
### `go.inlayHints.functionTypeParameters`

-Enable/disable inlay hints for implicit type parameters on generic functions.
+Enable/disable inlay hints for implicit type parameters on generic functions:
```go
-
-func myFunc[T any](a T) { ... }
-
-func main() {
- myFunc/*[int]*/(1)
-}
+ myFoo/*[int, string]*/(1, "hello")
```

Default: `false`
### `go.inlayHints.parameterNames`

-Enable/disable inlay hints for parameter names.
+Enable/disable inlay hints for parameter names:
```go
-
-http.HandleFunc(/*pattern:*/ "/", /*handler:*/ indexHandler)
+ parseInt(/* str: */ "123", /* radix: */ 8)
```

Default: `false`
### `go.inlayHints.rangeVariableTypes`

-Enable/disable inlay hints for variable types in range statements.
+Enable/disable inlay hints for variable types in range statements:
```go
-
-for k /*int*/, v /*string*/ := range []string{} { ... }
+ for k/* int*/, v/* string/* := range []string{} {
+ fmt.Println(k, v)
+ }
```

Default: `false`
diff --git a/package.json b/package.json
index 1798d02..84c7227 100644
--- a/package.json
+++ b/package.json
@@ -2043,41 +2043,6 @@
"scope": "resource",
"type": "boolean"
},
- "go.inlayHints.assignVariableTypes": {
- "type": "boolean",
- "markdownDescription": "Enable/disable inlay hints for variable types in assign statements.\n```go\n\ni /*int*/, j /*int*/ := 0, len(r)-1\n```",
- "default": false
- },
- "go.inlayHints.compositeLiteralFields": {
- "type": "boolean",
- "markdownDescription": "Enable/disable inlay hints for composite literal field names.\n```go\n\nfor _, c := range []struct {in, want string}{\n\t{/*in:*/ \"Hello, world\", /*want:*/ \"dlrow ,olleH\"},\n\t{/*in:*/ \"Hello, 世界\", /*want:*/ \"界世 ,olleH\"},\n\t{/*in:*/ \"\", /*want:*/ \"\"},\n} {\n\t...\n}\n```",
- "default": false
- },
- "go.inlayHints.compositeLiteralTypes": {
- "type": "boolean",
- "markdownDescription": "Enable/disable inlay hints for composite literal types.\n```go\n\nfor _, c := range []struct {in, want string}{\n\t/*struct{ in, want string }*/{\"Hello, world\", \"dlrow ,olleH\"},\n\t/*struct{ in, want string }*/{\"Hello, 世界\", \"界世 ,olleH\"},\n\t/*struct{ in, want string }*/{\"\", \"\"},\n} {\n\t...\n}\n```",
- "default": false
- },
- "go.inlayHints.constantValues": {
- "type": "boolean",
- "markdownDescription": "Enable/disable inlay hints for constant values.\n```go\n\nconst (\n\tKindNone = iota\t/*= 0*/\n\tKindPrint\t/*= 1*/\n\tKindPrintf\t/*= 2*/\n\tKindErrorf\t/*= 3*/\n)\n```",
- "default": false
- },
- "go.inlayHints.functionTypeParameters": {
- "type": "boolean",
- "markdownDescription": "Enable/disable inlay hints for implicit type parameters on generic functions.\n```go\n\nfunc myFunc[T any](a T) { ... }\n\nfunc main() {\n\tmyFunc/*[int]*/(1)\n}\n```",
- "default": false
- },
- "go.inlayHints.parameterNames": {
- "type": "boolean",
- "markdownDescription": "Enable/disable inlay hints for parameter names.\n```go\n\nhttp.HandleFunc(/*pattern:*/ \"/\", /*handler:*/ indexHandler)\n```",
- "default": false
- },
- "go.inlayHints.rangeVariableTypes": {
- "type": "boolean",
- "markdownDescription": "Enable/disable inlay hints for variable types in range statements.\n```go\n\nfor k /*int*/, v /*string*/ := range []string{} { ... }\n```",
- "default": false
- },
"gopls": {
"type": "object",
"markdownDescription": "Configure the default Go language server ('gopls'). In most cases, configuring this section is unnecessary. See [the documentation](https://github.com/golang/tools/blob/master/gopls/doc/settings.md) for all available settings.",
@@ -2618,6 +2583,41 @@
"scope": "resource"
}
}
+ },
+ "go.inlayHints.assignVariableTypes": {
+ "type": "boolean",
+ "markdownDescription": "Enable/disable inlay hints for variable types in assign statements:\n```go\n\ti/* int*/, j/* int*/ := 0, len(r)-1\n```",
+ "default": false
+ },
+ "go.inlayHints.compositeLiteralFields": {
+ "type": "boolean",
+ "markdownDescription": "Enable/disable inlay hints for composite literal field names:\n```go\n\t{/*in: */\"Hello, world\", /*want: */\"dlrow ,olleH\"}\n```",
+ "default": false
+ },
+ "go.inlayHints.compositeLiteralTypes": {
+ "type": "boolean",
+ "markdownDescription": "Enable/disable inlay hints for composite literal types:\n```go\n\tfor _, c := range []struct {\n\t\tin, want string\n\t}{\n\t\t/*struct{ in string; want string }*/{\"Hello, world\", \"dlrow ,olleH\"},\n\t}\n```",
+ "default": false
+ },
+ "go.inlayHints.constantValues": {
+ "type": "boolean",
+ "markdownDescription": "Enable/disable inlay hints for constant values:\n```go\n\tconst (\n\t\tKindNone Kind = iota/* = 0*/\n\t\tKindPrint/* = 1*/\n\t\tKindPrintf/* = 2*/\n\t\tKindErrorf/* = 3*/\n\t)\n```",
+ "default": false
+ },
+ "go.inlayHints.functionTypeParameters": {
+ "type": "boolean",
+ "markdownDescription": "Enable/disable inlay hints for implicit type parameters on generic functions:\n```go\n\tmyFoo/*[int, string]*/(1, \"hello\")\n```",
+ "default": false
+ },
+ "go.inlayHints.parameterNames": {
+ "type": "boolean",
+ "markdownDescription": "Enable/disable inlay hints for parameter names:\n```go\n\tparseInt(/* str: */ \"123\", /* radix: */ 8)\n```",
+ "default": false
+ },
+ "go.inlayHints.rangeVariableTypes": {
+ "type": "boolean",
+ "markdownDescription": "Enable/disable inlay hints for variable types in range statements:\n```go\n\tfor k/* int*/, v/* string/* := range []string{} {\n\t\tfmt.Println(k, v)\n\t}\n```",
+ "default": false
}
}
},
diff --git a/tools/goplssetting/goplssetting.go b/tools/goplssetting/goplssetting.go
index e78d26c..988b59f 100644
--- a/tools/goplssetting/goplssetting.go
+++ b/tools/goplssetting/goplssetting.go
@@ -17,10 +17,6 @@
"strings"
)

-var skipHierarchy map[string]bool = map[string]bool{
- "ui.inlayhint": true,
-}
-
// Generate reads package.json and updates the gopls settings section
// based on `gopls api-json` output. This function requires `jq` to
// manipulate package.json.
@@ -185,22 +181,21 @@
return v[i].Name < v[j].Name
})
}
- properties, err := collectProperties(seen)
+ goplsProperties, goProperties, err := collectProperties(seen)
if err != nil {
return nil, err
}
- return json.Marshal(map[string]*Object{
- "gopls": {
- Type: "object",
- MarkdownDescription: "Configure the default Go language server ('gopls'). In most cases, configuring this section is unnecessary. See [the documentation](https://github.com/golang/tools/blob/master/gopls/doc/settings.md) for all available settings.",
- Scope: "resource",
- AdditionalProperties: false,
- Properties: properties,
- },
- })
+ goProperties["gopls"] = &Object{
+ Type: "object",
+ MarkdownDescription: "Configure the default Go language server ('gopls'). In most cases, configuring this section is unnecessary. See [the documentation](https://github.com/golang/tools/blob/master/gopls/doc/settings.md) for all available settings.",
+ Scope: "resource",
+ AdditionalProperties: false,
+ Properties: goplsProperties,
+ }
+ return json.Marshal(goProperties)
}

-func collectProperties(m map[string][]*OptionJSON) (map[string]*Object, error) {
+func collectProperties(m map[string][]*OptionJSON) (map[string]*Object, map[string]*Object, error) {
var sorted []string
var containsEmpty bool
for k := range m {
@@ -214,9 +209,23 @@
if containsEmpty {
sorted = append(sorted, "")
}
- properties := map[string]*Object{}
+ properties, goProperties := map[string]*Object{}, map[string]*Object{}
for _, hierarchy := range sorted {
- if skip := skipHierarchy[hierarchy]; skip {
+ if hierarchy == "ui.inlayhint" {
+ for _, opt := range m[hierarchy] {
+ for _, k := range opt.EnumKeys.Keys {
+ unquotedName, err := strconv.Unquote(k.Name)
+ if err != nil {
+ return nil, nil, err
+ }
+ key := "go.inlayHints." + unquotedName
+ goProperties[key] = &Object{
+ MarkdownDescription: k.Doc,
+ Type: "boolean",
+ Default: formatDefault(k.Default, "boolean"),
+ }
+ }
+ }
continue
}
for _, opt := range m[hierarchy] {
@@ -237,7 +246,7 @@
for _, v := range opt.EnumValues {
unquotedName, err := strconv.Unquote(v.Value)
if err != nil {
- return nil, err
+ return nil, nil, err
}
obj.Enum = append(obj.Enum, unquotedName)
obj.MarkdownEnumDescriptions = append(obj.MarkdownEnumDescriptions, v.Doc)
@@ -251,7 +260,7 @@
for _, k := range opt.EnumKeys.Keys {
unquotedName, err := strconv.Unquote(k.Name)
if err != nil {
- return nil, err
+ return nil, nil, err
}
obj.Properties[unquotedName] = &Object{
Type: propertyType(opt.EnumKeys.ValueType),
@@ -270,7 +279,7 @@
properties[key] = obj
}
}
- return properties, nil
+ return properties, goProperties, nil
}

func formatOptionDefault(opt *OptionJSON) interface{} {

To view, visit change 419120. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: vscode-go
Gerrit-Branch: master
Gerrit-Change-Id: Ib4d66b1f03b4e6aa0019d6a9094cc172c8dc952a
Gerrit-Change-Number: 419120
Gerrit-PatchSet: 1
Gerrit-Owner: Suzy Mueller <suz...@golang.org>
Gerrit-Reviewer: Suzy Mueller <suz...@golang.org>
Gerrit-MessageType: newchange

kokoro (Gerrit)

unread,
Jul 26, 2022, 12:21:18 PM7/26/22
to Suzy Mueller, goph...@pubsubhelper.golang.org, Hyang-Ah Hana Kim, golang-co...@googlegroups.com

Attention is currently required from: Hyang-Ah Hana Kim, Suzy Mueller.

Kokoro presubmit build finished with status: FAILURE
Logs at: https://source.cloud.google.com/results/invocations/2980d386-abb4-4611-b1bf-ec5a9f763425

Patch set 1:TryBot-Result -1

View Change

    To view, visit change 419120. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: vscode-go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib4d66b1f03b4e6aa0019d6a9094cc172c8dc952a
    Gerrit-Change-Number: 419120
    Gerrit-PatchSet: 1
    Gerrit-Owner: Suzy Mueller <suz...@golang.org>
    Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
    Gerrit-Reviewer: Suzy Mueller <suz...@golang.org>
    Gerrit-Reviewer: kokoro <noreply...@google.com>
    Gerrit-Attention: Suzy Mueller <suz...@golang.org>
    Gerrit-Attention: Hyang-Ah Hana Kim <hya...@gmail.com>
    Gerrit-Comment-Date: Tue, 26 Jul 2022 16:21:14 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Suzy Mueller (Gerrit)

    unread,
    Jul 26, 2022, 1:26:07 PM7/26/22
    to goph...@pubsubhelper.golang.org, kokoro, Hyang-Ah Hana Kim, golang-co...@googlegroups.com

    Attention is currently required from: Hyang-Ah Hana Kim.

    View Change

    1 comment:

    • Patchset:

      • Patch Set #1:

        Test failures are due to the manual edits to clean up the settings generated from gopls. The logic can still be reviewed, even if we want to wait for gopls release to generate the settings.

    To view, visit change 419120. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: vscode-go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib4d66b1f03b4e6aa0019d6a9094cc172c8dc952a
    Gerrit-Change-Number: 419120
    Gerrit-PatchSet: 1
    Gerrit-Owner: Suzy Mueller <suz...@golang.org>
    Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
    Gerrit-Reviewer: Suzy Mueller <suz...@golang.org>
    Gerrit-Reviewer: kokoro <noreply...@google.com>
    Gerrit-Attention: Hyang-Ah Hana Kim <hya...@gmail.com>
    Gerrit-Comment-Date: Tue, 26 Jul 2022 17:26:04 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Hyang-Ah Hana Kim (Gerrit)

    unread,
    Jul 26, 2022, 2:09:29 PM7/26/22
    to Suzy Mueller, goph...@pubsubhelper.golang.org, Hyang-Ah Hana Kim, kokoro, golang-co...@googlegroups.com

    Attention is currently required from: Suzy Mueller.

    Patch set 1:Code-Review +2

    View Change

    1 comment:

    • File tools/goplssetting/goplssetting.go:

      • Patch Set #1, Line 198: map[string]*Object, map[string]*Object, error

        How about utilizing the return parameters for documentation purpose?

        func collectProperties(m map[string][]*OptionJSON) (goPropoerties, goplsProperties map[string]*Object, _ error) {
        ..|}

    To view, visit change 419120. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: vscode-go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib4d66b1f03b4e6aa0019d6a9094cc172c8dc952a
    Gerrit-Change-Number: 419120
    Gerrit-PatchSet: 1
    Gerrit-Owner: Suzy Mueller <suz...@golang.org>
    Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
    Gerrit-Reviewer: Suzy Mueller <suz...@golang.org>
    Gerrit-Reviewer: kokoro <noreply...@google.com>
    Gerrit-Attention: Suzy Mueller <suz...@golang.org>
    Gerrit-Comment-Date: Tue, 26 Jul 2022 18:09:26 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Suzy Mueller (Gerrit)

    unread,
    Jul 26, 2022, 2:29:55 PM7/26/22
    to goph...@pubsubhelper.golang.org, Hyang-Ah Hana Kim, kokoro, golang-co...@googlegroups.com

    Attention is currently required from: Hyang-Ah Hana Kim, Suzy Mueller.

    View Change

    1 comment:

    • File tools/goplssetting/goplssetting.go:

      • How about utilizing the return parameters for documentation purpose? […]

        Done

    To view, visit change 419120. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: vscode-go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib4d66b1f03b4e6aa0019d6a9094cc172c8dc952a
    Gerrit-Change-Number: 419120
    Gerrit-PatchSet: 2
    Gerrit-Owner: Suzy Mueller <suz...@golang.org>
    Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
    Gerrit-Reviewer: Suzy Mueller <suz...@golang.org>
    Gerrit-Reviewer: kokoro <noreply...@google.com>
    Gerrit-Attention: Suzy Mueller <suz...@golang.org>
    Gerrit-Attention: Hyang-Ah Hana Kim <hya...@gmail.com>
    Gerrit-Comment-Date: Tue, 26 Jul 2022 18:29:52 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Hyang-Ah Hana Kim <hya...@gmail.com>
    Gerrit-MessageType: comment

    Suzy Mueller (Gerrit)

    unread,
    Jul 26, 2022, 2:29:55 PM7/26/22
    to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Attention is currently required from: Hyang-Ah Hana Kim, Suzy Mueller.

    Suzy Mueller uploaded patch set #2 to this change.

    View Change

    The following approvals got outdated and were removed: Run-TryBot+1 by Suzy Mueller, TryBot-Result-1 by kokoro

    tools: generate inlay hints settings from gopls settings

    This updates the script to generate the inlay hints settings
    automatically from gopls. I did some manual touch ups on the settings
    from gopls for now and will send a CL to gopls to make the settings
    fixes upstream.

    Change-Id: Ib4d66b1f03b4e6aa0019d6a9094cc172c8dc952a
    ---
    M docs/settings.md
    M package.json
    M tools/goplssetting/goplssetting.go
    3 files changed, 103 insertions(+), 98 deletions(-)

    To view, visit change 419120. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: vscode-go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib4d66b1f03b4e6aa0019d6a9094cc172c8dc952a
    Gerrit-Change-Number: 419120
    Gerrit-PatchSet: 2
    Gerrit-Owner: Suzy Mueller <suz...@golang.org>
    Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
    Gerrit-Reviewer: Suzy Mueller <suz...@golang.org>
    Gerrit-Reviewer: kokoro <noreply...@google.com>
    Gerrit-Attention: Suzy Mueller <suz...@golang.org>
    Gerrit-Attention: Hyang-Ah Hana Kim <hya...@gmail.com>
    Gerrit-MessageType: newpatchset

    kokoro (Gerrit)

    unread,
    Jul 26, 2022, 2:39:09 PM7/26/22
    to Suzy Mueller, goph...@pubsubhelper.golang.org, Hyang-Ah Hana Kim, golang-co...@googlegroups.com

    Attention is currently required from: Hyang-Ah Hana Kim, Suzy Mueller.

    Kokoro presubmit build finished with status: FAILURE
    Logs at: https://source.cloud.google.com/results/invocations/033f7cc7-bc5b-49f3-9b89-f3cab29c8661

    Patch set 2:TryBot-Result -1

    View Change

      To view, visit change 419120. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: vscode-go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ib4d66b1f03b4e6aa0019d6a9094cc172c8dc952a
      Gerrit-Change-Number: 419120
      Gerrit-PatchSet: 2
      Gerrit-Owner: Suzy Mueller <suz...@golang.org>
      Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
      Gerrit-Reviewer: Suzy Mueller <suz...@golang.org>
      Gerrit-Reviewer: kokoro <noreply...@google.com>
      Gerrit-Attention: Suzy Mueller <suz...@golang.org>
      Gerrit-Attention: Hyang-Ah Hana Kim <hya...@gmail.com>
      Gerrit-Comment-Date: Tue, 26 Jul 2022 18:39:05 +0000

      Hyang-Ah Hana Kim (Gerrit)

      unread,
      Jul 27, 2022, 5:22:07 PM7/27/22
      to Suzy Mueller, goph...@pubsubhelper.golang.org, kokoro, Hyang-Ah Hana Kim, golang-co...@googlegroups.com

      Attention is currently required from: Suzy Mueller.

      Patch set 2:Code-Review +2

      View Change

      1 comment:

      • File tools/goplssetting/goplssetting.go:

        • Done

          these maps still need initialization.

      To view, visit change 419120. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: vscode-go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ib4d66b1f03b4e6aa0019d6a9094cc172c8dc952a
      Gerrit-Change-Number: 419120
      Gerrit-PatchSet: 2
      Gerrit-Owner: Suzy Mueller <suz...@golang.org>
      Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
      Gerrit-Reviewer: Suzy Mueller <suz...@golang.org>
      Gerrit-Reviewer: kokoro <noreply...@google.com>
      Gerrit-Attention: Suzy Mueller <suz...@golang.org>
      Gerrit-Comment-Date: Wed, 27 Jul 2022 21:22:03 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Suzy Mueller <suz...@golang.org>
      Comment-In-Reply-To: Hyang-Ah Hana Kim <hya...@gmail.com>
      Gerrit-MessageType: comment

      Suzy Mueller (Gerrit)

      unread,
      Jul 29, 2022, 10:14:06 AM7/29/22
      to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Hyang-Ah Hana Kim, Suzy Mueller.

      Suzy Mueller uploaded patch set #3 to this change.

      View Change

      The following approvals got outdated and were removed: Run-TryBot+1 by Suzy Mueller, TryBot-Result-1 by kokoro

      tools: generate inlay hints settings from gopls settings

      This updates the script to generate the inlay hints settings
      automatically from gopls. I did some manual touch ups on the settings
      from gopls for now and will send a CL to gopls to make the settings
      fixes upstream.

      Change-Id: Ib4d66b1f03b4e6aa0019d6a9094cc172c8dc952a
      ---
      M docs/settings.md
      M package.json
      M tools/goplssetting/goplssetting.go
      3 files changed, 104 insertions(+), 98 deletions(-)

      To view, visit change 419120. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: vscode-go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ib4d66b1f03b4e6aa0019d6a9094cc172c8dc952a
      Gerrit-Change-Number: 419120
      Gerrit-PatchSet: 3
      Gerrit-Owner: Suzy Mueller <suz...@golang.org>
      Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
      Gerrit-Reviewer: Suzy Mueller <suz...@golang.org>
      Gerrit-Reviewer: kokoro <noreply...@google.com>
      Gerrit-Attention: Suzy Mueller <suz...@golang.org>
      Gerrit-Attention: Hyang-Ah Hana Kim <hya...@gmail.com>
      Gerrit-MessageType: newpatchset

      Suzy Mueller (Gerrit)

      unread,
      Jul 29, 2022, 10:14:07 AM7/29/22
      to goph...@pubsubhelper.golang.org, kokoro, Hyang-Ah Hana Kim, golang-co...@googlegroups.com

      Attention is currently required from: Hyang-Ah Hana Kim, Suzy Mueller.

      View Change

      1 comment:

      • File tools/goplssetting/goplssetting.go:

        • these maps still need initialization.

          right. done :)

      To view, visit change 419120. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: vscode-go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ib4d66b1f03b4e6aa0019d6a9094cc172c8dc952a
      Gerrit-Change-Number: 419120
      Gerrit-PatchSet: 3
      Gerrit-Owner: Suzy Mueller <suz...@golang.org>
      Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
      Gerrit-Reviewer: Suzy Mueller <suz...@golang.org>
      Gerrit-Reviewer: kokoro <noreply...@google.com>
      Gerrit-Attention: Suzy Mueller <suz...@golang.org>
      Gerrit-Attention: Hyang-Ah Hana Kim <hya...@gmail.com>
      Gerrit-Comment-Date: Fri, 29 Jul 2022 14:14:02 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Suzy Mueller <suz...@golang.org>
      Comment-In-Reply-To: Hyang-Ah Hana Kim <hya...@gmail.com>
      Gerrit-MessageType: comment

      kokoro (Gerrit)

      unread,
      Jul 29, 2022, 10:21:23 AM7/29/22
      to Suzy Mueller, goph...@pubsubhelper.golang.org, Hyang-Ah Hana Kim, golang-co...@googlegroups.com

      Attention is currently required from: Hyang-Ah Hana Kim, Suzy Mueller.

      Kokoro presubmit build finished with status: FAILURE
      Logs at: https://source.cloud.google.com/results/invocations/c9f123da-306f-4c70-a82c-54d19b178470

      Patch set 3:TryBot-Result -1

      View Change

        To view, visit change 419120. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: vscode-go
        Gerrit-Branch: master
        Gerrit-Change-Id: Ib4d66b1f03b4e6aa0019d6a9094cc172c8dc952a
        Gerrit-Change-Number: 419120
        Gerrit-PatchSet: 3
        Gerrit-Owner: Suzy Mueller <suz...@golang.org>
        Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
        Gerrit-Reviewer: Suzy Mueller <suz...@golang.org>
        Gerrit-Reviewer: kokoro <noreply...@google.com>
        Gerrit-Attention: Suzy Mueller <suz...@golang.org>
        Gerrit-Attention: Hyang-Ah Hana Kim <hya...@gmail.com>
        Gerrit-Comment-Date: Fri, 29 Jul 2022 14:21:19 +0000

        Suzy Mueller (Gerrit)

        unread,
        Aug 10, 2022, 5:11:40 PM8/10/22
        to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

        Attention is currently required from: Hyang-Ah Hana Kim, Suzy Mueller.

        Suzy Mueller uploaded patch set #4 to this change.

        View Change

        The following approvals got outdated and were removed: Run-TryBot+1 by Suzy Mueller, TryBot-Result-1 by kokoro

        tools: generate inlay hints settings from gopls settings

        This updates the script to generate the inlay hints settings
        automatically from gopls. I did some manual touch ups on the settings
        from gopls for now and will send a CL to gopls to make the settings
        fixes upstream.

        Change-Id: Ib4d66b1f03b4e6aa0019d6a9094cc172c8dc952a
        ---
        M docs/settings.md
        M package.json
        M tools/goplssetting/goplssetting.go
        3 files changed, 150 insertions(+), 99 deletions(-)

        To view, visit change 419120. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: vscode-go
        Gerrit-Branch: master
        Gerrit-Change-Id: Ib4d66b1f03b4e6aa0019d6a9094cc172c8dc952a
        Gerrit-Change-Number: 419120
        Gerrit-PatchSet: 4
        Gerrit-Owner: Suzy Mueller <suz...@golang.org>
        Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
        Gerrit-Reviewer: Suzy Mueller <suz...@golang.org>
        Gerrit-Reviewer: kokoro <noreply...@google.com>
        Gerrit-Attention: Suzy Mueller <suz...@golang.org>
        Gerrit-Attention: Hyang-Ah Hana Kim <hya...@gmail.com>
        Gerrit-MessageType: newpatchset

        kokoro (Gerrit)

        unread,
        Aug 10, 2022, 5:23:57 PM8/10/22
        to Suzy Mueller, goph...@pubsubhelper.golang.org, Hyang-Ah Hana Kim, golang-co...@googlegroups.com

        Attention is currently required from: Hyang-Ah Hana Kim, Suzy Mueller.

        Kokoro presubmit build finished with status: SUCCESS
        Logs at: https://source.cloud.google.com/results/invocations/7ac61d28-bb4a-4a14-88a3-fe3eca0fd1b3

        Patch set 4:TryBot-Result +1

        View Change

          To view, visit change 419120. To unsubscribe, or for help writing mail filters, visit settings.

          Gerrit-Project: vscode-go
          Gerrit-Branch: master
          Gerrit-Change-Id: Ib4d66b1f03b4e6aa0019d6a9094cc172c8dc952a
          Gerrit-Change-Number: 419120
          Gerrit-PatchSet: 4
          Gerrit-Owner: Suzy Mueller <suz...@golang.org>
          Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
          Gerrit-Reviewer: Suzy Mueller <suz...@golang.org>
          Gerrit-Reviewer: kokoro <noreply...@google.com>
          Gerrit-Attention: Suzy Mueller <suz...@golang.org>
          Gerrit-Attention: Hyang-Ah Hana Kim <hya...@gmail.com>
          Gerrit-Comment-Date: Wed, 10 Aug 2022 21:23:53 +0000

          Suzy Mueller (Gerrit)

          unread,
          Aug 11, 2022, 10:04:38 AM8/11/22
          to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, kokoro, Hyang-Ah Hana Kim, golang-co...@googlegroups.com

          Suzy Mueller submitted this change.

          View Change



          2 is the latest approved patch-set.
          The change was submitted with unreviewed changes in the following files:

          ```
          The name of the file: package.json
          Insertions: 29, Deletions: 2.

          @@ -95,6 +95,7 @@
          "workspaceContains:*/*.go",
          "workspaceContains:*/*/*.go",
          "onCommand:go.gopath",
          + "onCommand:go.goroot",
          "onCommand:go.tools.install",
          "onCommand:go.locate.tools",
          "onCommand:go.show.commands",
          @@ -212,6 +213,11 @@
          "description": "See the currently set GOPATH."
          },
          {
          + "command": "go.goroot",
          + "title": "Go: Current GOROOT",
          + "description": "See the currently set GOROOT."
          + },
          + {
          "command": "go.locate.tools",
          "title": "Go: Locate Configured Go Tools",
          "description": "List all the Go tools being used by this extension along with their locations."
          @@ -2155,6 +2161,11 @@
          "markdownDescription": "Regenerates cgo definitions.",
          "default": true
          },
          + "run_vulncheck_exp": {
          + "type": "boolean",
          + "markdownDescription": "Run vulnerability check (`govulncheck`).",

          + "default": false
          + },
                           "test": {
          "type": "boolean",
          "markdownDescription": "Runs `go test` for a specific set of test or benchmark functions.",
          @@ -2401,6 +2412,11 @@
          "markdownDescription": "check for common mistaken usages of tests and examples\n\nThe tests checker walks Test, Benchmark and Example functions checking\nmalformed names, wrong signatures and examples documenting non-existent\nidentifiers.\n\nPlease see the documentation for package testing in golang.org/pkg/testing\nfor the conventions that are enforced for Tests, Benchmarks, and Examples.",
          "default": true
          },
          + "timeformat": {
          + "type": "boolean",
          + "markdownDescription": "check for calls of (time.Time).Format or time.Parse with 2006-02-01\n\nThe timeformat checker looks for time formats with the 2006-02-01 (yyyy-dd-mm)\nformat. Internationally, \"yyyy-dd-mm\" does not occur in common calendar date\nstandards, and so it is more likely that 2006-01-02 (yyyy-mm-dd) was intended.\n",
          + "default": true
          + },
          "undeclaredname": {
          "type": "boolean",
          "markdownDescription": "suggested fixes for \"undeclared name: <>\"\n\nThis checker provides suggested fixes for type errors of the\ntype \"undeclared name: <>\". It will either insert a new statement,\nsuch as:\n\n\"<> := \"\n\nor a new function declaration, such as:\n\nfunc <>(inferred parameters) {\n\tpanic(\"implement me!\")\n}\n",
          @@ -2431,6 +2447,11 @@
          "markdownDescription": "check for unused results of calls to some functions\n\nSome functions like fmt.Errorf return a result and have no side effects,\nso it is always a mistake to discard the result. This analyzer reports\ncalls to certain functions in which the result of the call is ignored.\n\nThe set of functions may be controlled using flags.",
          "default": true
          },
          + "unusedvariable": {
          + "type": "boolean",
          + "markdownDescription": "check for unused variables\n\nThe unusedvariable analyzer suggests fixes for unused variables errors.\n",

          + "default": false
          + },
                           "unusedwrite": {
          "type": "boolean",
          "markdownDescription": "checks for unused writes\n\nThe analyzer reports instances of writes to struct fields and\narrays that are never read. Specifically, when a struct object\nor an array is copied, its elements are copied implicitly by\nthe compiler, and any element write to this copy does nothing\nwith the original object.\n\nFor example:\n\n\ttype T struct { x int }\n\tfunc f(input []T) {\n\t\tfor i, v := range input { // v is a copy\n\t\t\tv.x = i // unused write to field x\n\t\t}\n\t}\n\nAnother example is about non-pointer receiver:\n\n\ttype T struct { x int }\n\tfunc (t T) f() { // t is a copy\n\t\tt.x = i // unused write to field x\n\t}\n",
          @@ -2510,7 +2531,7 @@
          },
          "ui.documentation.linkTarget": {
          "type": "string",
          - "markdownDescription": "linkTarget controls where documentation links go.\nIt might be one of:\n\n* `\"godoc.org\"`\n* `\"pkg.go.dev\"`\n\nIf company chooses to use its own `godoc.org`, its address can be used as well.\n",
          + "markdownDescription": "linkTarget controls where documentation links go.\nIt might be one of:\n\n* `\"godoc.org\"`\n* `\"pkg.go.dev\"`\n\nIf company chooses to use its own `godoc.org`, its address can be used as well.\n\nModules matching the GOPRIVATE environment variable will not have\ndocumentation links in hover.\n",
          "default": "pkg.go.dev",
          "scope": "resource"
          },
          @@ -2570,6 +2591,18 @@
          "default": "Dynamic",
          "scope": "resource"
          },
          + "ui.noSemanticNumber": {
          + "type": "boolean",
          + "markdownDescription": "(Experimental) noSemanticNumber turns off the sending of the semantic token 'number'\n",
          + "default": false,
          + "scope": "resource"
          + },
          + "ui.noSemanticString": {
          + "type": "boolean",
          + "markdownDescription": "(Experimental) noSemanticString turns off the sending of the semantic token 'string'\n",
          + "default": false,
          + "scope": "resource"
          + },
          "ui.semanticTokens": {
          "type": "boolean",
          "markdownDescription": "(Experimental) semanticTokens controls whether the LSP server will send\nsemantic tokens to the client.\n",
          @@ -2616,7 +2649,7 @@
          },
          "go.inlayHints.rangeVariableTypes": {
          "type": "boolean",
          - "markdownDescription": "Enable/disable inlay hints for variable types in range statements:\n```go\n\tfor k/* int*/, v/* string/* := range []string{} {\n\t\tfmt.Println(k, v)\n\t}\n```",
          + "markdownDescription": "Enable/disable inlay hints for variable types in range statements:\n```go\n\tfor k/* int*/, v/* string*/ := range []string{} {\n\t\tfmt.Println(k, v)\n\t}\n```",
          "default": false
          }
          }
          ```
          ```
          The name of the file: tools/goplssetting/goplssetting.go
          Insertions: 1, Deletions: 0.

          @@ -209,6 +209,7 @@

          if containsEmpty {
          sorted = append(sorted, "")
          }
          +	goplsProperties, goProperties = map[string]*Object{}, map[string]*Object{}

          for _, hierarchy := range sorted {
           		if hierarchy == "ui.inlayhint" {

          for _, opt := range m[hierarchy] {
          ```
          ```
          The name of the file: docs/settings.md
          Insertions: 19, Deletions: 1.

          @@ -331,7 +331,7 @@


          Enable/disable inlay hints for variable types in range statements:
           ```go
          - for k/* int*/, v/* string/* := range []string{} {
          + for k/* int*/, v/* string*/ := range []string{} {
          fmt.Println(k, v)
          }
          ```
          @@ -727,6 +727,7 @@
          | `gc_details` | Toggle the calculation of gc annotations. <br/> Default: `false` |
          | `generate` | Runs `go generate` for a given directory. <br/> Default: `true` |
          | `regenerate_cgo` | Regenerates cgo definitions. <br/> Default: `true` |
          +| `run_vulncheck_exp` | Run vulnerability check (`govulncheck`). <br/> Default: `false` |
          | `test` | Runs `go test` for a specific set of test or benchmark functions. <br/> Default: `false` |
          | `tidy` | Runs `go mod tidy` for a module. <br/> Default: `true` |
          | `upgrade_dependency` | Upgrades a dependency in the go.mod file for a module. <br/> Default: `true` |
          @@ -820,12 +821,14 @@
          | `stubmethods` | stub methods analyzer <br/> This analyzer generates method stubs for concrete types in order to implement a target interface <br/> Default: `true` |
          | `testinggoroutine` | report calls to (*testing.T).Fatal from goroutines started by a test. <br/> Functions that abruptly terminate a test, such as the Fatal, Fatalf, FailNow, and Skip{,f,Now} methods of *testing.T, must be called from the test goroutine itself. This checker detects calls to these functions that occur within a goroutine started by the test. For example: <br/> func TestFoo(t *testing.T) { go func() { t.Fatal("oops") // error: (*T).Fatal called from non-test goroutine }() } <br/> <br/> Default: `true` |
          | `tests` | check for common mistaken usages of tests and examples <br/> The tests checker walks Test, Benchmark and Example functions checking malformed names, wrong signatures and examples documenting non-existent identifiers. <br/> Please see the documentation for package testing in golang.org/pkg/testing for the conventions that are enforced for Tests, Benchmarks, and Examples. <br/> Default: `true` |
          +| `timeformat` | check for calls of (time.Time).Format or time.Parse with 2006-02-01 <br/> The timeformat checker looks for time formats with the 2006-02-01 (yyyy-dd-mm) format. Internationally, "yyyy-dd-mm" does not occur in common calendar date standards, and so it is more likely that 2006-01-02 (yyyy-mm-dd) was intended. <br/> <br/> Default: `true` |
          | `undeclaredname` | suggested fixes for "undeclared name: <>" <br/> This checker provides suggested fixes for type errors of the type "undeclared name: <>". It will either insert a new statement, such as: <br/> "<> := " <br/> or a new function declaration, such as: <br/> func <>(inferred parameters) { <pre>panic("implement me!")</pre>} <br/> <br/> Default: `true` |
          | `unmarshal` | report passing non-pointer or non-interface values to unmarshal <br/> The unmarshal analysis reports calls to functions such as json.Unmarshal in which the argument type is not a pointer or an interface. <br/> Default: `true` |
          | `unreachable` | check for unreachable code <br/> The unreachable analyzer finds statements that execution can never reach because they are preceded by an return statement, a call to panic, an infinite loop, or similar constructs. <br/> Default: `true` |
          | `unsafeptr` | check for invalid conversions of uintptr to unsafe.Pointer <br/> The unsafeptr analyzer reports likely incorrect uses of unsafe.Pointer to convert integers to pointers. A conversion from uintptr to unsafe.Pointer is invalid if it implies that there is a uintptr-typed word in memory that holds a pointer value, because that word will be invisible to stack copying and to the garbage collector. <br/> Default: `true` |
          | `unusedparams` | check for unused parameters of functions <br/> The unusedparams analyzer checks functions to see if there are any parameters that are not being used. <br/> To reduce false positives it ignores: - methods - parameters that do not have a name or are underscored - functions in test files - functions with empty bodies or those with just a return stmt <br/> Default: `false` |
          | `unusedresult` | check for unused results of calls to some functions <br/> Some functions like fmt.Errorf return a result and have no side effects, so it is always a mistake to discard the result. This analyzer reports calls to certain functions in which the result of the call is ignored. <br/> The set of functions may be controlled using flags. <br/> Default: `true` |
          +| `unusedvariable` | check for unused variables <br/> The unusedvariable analyzer suggests fixes for unused variables errors. <br/> <br/> Default: `false` |
          | `unusedwrite` | checks for unused writes <br/> The analyzer reports instances of writes to struct fields and arrays that are never read. Specifically, when a struct object or an array is copied, its elements are copied implicitly by the compiler, and any element write to this copy does nothing with the original object. <br/> For example: <br/> <pre>type T struct { x int }<br/>func f(input []T) {<br/> for i, v := range input { // v is a copy<br/> v.x = i // unused write to field x<br/> }<br/>}</pre><br/> Another example is about non-pointer receiver: <br/> <pre>type T struct { x int }<br/>func (t T) f() { // t is a copy<br/> t.x = i // unused write to field x<br/>}</pre><br/> <br/> Default: `false` |
          | `useany` | check for constraints that could be simplified to "any" <br/> Default: `false` |
          ### `ui.diagnostic.annotations`
          @@ -895,6 +898,9 @@

          If company chooses to use its own `godoc.org`, its address can be used as well.

          +Modules matching the GOPRIVATE environment variable will not have
          +documentation links in hover.
          +

          Default: `"pkg.go.dev"`
          ### `ui.documentation.linksInHover`
          @@ -945,6 +951,18 @@


          Default: `"Dynamic"`
          +### `ui.noSemanticNumber`
          +
          +(Experimental) noSemanticNumber turns off the sending of the semantic token 'number'
          +
          +
          +Default: `false`
          +### `ui.noSemanticString`
          +
          +(Experimental) noSemanticString turns off the sending of the semantic token 'string'
          +
          +
          +Default: `false`
          ### `ui.semanticTokens`

          (Experimental) semanticTokens controls whether the LSP server will send
          ```

          Approvals: Suzy Mueller: Run TryBots Hyang-Ah Hana Kim: Looks good to me, approved kokoro: TryBots succeeded
          tools: generate inlay hints settings from gopls settings

          This updates the script to generate the inlay hints settings
          automatically from gopls. I did some manual touch ups on the settings
          from gopls for now and will send a CL to gopls to make the settings
          fixes upstream.

          Change-Id: Ib4d66b1f03b4e6aa0019d6a9094cc172c8dc952a
          Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/419120
          Reviewed-by: Hyang-Ah Hana Kim <hya...@gmail.com>
          TryBot-Result: kokoro <noreply...@google.com>
          Run-TryBot: Suzy Mueller <suz...@golang.org>

          ---
          M docs/settings.md
          M package.json
          M tools/goplssetting/goplssetting.go
          3 files changed, 154 insertions(+), 99 deletions(-)

          diff --git a/docs/settings.md b/docs/settings.md
          index 0b0299e..c6f9975 100644
          +	for k/* int*/, v/* string*/ := range []string{} {

          + fmt.Println(k, v)
          + }
          ```

          Default: `false`
          @@ -744,6 +727,7 @@
          | `gc_details` | Toggle the calculation of gc annotations. <br/> Default: `false` |
          | `generate` | Runs `go generate` for a given directory. <br/> Default: `true` |
          | `regenerate_cgo` | Regenerates cgo definitions. <br/> Default: `true` |
          +| `run_vulncheck_exp` | Run vulnerability check (`govulncheck`). <br/> Default: `false` |
          | `test` | Runs `go test` for a specific set of test or benchmark functions. <br/> Default: `false` |
          | `tidy` | Runs `go mod tidy` for a module. <br/> Default: `true` |
          | `upgrade_dependency` | Upgrades a dependency in the go.mod file for a module. <br/> Default: `true` |
          @@ -837,12 +821,14 @@
          | `stubmethods` | stub methods analyzer <br/> This analyzer generates method stubs for concrete types in order to implement a target interface <br/> Default: `true` |
          | `testinggoroutine` | report calls to (*testing.T).Fatal from goroutines started by a test. <br/> Functions that abruptly terminate a test, such as the Fatal, Fatalf, FailNow, and Skip{,f,Now} methods of *testing.T, must be called from the test goroutine itself. This checker detects calls to these functions that occur within a goroutine started by the test. For example: <br/> func TestFoo(t *testing.T) { go func() { t.Fatal("oops") // error: (*T).Fatal called from non-test goroutine }() } <br/> <br/> Default: `true` |
          | `tests` | check for common mistaken usages of tests and examples <br/> The tests checker walks Test, Benchmark and Example functions checking malformed names, wrong signatures and examples documenting non-existent identifiers. <br/> Please see the documentation for package testing in golang.org/pkg/testing for the conventions that are enforced for Tests, Benchmarks, and Examples. <br/> Default: `true` |
          +| `timeformat` | check for calls of (time.Time).Format or time.Parse with 2006-02-01 <br/> The timeformat checker looks for time formats with the 2006-02-01 (yyyy-dd-mm) format. Internationally, "yyyy-dd-mm" does not occur in common calendar date standards, and so it is more likely that 2006-01-02 (yyyy-mm-dd) was intended. <br/> <br/> Default: `true` |
          | `undeclaredname` | suggested fixes for "undeclared name: <>" <br/> This checker provides suggested fixes for type errors of the type "undeclared name: <>". It will either insert a new statement, such as: <br/> "<> := " <br/> or a new function declaration, such as: <br/> func <>(inferred parameters) { <pre>panic("implement me!")</pre>} <br/> <br/> Default: `true` |
          | `unmarshal` | report passing non-pointer or non-interface values to unmarshal <br/> The unmarshal analysis reports calls to functions such as json.Unmarshal in which the argument type is not a pointer or an interface. <br/> Default: `true` |
          | `unreachable` | check for unreachable code <br/> The unreachable analyzer finds statements that execution can never reach because they are preceded by an return statement, a call to panic, an infinite loop, or similar constructs. <br/> Default: `true` |
          | `unsafeptr` | check for invalid conversions of uintptr to unsafe.Pointer <br/> The unsafeptr analyzer reports likely incorrect uses of unsafe.Pointer to convert integers to pointers. A conversion from uintptr to unsafe.Pointer is invalid if it implies that there is a uintptr-typed word in memory that holds a pointer value, because that word will be invisible to stack copying and to the garbage collector. <br/> Default: `true` |
          | `unusedparams` | check for unused parameters of functions <br/> The unusedparams analyzer checks functions to see if there are any parameters that are not being used. <br/> To reduce false positives it ignores: - methods - parameters that do not have a name or are underscored - functions in test files - functions with empty bodies or those with just a return stmt <br/> Default: `false` |
          | `unusedresult` | check for unused results of calls to some functions <br/> Some functions like fmt.Errorf return a result and have no side effects, so it is always a mistake to discard the result. This analyzer reports calls to certain functions in which the result of the call is ignored. <br/> The set of functions may be controlled using flags. <br/> Default: `true` |
          +| `unusedvariable` | check for unused variables <br/> The unusedvariable analyzer suggests fixes for unused variables errors. <br/> <br/> Default: `false` |
          | `unusedwrite` | checks for unused writes <br/> The analyzer reports instances of writes to struct fields and arrays that are never read. Specifically, when a struct object or an array is copied, its elements are copied implicitly by the compiler, and any element write to this copy does nothing with the original object. <br/> For example: <br/> <pre>type T struct { x int }<br/>func f(input []T) {<br/> for i, v := range input { // v is a copy<br/> v.x = i // unused write to field x<br/> }<br/>}</pre><br/> Another example is about non-pointer receiver: <br/> <pre>type T struct { x int }<br/>func (t T) f() { // t is a copy<br/> t.x = i // unused write to field x<br/>}</pre><br/> <br/> Default: `false` |
          | `useany` | check for constraints that could be simplified to "any" <br/> Default: `false` |
          ### `ui.diagnostic.annotations`
          @@ -912,6 +898,9 @@

          If company chooses to use its own `godoc.org`, its address can be used as well.

          +Modules matching the GOPRIVATE environment variable will not have
          +documentation links in hover.
          +

          Default: `"pkg.go.dev"`
          ### `ui.documentation.linksInHover`
          @@ -962,6 +951,18 @@


          Default: `"Dynamic"`
          +### `ui.noSemanticNumber`
          +
          +(Experimental) noSemanticNumber turns off the sending of the semantic token 'number'
          +
          +
          +Default: `false`
          +### `ui.noSemanticString`
          +
          +(Experimental) noSemanticString turns off the sending of the semantic token 'string'
          +
          +
          +Default: `false`
          ### `ui.semanticTokens`

          (Experimental) semanticTokens controls whether the LSP server will send
          diff --git a/package.json b/package.json
          index f1f24b0..9898ca0 100644
          --- a/package.json
          +++ b/package.json
          @@ -2049,41 +2049,6 @@
          @@ -2196,6 +2161,11 @@
          "markdownDescription": "Regenerates cgo definitions.",
          "default": true
          },
          + "run_vulncheck_exp": {
          + "type": "boolean",
          + "markdownDescription": "Run vulnerability check (`govulncheck`).",

          + "default": false
          + },
                           "test": {
          "type": "boolean",
          "markdownDescription": "Runs `go test` for a specific set of test or benchmark functions.",
          @@ -2442,6 +2412,11 @@
          "markdownDescription": "check for common mistaken usages of tests and examples\n\nThe tests checker walks Test, Benchmark and Example functions checking\nmalformed names, wrong signatures and examples documenting non-existent\nidentifiers.\n\nPlease see the documentation for package testing in golang.org/pkg/testing\nfor the conventions that are enforced for Tests, Benchmarks, and Examples.",
          "default": true
          },
          + "timeformat": {
          + "type": "boolean",
          + "markdownDescription": "check for calls of (time.Time).Format or time.Parse with 2006-02-01\n\nThe timeformat checker looks for time formats with the 2006-02-01 (yyyy-dd-mm)\nformat. Internationally, \"yyyy-dd-mm\" does not occur in common calendar date\nstandards, and so it is more likely that 2006-01-02 (yyyy-mm-dd) was intended.\n",
          + "default": true
          + },
          "undeclaredname": {
          "type": "boolean",
          "markdownDescription": "suggested fixes for \"undeclared name: <>\"\n\nThis checker provides suggested fixes for type errors of the\ntype \"undeclared name: <>\". It will either insert a new statement,\nsuch as:\n\n\"<> := \"\n\nor a new function declaration, such as:\n\nfunc <>(inferred parameters) {\n\tpanic(\"implement me!\")\n}\n",
          @@ -2472,6 +2447,11 @@
          "markdownDescription": "check for unused results of calls to some functions\n\nSome functions like fmt.Errorf return a result and have no side effects,\nso it is always a mistake to discard the result. This analyzer reports\ncalls to certain functions in which the result of the call is ignored.\n\nThe set of functions may be controlled using flags.",
          "default": true
          },
          + "unusedvariable": {
          + "type": "boolean",
          + "markdownDescription": "check for unused variables\n\nThe unusedvariable analyzer suggests fixes for unused variables errors.\n",

          + "default": false
          + },
                           "unusedwrite": {
          "type": "boolean",
          "markdownDescription": "checks for unused writes\n\nThe analyzer reports instances of writes to struct fields and\narrays that are never read. Specifically, when a struct object\nor an array is copied, its elements are copied implicitly by\nthe compiler, and any element write to this copy does nothing\nwith the original object.\n\nFor example:\n\n\ttype T struct { x int }\n\tfunc f(input []T) {\n\t\tfor i, v := range input { // v is a copy\n\t\t\tv.x = i // unused write to field x\n\t\t}\n\t}\n\nAnother example is about non-pointer receiver:\n\n\ttype T struct { x int }\n\tfunc (t T) f() { // t is a copy\n\t\tt.x = i // unused write to field x\n\t}\n",
          @@ -2551,7 +2531,7 @@
          },
          "ui.documentation.linkTarget": {
          "type": "string",
          - "markdownDescription": "linkTarget controls where documentation links go.\nIt might be one of:\n\n* `\"godoc.org\"`\n* `\"pkg.go.dev\"`\n\nIf company chooses to use its own `godoc.org`, its address can be used as well.\n",
          + "markdownDescription": "linkTarget controls where documentation links go.\nIt might be one of:\n\n* `\"godoc.org\"`\n* `\"pkg.go.dev\"`\n\nIf company chooses to use its own `godoc.org`, its address can be used as well.\n\nModules matching the GOPRIVATE environment variable will not have\ndocumentation links in hover.\n",
          "default": "pkg.go.dev",
          "scope": "resource"
          },
          @@ -2611,6 +2591,18 @@
          "default": "Dynamic",
          "scope": "resource"
          },
          + "ui.noSemanticNumber": {
          + "type": "boolean",
          + "markdownDescription": "(Experimental) noSemanticNumber turns off the sending of the semantic token 'number'\n",
          + "default": false,
          + "scope": "resource"
          + },
          + "ui.noSemanticString": {
          + "type": "boolean",
          + "markdownDescription": "(Experimental) noSemanticString turns off the sending of the semantic token 'string'\n",
          + "default": false,
          + "scope": "resource"
          + },
          "ui.semanticTokens": {
          "type": "boolean",
          "markdownDescription": "(Experimental) semanticTokens controls whether the LSP server will send\nsemantic tokens to the client.\n",
          @@ -2624,6 +2616,41 @@
          +          "markdownDescription": "Enable/disable inlay hints for variable types in range statements:\n```go\n\tfor k/* int*/, v/* string*/ := range []string{} {\n\t\tfmt.Println(k, v)\n\t}\n```",

          + "default": false
          }
          }
          },
          diff --git a/tools/goplssetting/goplssetting.go b/tools/goplssetting/goplssetting.go
          index e78d26c..b300ec1 100644
          +func collectProperties(m map[string][]*OptionJSON) (goplsProperties, goProperties map[string]*Object, err error) {

          var sorted []string
          var containsEmpty bool
          for k := range m {
          @@ -214,9 +209,23 @@
          if containsEmpty {
          sorted = append(sorted, "")
          }
          - properties := map[string]*Object{}
          +	goplsProperties, goProperties = map[string]*Object{}, map[string]*Object{}
          @@ -267,10 +276,10 @@
          if hierarchy != "" {
          key = hierarchy + "." + key
          }
          - properties[key] = obj
          + goplsProperties[key] = obj
          }
          }
          - return properties, nil
          + return goplsProperties, goProperties, nil
          }

          func formatOptionDefault(opt *OptionJSON) interface{} {

          To view, visit change 419120. To unsubscribe, or for help writing mail filters, visit settings.

          Gerrit-Project: vscode-go
          Gerrit-Branch: master
          Gerrit-Change-Id: Ib4d66b1f03b4e6aa0019d6a9094cc172c8dc952a
          Gerrit-Change-Number: 419120
          Gerrit-PatchSet: 5
          Gerrit-Owner: Suzy Mueller <suz...@golang.org>
          Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
          Gerrit-Reviewer: Suzy Mueller <suz...@golang.org>
          Gerrit-Reviewer: kokoro <noreply...@google.com>
          Gerrit-MessageType: merged
          Reply all
          Reply to author
          Forward
          0 new messages