Skip to content

missing metadata for import of "..." #15

@x1unix

Description

@x1unix

When importing a new package in a Gno file, a following issue occurs:

Image

This issue is often happening after importing ufmt package. Usually this happens if package info or its dependencies is incomplete.

This issue is a heisenbug and can be solved by restarting an LSP server

Here is an LSP log from neovim: lsp.log.zip

Demo

Screen.Recording.2025-01-23.at.00.54.13.mov

Potential Fixes

Here are potential causes:

Missing dependencies

Some Gno packages import Go standard library or symbols which doesn't exist.

To address this, you might need to supply stub packages to satisfy gopls.

Known missing packages which used by Gno stdlib

builtin
encoding/json
fmt
io/fs
os
reflect
unsafe

Some other internal bug

I had problems with gopls's package loader and sometimes introducing a little timeout inside package driver helps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions