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

Hover does not show default arguments #81

Open
Caleb-o opened this issue Sep 25, 2024 · 1 comment
Open

Hover does not show default arguments #81

Caleb-o opened this issue Sep 25, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Caleb-o
Copy link

Caleb-o commented Sep 25, 2024

Describe the bug
C3 has default function arguments, which seem mostly in cases of allocation based functions. Currently hover does not show what those arguments are.

To Reproduce

module myproject;

import std::io;

fn void using_default(int foo, bool bar = false) {
  io::printfn("foo %s, bar %s", foo, bar);
}

fn void main() {
  using_default(10);
  using_default(20, true);
}

Collections example:

import std::io;
import std::collections::map;

def IntMap = map::Map(<String, int>);

fn void main() {
  IntMap imap = map::new(<String, int>)();
  defer imap.free();

  imap.set("Hello", 100);
  io::printfn("hello = %s", imap.get("Hello")!!);
}

Expected behavior
Show default arguments

Screenshots
image
image
image

Desktop (please complete the following information):

  • OS: Arch Linux
  • Editor: VS Code
  • Version: main - 2bb88ed
@pherrymason pherrymason added the enhancement New feature or request label Sep 25, 2024
@pherrymason
Copy link
Owner

Notes: Current structure is not parsing default values assigned to arguments.
Indexable arguments should be able to accomodate those references. Maybe a simple string would suffice?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants