lsp_test.go:535: error converting command "gopls.fill_struct" to edits: error calling command.SuggestedFix: failed to run second format on:
got err: 2:13: expected 1 expression (and 2 more errors)
My question: why does format.Source blow up on this code? And, what does expected 1 expression mean - isn't what I passed in an expression ? And, what are the other 2 errors?
1: I'm not particularly well versed on the nouns that comprise a programming language - sorry!
The text was updated successfully, but these errors were encountered:
You can think of an expression here as any AST node that implements ast.Expr. I often use http://goast.yuroyoro.net/ to inspect the Go AST and understand it better. In this case, you've written an ast.CompositeLit without the Type field before the curly brace (Lbrace), so the expression does not parse.