Skip to content
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: provide builtin types and intrinsics #7

Merged
merged 15 commits into from
Aug 9, 2024
Merged

Conversation

x1unix
Copy link
Contributor

@x1unix x1unix commented Aug 8, 2024

Description

This PR enhances textDocument/completion by providing completions for intrinsic Gno functions such as len and cap and suggestions for primitive types.

Fixes: #6

This list of LSP completions is generated by codegen-builtins tool from /tools/gendata/builtin.go.txt file.
In addition to that, Gno-flavored doc strings are converted to markdown.

Important

Source file extension is intentionally set to .txt to keep it away from go build and test commands.

List of intrinsic functions is taken from here.

Function descriptions are based on Go's from builtin package, except all mentions of channels and goroutines were removed as they aren't supported in Gno.

Updating builtin definitions

  • Edit tools/gendata/builtin.go.txt
  • Run make gen which will runs go generate
  • Commit changes

Demo

Here is a demo from Gno Playground:

image

Builtin functions

image

Primitive types suggestion

@x1unix
Copy link
Contributor Author

x1unix commented Aug 8, 2024

@jeronimoalbi can you please take a look?

@x1unix x1unix self-assigned this Aug 8, 2024
@x1unix x1unix merged commit a2f18c7 into master Aug 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide autocompleiton for builtin symbols
1 participant