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

Fix module completion error after a dot #496

Merged
merged 1 commit into from
Nov 21, 2023
Merged

Conversation

zachallaun
Copy link
Collaborator

I'm having trouble replicating this in a test, but I was getting an error when I tried completing something like:

defmodule Something do
  alias Lexical.|
end

The error was caused by an exception thrown in analysis due to an incorrect case in its reify_alias implementation. The analyzer deals with modules as lists of segments, e.g. [:Foo, :Bar, :Baz], but the macro env requires that they be combined to Foo.Bar.Baz.

@scohen
Copy link
Collaborator

scohen commented Nov 20, 2023

crazy, this works great for me.

@zachallaun
Copy link
Collaborator Author

I think it may be VS Code specific, possibly to do with single-char completions.

@scohen
Copy link
Collaborator

scohen commented Nov 20, 2023

The gift that keeps on giving.

@scohen
Copy link
Collaborator

scohen commented Nov 20, 2023

I'm a little worried about the lack of a unit test. Would it be possible to either

  1. Make a very specific unit test targeting env
  2. Use patch to expose refiy_alias and test that way

@zachallaun zachallaun force-pushed the za-analysis-reify-alias-fix branch from 56c1f4d to 69cab27 Compare November 21, 2023 14:13
@scohen scohen merged commit bc1dfc7 into main Nov 21, 2023
7 checks passed
@scohen scohen deleted the za-analysis-reify-alias-fix branch November 21, 2023 15:49
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.

2 participants