-
Notifications
You must be signed in to change notification settings - Fork 388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add vm/qdoc with function comments #3459
base: master
Are you sure you want to change the base?
Conversation
🛠 PR Checks Summary🔴 Changes to 'docs' folder must be reviewed/authored by at least one devrel and one tech-staff Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
c2538d6
to
b295454
Compare
Signed-off-by: Jeff Thompson <[email protected]>
fc953be
to
a2a8856
Compare
@@ -843,6 +844,31 @@ func (vm *VMKeeper) QueryFile(ctx sdk.Context, filepath string) (res string, err | |||
} | |||
} | |||
|
|||
var rePkgPathAndSymbol = regexp.MustCompile(`^(.+)\.([a-zA-Z0-9_]+)$`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var rePkgPathAndSymbol = regexp.MustCompile(`^(.+)\.([a-zA-Z0-9_]+)$`) | |
var rePkgPathAndSymbol = regexp.MustCompile(`^(.+)(:?\.([a-zA-Z0-9_]+))?$`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @thehowl . I see what you're getting at. To match the input "gno.land/r/demo/boards.CreateRepost", we want the first group to be "gno.land/r/demo/boards" and the second group to be "CreateRepost" (or empty if the input doesn't have ".CreateRepost"). Instead, it just lets the second group be optional (empty) and puts the entire input into the first group. I'll try some other variations.
type JSONDocumentation struct {
PkgPath string `json:"pkg_path"`
PackageLine string `json:...` // package io // import "io"
PackageDoc string // markdown of top-level package documentation
// https://pkg.go.dev/go/doc#Package.Markdown to render markdown
// These match each of the sections in a pkg.go.dev package documentationj
Values []JSONValue // constants and variables declared
Funcs []JSONFunc // ...
Types []JSONType // ...
}
type JSONFunc struct {
Name string
Signature string
Doc string // markdown
} cc @alexiscolin @Kouteki to draft an idea for what we want for the frontend. Ideally, we'd base it off a go package documentation (like |
Signed-off-by: Jeff Thompson <[email protected]>
a2a8856
to
8da68ae
Compare
Addresses #522 (comment)
by adding a query for
vm/qdoc
that uses a similar code path togno doc
which includes comments.For example,
gnokey query vm/qdoc -data "gno.land/r/demo/boards.CreateRepost" -remote tcp://127.0.0.1:26657
returnsAnd
gnokey query vm/qdoc -data "gno.land/r/demo/boards.Post" -remote tcp://127.0.0.1:26657
returns