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

Improve errors on undefined variables. #22

Open
NduatiK opened this issue Oct 31, 2023 · 2 comments
Open

Improve errors on undefined variables. #22

NduatiK opened this issue Oct 31, 2023 · 2 comments
Assignees

Comments

@NduatiK
Copy link
Contributor

NduatiK commented Oct 31, 2023

This will help with better Elixir errors:

When annotations is false, we get no line number:
image

Annotations: true
image

@bcardarella
Copy link
Contributor

@NduatiK is this still a valid issue?

@NduatiK
Copy link
Contributor Author

NduatiK commented Jan 26, 2024

I believe so, but it is now related to #50. If we reference an undefined variable in EEx we get the following:

  ~SHEET"""
  "color-number-" <> num do
    rule-1
    rule-2<%= number %>
  end
  ...
    error: undefined variable "number"2use LiveViewNative.Stylesheet, :mock^^^^^^
    │
    └─ test/support/mock_sheet.ex:2:11: MockSheet.class/2

The error does not point us to the specific line with an undefined variable.

Same thing with RULES:

  def class("color-blue", target: :watch) do
    ~RULES"""
    rule-2<%= number %>
    """
  end
    error: undefined variable "number"1defmodule MockSheet do^^^^^^
    │
    └─ test/support/mock_sheet.ex:1:11: MockSheet.class/2

@NduatiK NduatiK changed the title Reattempt parsing with annotations: true on failure Improve errors on undefined variables. Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants