DavidAnson / vscode-markdownlint

Markdown linting and style checking for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint
MIT License
894 stars 166 forks source link

Output keeps stealing focus from terminal if dependencies aren't installed #309

Closed Jamesernator closed 7 months ago

Jamesernator commented 7 months ago

Trying to open the terminal when markdownlint doesn't have the required dependencies keeps focusing the output tab:

Screencast from 18-11-23 18:03:14.webm

Yes I can open a terminal outside of VSCode so it's easy to workaround, but I don't see why opening a terminal should trigger markdownlint to steal focus back in the first place.

DavidAnson commented 7 months ago

The tool is trying to call your attention to the fact that the current configuration is broken and linting cannot be performed. The assumption is that you will want to fix or remove that configuration. Is there a reason that's not possible in your scenario?

Jamesernator commented 7 months ago

The assumption is that you will want to fix or remove that configuration. Is there a reason that's not possible in your scenario?

Like I said:

Yes I can open a terminal outside of VSCode so it's easy to workaround,

But this is somewhat annoying as I've hit this problem quite a number of times where I went to make an edit in a project but hadn't npm/yarn/etc installed in the project yet.

Like as a general principle, a plugin that reports errors for one kind of thing shouldn't block me using other features of the editor.

DavidAnson commented 7 months ago

I suppose I could do something to limit the number of times focus is set. But I don't think removing notifications and allowing things to fail silently in the background is what most people want.

Jamesernator commented 7 months ago

But I don't think removing notifications and allowing things to fail silently in the background is what most people want.

Is there any reason not to show actual notifications rather than just stealing focus?

That is what other tools like TypeScript do if there is a warning or such:

Screenshot from 2023-11-18 20-40-45

DavidAnson commented 7 months ago

Notifications have much less room to show information and are often not copyable. Besides, I don't think you'd be happy with a steady stream of notifications, either.

Thinking about this issue last night, I decided it would probably be sufficient to focus the output window once per session - and again on any configuration change. That should alert users to the problem and show them where to get the information they need to diagnose it and help them troubleshoot when they are making fixes - while not getting too much in the way of people who choose to work with broken configuration.