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

Feature: Line Numbers in Console Logs #635

Open
2 tasks
iahmedgamal opened this issue Sep 26, 2024 · 1 comment
Open
2 tasks

Feature: Line Numbers in Console Logs #635

iahmedgamal opened this issue Sep 26, 2024 · 1 comment

Comments

@iahmedgamal
Copy link

iahmedgamal commented Sep 26, 2024

Type of feature

✨ Feature

Current behavior

The current behavior logs statements without displaying the number of each statement.

Screenshot

image

Suggested feature

Add line numbers to console outputs (e.g., console.log()).

Screenshot

clg line number

Benefits:

  • Faster debugging
  • Easier log tracing in large projects

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Contributing Docs

  • I agree to follow this project's Contribution Docs
@hatemhosny
Copy link
Collaborator

Thank you @iahmedgamal

This is indeed useful and achievable.

For JS it can be achieved without much effort.
demo: https://livecodes.io/?x=id/y6yiqh89xgc

However, line numbers will not be accurate for transformed code (e.g. TS, JSX, etc) unless we start providing source maps for compiled code (which is already planned).

So, I will keep this open for now till we provide source maps for compiled code and then we can provide line numbers for console logs/errors etc.

Thanks again for the suggestion.

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

2 participants