Open misicnenad opened 1 month ago
Hi, I would love to work on this. I however need pointers to where this should be fixed.
Task is yours. Thanks ♥️
The entry point for completion logic is here:
This looks to be ::
-completion, which is computed here:
As you can see, this is basically just a banch of ifs for various AST items.
I guess you simply have to put appropriate filters here:
BTW It would be awesome if you'd also contribute completion E2E tests, as you're touching this. There are none yet, but they should be pretty similar to hover test for example:
https://github.com/starkware-libs/cairo/blob/main/crates/cairo-lang-language-server/tests/e2e/hover.rs https://github.com/starkware-libs/cairo/tree/main/crates/cairo-lang-language-server/tests/test_data/hover
Would you like to make this part? I don't want to enforce this on you. 😃
@Utilitycoder hey, how's it going? Would you like some assistance from my side in this area?
@mkaput I have been sick but slowly getting back to optimum health. I will take a look and let you know If I'd be able to proceed with it.
Bug Report
Cairo version: 2.6.3
Current behavior:
When defining a module with some public members and trying to import said members, a completion dialog appears, but the language server includes non-public members in the dialog. Additionally, the lang. server includes non-members in the dialog (in this case
ShapeGeometry
).Example below:
Trying to import non-public members (and non-members) results in an error of course:
Importing a public member works as expected:
Expected behavior:
The completion dialog should only include actual module members and only those that can actually be imported.
Steps to reproduce:
lib.cairo
in VS Code (ensure Cairo 1.0 extension is installed)use circle::
statementCTRL + Space
)Related code:
Other information:
Related issue: https://github.com/starkware-libs/cairo/issues/5664