amatiasq / vsc-sort-imports

Sort ES6 imports automatically.
ISC License
58 stars 24 forks source link

feat: add output panel for errors instead of toast #51

Closed jquense closed 4 years ago

jquense commented 5 years ago

Should be less annoying, and more like how tools like prettier work. I didn't add a status bar icon b/c that seems like too much noise in the bottom, but that measn this isn't super discoverable

amatiasq commented 5 years ago

Both code and feature looks good, but I'm worried this will make the errors less visible for some people, don't you think?

jquense commented 5 years ago

yeah it's definitely less visible (which is partly the goal). In 99% of cases the "error" the extension encounters is a parsing issue with the file, something that is super common while writing new code. As someone who saves a lot by habit I find it fairly distracting to constantly get toasts telling me the file could not be parsed. In the cases where that is unexpected tho, vscode is usually showing the red squiggles, or I check prettier console.

we could add a status bar item, like prettier, but the concern there is it really hogs a lot of prime real-estate in the editor. Overall my thought was, that while it's definitely more hidden, surfacing issues with the syntax in the active file isn't really the job of sort-imports, its more of a eslint or typechecker concern. I do think it's cool to toast errors that result in something gone wrong with the extension (like a bad configuration) which i think we are still doing

jquense commented 5 years ago

totally open to suggestions tho for more of a middle ground!

amatiasq commented 4 years ago

I'm worried about new users who start using the tool on a file with syntax errors and don't understand why it's not working. I get it's distracting, I felt that too but I think it's important for this to be a notification by default.

Maybe it can be a new option?

jquense commented 4 years ago

For context, most other similar extensions do not use notifications to display this sort of info. both prettier, and eslint reserve notifications for when there is a configuration error, not when linting or formatting fail. If we insist on having some visual indication always visible then i'd prefer the status bar icon, since it's at least unobtrusive

amatiasq commented 4 years ago

Status bar icon sounds good too.