Skip to content

Commit

Permalink
test: address local_struct_novar case
Browse files Browse the repository at this point in the history
  • Loading branch information
tbruyelle committed Aug 14, 2024
1 parent 0fefd8e commit bc2dc95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
skip # for now and maybe forever
# Init phase
lsp initialize input/initialize.json
lsp initialized input/initialized.json
Expand Down
7 changes: 7 additions & 0 deletions internal/handler/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ func (h *handler) handleTextDocumentCompletion(ctx context.Context, reply jsonrp
for _, n := range nodes {
var syms []gno.Symbol
switch n := n.(type) {
case *ast.Ident:
// TODO check if it works when multiple selectors
syms = symbolFinder{h.currentPkg.Symbols}.find([]string{n.Name})

case *ast.BlockStmt:
// Check if selectors[0] has been assigned here
for _, t := range n.List {
Expand Down Expand Up @@ -88,6 +92,9 @@ func (h *handler) handleTextDocumentCompletion(ctx context.Context, reply jsonrp

case *ast.CallExpr:
// this a call, find return type
// TODO try to replace selectors with the func name without the ()
// so we dont need to remove them in symbolFinder
// See if it works with multiple selectors.
syms = symbolFinder{h.currentPkg.Symbols}.find(selectors)
}

Expand Down

0 comments on commit bc2dc95

Please sign in to comment.