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

Verified routes emit diagnostics without file and position #5819

Closed
lukaszsamson opened this issue May 21, 2024 · 0 comments
Closed

Verified routes emit diagnostics without file and position #5819

lukaszsamson opened this issue May 21, 2024 · 0 comments

Comments

@lukaszsamson
Copy link
Contributor

Environment

  • Elixir version (elixir -v):
  • Phoenix version (mix deps): 1.7.12
  • Phoenix liveview version (mix deps): 0.20.14
  • Operating system:

Actual behavior

When mix compile --return-errors is run against a project with broken routes in heex, the warning that gets emitted is incomplete

%Mix.Task.Compiler.Diagnostic{
  file: nil,
  source: nil,
  severity: :warning,
  message: "no route path for My.Web.Router matches \"/foo/\#{assigns.my_id}/bar/\#{event.id}\"",
  position: 0,
  compiler_name: "Elixir",
  span: nil,
  details: nil,
  stacktrace: [
    {My.Web.Components, :my_page, 1,
     [
       file: ~c"lib/my_backend/components/pages/my_page.html.heex",
       line: 165
     ]}
  ]
}

Expected behavior

The emitted warning has file and position. Those fields are used by language servers for rendering diagnostics. Without the exact position or span it is not possible to display the warning where it is. Traversing the stacktrace is a poor and error prone workaround

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

1 participant