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

Cannot place debugger breakpoint on an assignment #234

Closed
axelson opened this issue May 6, 2020 · 2 comments
Closed

Cannot place debugger breakpoint on an assignment #234

axelson opened this issue May 6, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@axelson
Copy link
Member

axelson commented May 6, 2020

Debugging currently does not work, most likely due to an ElixirSense change. This gist has some details:

https://gist.github.com/Ajwah/4dee98bbb1e0c9257bb52dcd6c6802e2#file-gistfile1-txt

The error Could not determine module at line is received when debugging.

It's seems likely that this broke from the ElixirSense update in #202

@axelson axelson pinned this issue May 6, 2020
@axelson axelson unpinned this issue May 11, 2020
@axelson axelson changed the title Debugging does not work Cannot place debugger breakpoint on an assignment May 11, 2020
@axelson
Copy link
Member Author

axelson commented May 11, 2020

Placing a debugger breakpoint on an assignment currently results in the breakpoint not being hit and the message "Could not determine module at line" being returned. I've unpinned this issue because it's impact radius is not as far-reaching as I initially thought.

@lukaszsamson
Copy link
Collaborator

lukaszsamson commented Jul 7, 2023

The code from the gist is no longer accessible.

With recent changes in elixir_sense this should not be a problem anymore.
To make it more resilient we can fallback to guessing the module via

:code.all_loaded()
|> Enum.filter(fn {atom, _} -> String.starts_with?(Atom.to_string(atom), "Elixir.") end)
|> Enum.group_by(fn
  {module, path} -> Path.expand(to_string(module.module_info(:compile)[:source]))
end, fn {module, _path} -> module end)

Worst case it will return a list of modules and we may set breakpoints in every one of them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants