Skip to content
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

gopls: add maxUnimportedPackageNames option that makes the number of completion candidates for unimported packages configurable #442

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

110y
Copy link
Contributor

@110y 110y commented Jun 25, 2023

…f completion candidates for unimported packages configurable
@@ -101,7 +101,9 @@ func genCase(method string, param, result *Type, dir string) {
nm = "ParamConfiguration" // gopls compatibility
}
fmt.Fprintf(out, "\t\tvar params %s\n", nm)
fmt.Fprintf(out, "\t\tif err := json.Unmarshal(r.Params(), &params); err != nil {\n")
fmt.Fprintf(out, "\t\tdecoder := json.NewDecoder(bytes.NewReader(r.Params()))\n")
fmt.Fprintf(out, "\t\tdecoder.UseNumber()\n")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed because the default json.Unmarshal treats a number as a float type.

@gopherbot
Copy link
Contributor

This PR (HEAD: d39db52) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/tools/+/505995 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants