-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/tools/gopls: gopls api-json references "internal/protocol.CodeLensSource" type #68057
Comments
The right place to fix this is in loadOptions in gopls/doc/generate/generate.go, which uses a very simple heuristic to turn the go/types representation of each settings.Option field into JSON-like type names. The complete set of types that it encounters today is given by this grammar:
Notes:
There's definite room for improvement here. Perhaps each setting.Options struct field could provide an optional tag that gives its JSON type for documentation purposes if and only if it is not derivable in the obvious way (i.e. the last four lines of the grammar above). |
Change https://go.dev/cl/593615 mentions this issue: |
Thanks. Re:
What vscode setting generator does is to map this api-json settings to the vscode configuration as explained in https://code.visualstudio.com/api/references/contribution-points#Configuration-property-schema. For
|
Change https://go.dev/cl/593676 mentions this issue: |
…rce from protocol This enum is properly a setting, not a protocol feature. The .md and api.json generator script assumes that all enums are in the settings package, and consequently emitted incorrect names for this type. Generator changes in detail: - remove the package.Load of both "settings" and "protocol", reverting part of an early change. - remove loadAPI special case for "codelenses" not being an enum-keyed map, as it is one. (As a consequence, the enum values appear in api.json in alphabetical, not declaration, order. Also, the title portion of the codelend doc string is no longer discarded.) - add lots of missing commentary. This may seem like a large change at the 11th hour, but note: - the only change to the production code is a renaming; - the effects of the generator changes are entirely confined to settings.md and api.json. Fixes golang/go#68057 Change-Id: I097f0a9b2e34b8f9a3438112b55efb2081b4acb2 Reviewed-on: https://go-review.googlesource.com/c/tools/+/593615 Reviewed-by: Robert Findley <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> (cherry picked from commit 1cd1a4f08f940bc68597469ffb33630f33ef104f) Reviewed-on: https://go-review.googlesource.com/c/tools/+/593676 Auto-Submit: Alan Donovan <[email protected]>
Change https://go.dev/cl/593656 mentions this issue: |
Change https://go.dev/cl/593678 mentions this issue: |
This CL defines a type for the true|false|"gopls" type used by linksInHover, and adds a special case to the doc+api generator to treat it as an enum, so that VS Code will present a better value-chooser UI for it. Also, document the type grammar used in the docs. Updates golang/go#68057 Change-Id: I9e334fbc94dcbdc70657d8e64f67fb807e69cbf8 Reviewed-on: https://go-review.googlesource.com/c/tools/+/593656 Reviewed-by: Robert Findley <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Alan Donovan <[email protected]>
Temporarily map "any" to "boolean" until CL 593656 is released. For golang/go#68057 Change-Id: Id134337269b26b9a9ddb546c63f645996d3c3c83 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/593678 Reviewed-by: Alan Donovan <[email protected]> Reviewed-by: Robert Findley <[email protected]> Commit-Queue: Hyang-Ah Hana Kim <[email protected]> kokoro-CI: kokoro <[email protected]>
Change https://go.dev/cl/616679 mentions this issue: |
gopls v0.17 will have LinksInHover that is the true|false|"gopls" enum type. Previously, we assumed enum type is always string. That is no longer true. Handle this sum-type enum. For golang/go#68057 Change-Id: I9eb2e8376191d997895f8998bfffb2662fbfb92e
gopls v0.17 will have LinksInHover that is the true|false|"gopls" enum type. Previously, we assumed enum type is always string. That is no longer true. Handle this sum-type enum. For golang/go#68057 Change-Id: I9eb2e8376191d997895f8998bfffb2662fbfb92e Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/616679 Commit-Queue: Hyang-Ah Hana Kim <[email protected]> kokoro-CI: kokoro <[email protected]> Reviewed-by: Alan Donovan <[email protected]>
v0.16.0-pre.1 and pre.2
Previously, it was
map[string]bool
, but now we need to check the internal package.It would be nice if we can stick with the basic types like
string
here.Assuming that only vscode-go's tool was affected and we can work around it, I don't think it is a release blocker.
The text was updated successfully, but these errors were encountered: