mirror of
https://github.com/golang/go
synced 2024-11-18 14:14:46 -07:00
9ac8e33b36
We now rank printf operand candidates according to the corresponding formatting verb. We follow what fmt allows for the most part, but I omitted some things because they are uncommon and would result in many false positives, or didn't seem worth it to support: - We don't prefer fmt.Stringer or error types for "%x" or "%X". - We don't prefer pointers for any verbs except "%p". - We don't prefer recursive application of verbs (e.g. we won't prefer []string for "%s"). I decided against sharing code with the printf analyzer. It was tangled somewhat with go/analysis, and I needed only a very small subset of the format parsing. I tweaked candidate type evaluation to accommodate the printf hints. We now skip expected type of "interface{}" when matching candidate types because it matches everything and would always supersede the coarser object kind checks. Fixes golang/go#40485. Change-Id: I6440702e33d5ec85d701f8be65453044b5dab746 Reviewed-on: https://go-review.googlesource.com/c/tools/+/246699 Run-TryBot: Muir Manders <muir@mnd.rs> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> |
||
---|---|---|
.. | ||
call_hierarchy.go | ||
code_lens.go | ||
command.go | ||
comment_test.go | ||
comment.go | ||
completion_builtin.go | ||
completion_format.go | ||
completion_keywords.go | ||
completion_labels.go | ||
completion_literal.go | ||
completion_printf_test.go | ||
completion_printf.go | ||
completion_snippet.go | ||
completion_statements.go | ||
completion.go | ||
deep_completion_test.go | ||
deep_completion.go | ||
diagnostics.go | ||
extract.go | ||
folding_range.go | ||
format_test.go | ||
format.go | ||
gc_annotations.go | ||
highlight.go | ||
hover.go | ||
identifier_test.go | ||
identifier.go | ||
implementation.go | ||
options.go | ||
references.go | ||
rename_check.go | ||
rename.go | ||
signature_help.go | ||
source_test.go | ||
symbols.go | ||
types_format.go | ||
util.go | ||
view.go | ||
workspace_symbol.go |