Skip to content

Commit

Permalink
use compact way of declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroebe committed Mar 30, 2022
1 parent c778e32 commit 15b9727
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions internal/lsp/semantic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 15b9727

Please sign in to comment.