mirror of https://github.com/golang/go.git
internal/lsp: use camel case for inlay hint config fields
To properly format these field names in the vscode config ui these fields should be camel case. Change-Id: I3b8b8fb6371172ecb464710f7d91b9fc67e0ed42 Reviewed-on: https://go-review.googlesource.com/c/tools/+/413684 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Jamal Carvalho <jamal@golang.org> Reviewed-by: Suzy Mueller <suzmue@golang.org> gopls-CI: kokoro <noreply+kokoro@google.com>
This commit is contained in:
parent
2994e99415
commit
60ca6366e6
|
|
@ -3,23 +3,23 @@
|
|||
This document describes the inlay hints that `gopls` uses inside the editor.
|
||||
|
||||
<!-- BEGIN Hints: DO NOT MANUALLY EDIT THIS SECTION -->
|
||||
## **assign_variable_types**
|
||||
## **assignVariableTypes**
|
||||
|
||||
Enable/disable inlay hints for variable types in assign statements:
|
||||
|
||||
i/* int/*, j/* int/* := 0, len(r)-1
|
||||
|
||||
**Disabled by default. Enable it by setting `"hints": {"assign_variable_types": true}`.**
|
||||
**Disabled by default. Enable it by setting `"hints": {"assignVariableTypes": true}`.**
|
||||
|
||||
## **composite_literal_fields**
|
||||
## **compositeLiteralFields**
|
||||
|
||||
Enable/disable inlay hints for composite literal field names:
|
||||
|
||||
{in: "Hello, world", want: "dlrow ,olleH"}
|
||||
|
||||
**Disabled by default. Enable it by setting `"hints": {"composite_literal_fields": true}`.**
|
||||
**Disabled by default. Enable it by setting `"hints": {"compositeLiteralFields": true}`.**
|
||||
|
||||
## **composite_literal_types**
|
||||
## **compositeLiteralTypes**
|
||||
|
||||
Enable/disable inlay hints for composite literal types:
|
||||
|
||||
|
|
@ -29,9 +29,9 @@ Enable/disable inlay hints for composite literal types:
|
|||
/*struct{ in string; want string }*/{"Hello, world", "dlrow ,olleH"},
|
||||
}
|
||||
|
||||
**Disabled by default. Enable it by setting `"hints": {"composite_literal_types": true}`.**
|
||||
**Disabled by default. Enable it by setting `"hints": {"compositeLiteralTypes": true}`.**
|
||||
|
||||
## **constant_values**
|
||||
## **constantValues**
|
||||
|
||||
Enable/disable inlay hints for constant values:
|
||||
|
||||
|
|
@ -42,25 +42,25 @@ Enable/disable inlay hints for constant values:
|
|||
KindErrorf/* = 3*/
|
||||
)
|
||||
|
||||
**Disabled by default. Enable it by setting `"hints": {"constant_values": true}`.**
|
||||
**Disabled by default. Enable it by setting `"hints": {"constantValues": true}`.**
|
||||
|
||||
## **function_type_parameters**
|
||||
## **functionTypeParameters**
|
||||
|
||||
Enable/disable inlay hints for implicit type parameters on generic functions:
|
||||
|
||||
myFoo/*[int, string]*/(1, "hello")
|
||||
|
||||
**Disabled by default. Enable it by setting `"hints": {"function_type_parameters": true}`.**
|
||||
**Disabled by default. Enable it by setting `"hints": {"functionTypeParameters": true}`.**
|
||||
|
||||
## **parameter_names**
|
||||
## **parameterNames**
|
||||
|
||||
Enable/disable inlay hints for parameter names:
|
||||
|
||||
parseInt(/* str: */ "123", /* radix: */ 8)
|
||||
|
||||
**Disabled by default. Enable it by setting `"hints": {"parameter_names": true}`.**
|
||||
**Disabled by default. Enable it by setting `"hints": {"parameterNames": true}`.**
|
||||
|
||||
## **range_variable_types**
|
||||
## **rangeVariableTypes**
|
||||
|
||||
Enable/disable inlay hints for variable types in range statements:
|
||||
|
||||
|
|
@ -68,6 +68,6 @@ Enable/disable inlay hints for variable types in range statements:
|
|||
fmt.Println(k, v)
|
||||
}
|
||||
|
||||
**Disabled by default. Enable it by setting `"hints": {"range_variable_types": true}`.**
|
||||
**Disabled by default. Enable it by setting `"hints": {"rangeVariableTypes": true}`.**
|
||||
|
||||
<!-- END Hints: DO NOT MANUALLY EDIT THIS SECTION -->
|
||||
|
|
|
|||
|
|
@ -511,37 +511,37 @@ var GeneratedAPIJSON = &APIJSON{
|
|||
Doc: "hints specify inlay hints that users want to see.\nA full list of hints that gopls uses can be found\n[here](https://github.com/golang/tools/blob/master/gopls/doc/inlayHints.md).\n",
|
||||
EnumKeys: EnumKeys{Keys: []EnumKey{
|
||||
{
|
||||
Name: "\"assign_variable_types\"",
|
||||
Name: "\"assignVariableTypes\"",
|
||||
Doc: "Enable/disable inlay hints for variable types in assign statements:\n\n\ti/* int/*, j/* int/* := 0, len(r)-1",
|
||||
Default: "false",
|
||||
},
|
||||
{
|
||||
Name: "\"composite_literal_fields\"",
|
||||
Name: "\"compositeLiteralFields\"",
|
||||
Doc: "Enable/disable inlay hints for composite literal field names:\n\n\t{in: \"Hello, world\", want: \"dlrow ,olleH\"}",
|
||||
Default: "false",
|
||||
},
|
||||
{
|
||||
Name: "\"composite_literal_types\"",
|
||||
Name: "\"compositeLiteralTypes\"",
|
||||
Doc: "Enable/disable inlay hints for composite literal types:\n\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}",
|
||||
Default: "false",
|
||||
},
|
||||
{
|
||||
Name: "\"constant_values\"",
|
||||
Name: "\"constantValues\"",
|
||||
Doc: "Enable/disable inlay hints for constant values:\n\n\tconst (\n\t\tKindNone Kind = iota/* = 0*/\n\t\tKindPrint/* = 1*/\n\t\tKindPrintf/* = 2*/\n\t\tKindErrorf/* = 3*/\n\t)",
|
||||
Default: "false",
|
||||
},
|
||||
{
|
||||
Name: "\"function_type_parameters\"",
|
||||
Name: "\"functionTypeParameters\"",
|
||||
Doc: "Enable/disable inlay hints for implicit type parameters on generic functions:\n\n\tmyFoo/*[int, string]*/(1, \"hello\")",
|
||||
Default: "false",
|
||||
},
|
||||
{
|
||||
Name: "\"parameter_names\"",
|
||||
Name: "\"parameterNames\"",
|
||||
Doc: "Enable/disable inlay hints for parameter names:\n\n\tparseInt(/* str: */ \"123\", /* radix: */ 8)",
|
||||
Default: "false",
|
||||
},
|
||||
{
|
||||
Name: "\"range_variable_types\"",
|
||||
Name: "\"rangeVariableTypes\"",
|
||||
Doc: "Enable/disable inlay hints for variable types in range statements:\n\n\tfor k/* int*/, v/* string/* := range []string{} {\n\t\tfmt.Println(k, v)\n\t}",
|
||||
Default: "false",
|
||||
},
|
||||
|
|
@ -1026,31 +1026,31 @@ var GeneratedAPIJSON = &APIJSON{
|
|||
},
|
||||
Hints: []*HintJSON{
|
||||
{
|
||||
Name: "assign_variable_types",
|
||||
Name: "assignVariableTypes",
|
||||
Doc: "Enable/disable inlay hints for variable types in assign statements:\n\n\ti/* int/*, j/* int/* := 0, len(r)-1",
|
||||
},
|
||||
{
|
||||
Name: "composite_literal_fields",
|
||||
Name: "compositeLiteralFields",
|
||||
Doc: "Enable/disable inlay hints for composite literal field names:\n\n\t{in: \"Hello, world\", want: \"dlrow ,olleH\"}",
|
||||
},
|
||||
{
|
||||
Name: "composite_literal_types",
|
||||
Name: "compositeLiteralTypes",
|
||||
Doc: "Enable/disable inlay hints for composite literal types:\n\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}",
|
||||
},
|
||||
{
|
||||
Name: "constant_values",
|
||||
Name: "constantValues",
|
||||
Doc: "Enable/disable inlay hints for constant values:\n\n\tconst (\n\t\tKindNone Kind = iota/* = 0*/\n\t\tKindPrint/* = 1*/\n\t\tKindPrintf/* = 2*/\n\t\tKindErrorf/* = 3*/\n\t)",
|
||||
},
|
||||
{
|
||||
Name: "function_type_parameters",
|
||||
Name: "functionTypeParameters",
|
||||
Doc: "Enable/disable inlay hints for implicit type parameters on generic functions:\n\n\tmyFoo/*[int, string]*/(1, \"hello\")",
|
||||
},
|
||||
{
|
||||
Name: "parameter_names",
|
||||
Name: "parameterNames",
|
||||
Doc: "Enable/disable inlay hints for parameter names:\n\n\tparseInt(/* str: */ \"123\", /* radix: */ 8)",
|
||||
},
|
||||
{
|
||||
Name: "range_variable_types",
|
||||
Name: "rangeVariableTypes",
|
||||
Doc: "Enable/disable inlay hints for variable types in range statements:\n\n\tfor k/* int*/, v/* string/* := range []string{} {\n\t\tfmt.Println(k, v)\n\t}",
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -32,13 +32,13 @@ type Hint struct {
|
|||
}
|
||||
|
||||
const (
|
||||
ParameterNames = "parameter_names"
|
||||
AssignVariableTypes = "assign_variable_types"
|
||||
ConstantValues = "constant_values"
|
||||
RangeVariableTypes = "range_variable_types"
|
||||
CompositeLiteralTypes = "composite_literal_types"
|
||||
CompositeLiteralFieldNames = "composite_literal_fields"
|
||||
FunctionTypeParameters = "function_type_parameters"
|
||||
ParameterNames = "parameterNames"
|
||||
AssignVariableTypes = "assignVariableTypes"
|
||||
ConstantValues = "constantValues"
|
||||
RangeVariableTypes = "rangeVariableTypes"
|
||||
CompositeLiteralTypes = "compositeLiteralTypes"
|
||||
CompositeLiteralFieldNames = "compositeLiteralFields"
|
||||
FunctionTypeParameters = "functionTypeParameters"
|
||||
)
|
||||
|
||||
var AllInlayHints = map[string]*Hint{
|
||||
|
|
|
|||
Loading…
Reference in New Issue