Skip to content

fix error suggestion select if the object is enclosed in paren#177

Open
Onyad wants to merge 1 commit intooxalica:mainfrom
Onyad:fix_select_paren_object
Open

fix error suggestion select if the object is enclosed in paren#177
Onyad wants to merge 1 commit intooxalica:mainfrom
Onyad:fix_select_paren_object

Conversation

@Onyad
Copy link
Contributor

@Onyad Onyad commented Aug 7, 2025

Reproduce

{lib, ...}: let
  fn = a: {
    b = 10;
  };
  u = (fn 10).<CURSOR FOR COMPLETION>;

  a = {
    x = 10;
  };
  b = (a).<CURSOR FOR COMPLETION>;
in {
}

there are no suggestions before the fix, after that there are suggestions

This is because there is no allocation in the crates/ide/src/def/lower.rs for the ast node Parent.

I do not know how best to solve this, so this is just a suggestion, perhaps it would be better to add an allocation for Paren.

@Onyad Onyad changed the title Error suggestion select if the object is enclosed in paren fix rror suggestion select if the object is enclosed in paren Aug 8, 2025
@Onyad Onyad changed the title fix rror suggestion select if the object is enclosed in paren fix error suggestion select if the object is enclosed in paren Aug 8, 2025
@oxalica
Copy link
Owner

oxalica commented Aug 8, 2025

perhaps it would be better to add an allocation for Paren.

Thanks for the finding. Let's do this instead. There should be many other places relying on that every Expr AST node can be looked up.

@oxalica oxalica added C-bug Catagory: bug A-parser Area: syntax parser labels Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-parser Area: syntax parser C-bug Catagory: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants