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

LSP doesn't hide @private/@local/@test functions + leaks function arguments in suggestions #93

Open
alexveden opened this issue Jan 4, 2025 · 1 comment

Comments

@alexveden
Copy link

Describe the bug
Peek 2025-01-04 17-05

  1. add_priv / add_local - appear in suggestions
  2. a / b2 are the function arguments and shouldn't be displayed
  3. test_add2 is a @test method I think there is no value to suggest it
  4. sub() is not shown because of doc string before it, when I remove it works

Minimal code

module foo;
import std::os;


fn int add(int a, int b2){
    assert(b2 != 7);
    return a + b2;
}

fn int add_priv(int a, int bbb) @private{
    return a + bbb;
}

fn int add_local(int a, int ccc) @local{
    return a + ccc;
}

fn void test_add2() @test {
    add(34, 4);
    assert(17 == add(2,3));
}

<*
This is doc, preventing
*>
fn int sub(int a, int b){
    return a - b;
}

Expected
foo:: suggestions list should contain only add and sub functions.

p.s. sub issue with docstring may also be related to #91

@pherrymason
Copy link
Owner

Good suggestions, will review them

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

No branches or pull requests

2 participants