From 15b9727326dc4ec7c48416a41b2cb42416d4e7a4 Mon Sep 17 00:00:00 2001 From: hiroebe Date: Thu, 31 Mar 2022 01:51:57 +0900 Subject: [PATCH] use compact way of declaration --- internal/lsp/semantic.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/internal/lsp/semantic.go b/internal/lsp/semantic.go index ab63a4bf318..329b76e63f0 100644 --- a/internal/lsp/semantic.go +++ b/internal/lsp/semantic.go @@ -175,7 +175,6 @@ const ( ) func (e *encoded) token(start token.Pos, leng int, typ tokenType, mods []string) { - if !start.IsValid() { // This is not worth reporting return @@ -274,7 +273,6 @@ func (e *encoded) srcLine(x ast.Node) string { } end := start for ; end < len(e.pgf.Src) && e.pgf.Src[end] != '\n'; end++ { - } ans := e.pgf.Src[start:end] return string(ans) @@ -543,7 +541,7 @@ func (e *encoded) ident(x *ast.Ident) { func isSignature(use types.Object) bool { if true { - return false //PJW: fix after generics seem ok + return false // PJW: fix after generics seem ok } if _, ok := use.(*types.Var); !ok { return false @@ -828,10 +826,8 @@ func (e *encoded) Data() []uint32 { // each semantic token needs five values // (see Integer Encoding for Tokens in the LSP spec) x := make([]uint32, 5*len(e.items)) - var ( - j int - last semItem - ) + var j int + var last semItem for i := 0; i < len(e.items); i++ { typ, ok := typeMap[e.items[i].typeStr] if !ok {