diff options
Diffstat (limited to 'internal/lsp/cache/errors.go')
-rw-r--r-- | internal/lsp/cache/errors.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/lsp/cache/errors.go b/internal/lsp/cache/errors.go index a1aecb35c..80ae5451c 100644 --- a/internal/lsp/cache/errors.go +++ b/internal/lsp/cache/errors.go @@ -123,6 +123,10 @@ func typeErrorDiagnostics(snapshot *snapshot, pkg *pkg, e extendedError) ([]*sou diag.Code = code.String() diag.CodeHref = typesCodeHref(snapshot, code) } + switch code { + case typesinternal.UnusedVar, typesinternal.UnusedImport: + diag.Tags = append(diag.Tags, protocol.Unnecessary) + } for _, secondary := range e.secondaries { _, secondarySpan, err := typeErrorData(snapshot.FileSet(), pkg, secondary) |