You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
When output channel is cleared and new content is written, it is always scrolled to the last line #12257
Here is the real-world scenario we're having issues with in wallaby. A user is editing the code, we are creating the output where the relevant bit of information (last edited test) is the first displayed in the output. However, because the output is always scrolled to the bottom, the feature is not very usable.
Output channels provide a way for an extension to display some custom output, so I think it's really essential to provide a way to tell an output channel to not scroll to the bottom.
This issue solution had resolved the problem for output channels that are constantly appending to the end of the output. Would be great to have a solution for extensions that are refreshing the output as well.
Perhaps the export function createOutputChannel(name: string): OutputChannel; function could take an options object where one could completely disable the auto-scrolling? Or maybe expose some scrolling functions in the OutputChannel type.
Artem Govorov (@ArtemGovorov) this might be fixed in tomorrow's insiders since we have refactored when we reveal last line in output - more details #12937
Isidor Nikolic (@isidorn) Just tested with Version 1.6.0-insider (1.6.0-insider) 602155bb781f509c7a4ddcd700b57cb9b9f5286d and unfortunately the issue is still present.
Artem Govorov (@ArtemGovorov) my mistake - our insider build is frozen this week, which means only next week those changes will be rolled out. I appologize.
If the issue is not fixed in next week's insider I will investigate more into fixing this
Sorry for the slow reply, I only had time today to investigate into this further. After looking into it it has become clearer that what you are expecting from the output is not actually in the nature of our output channel.
For your use case you should use an editor since you what you want is to preserve the location and show it to the user. With the latest vscode release we are also supporting horizontal editor layout which can also be set from an extension. So you could simply open an additional editor underneath yours and present your content there. Instead of using the output channel - which feels like the wrong thing imho.
Thus closing this as designed as the output is designed to reveal the last line when content is set.
Unfortunately, using an additional editor doesn't sound like a good option for the extension. From the very first release on the VS Code with extensions support we have used an output channel to display the test results.
So in order to migrate to the option of displaying a horizontal editor, we'll need to:
display the editor, in read-only mode, without line numbers and various services (because we don't need an editor, just a way to display an output from the extension), with preserving its scroll state between the content updates,
manage the layout (to fit into the existing layout a user may already have), handle cases when other extensions display something or change the horizontal layout,
provide backwards compatibility and use an output channel in version of VS Code < 1.7,
re-educate our users to use new keyboard shortcuts they got used to (to display an output channel).
Essentially we'll need to re-implement the existing output channel features and the way it looks and feels, to just add that one feature we need: preserving the location between content updates. And, we will not be able to fully make it look like an output channel anyway with the custom layout and not the built-in layout of a standard output channel.
Could you please elaborate why using an output channel for some updatable/renewable output feels wrong? Neither the name nor the the output channel API semantics don't seem to restrict its usage to tailing the end of the output.
While I understand that revealing the last line when content is set, is a reasonable default option, I'm struggling to see how adding an option not to scroll the channel is against the nature of the output channel. The option could be exposed as a method of the OutputChannel API (like supressAutoScrolling()) or passed as an option to the export function createOutputChannel(name: string): OutputChannel;.
Without the option, all extensions (including ourselves) with some updatable/renewable output are forced to re-implement output channel functionality in a horizontal editor layout just to get the option of not autoscrolling to the end, and it doesn't seem to be a good solution for the reasons I have listed above.
We will definetly not change anything for October since we are wrapping up the milestone today, but reopening and assigning to November so we can discuss further then.
Thanks, I had a look into the TextDocumentContentProvider but it doesn't look like it's a good option, because with it we will need to:
manage the layout (to fit into the existing layout a user may already have), handle cases when other extensions display something or change the horizontal layout.
provide backwards compatibility and use an output channel in version of VS Code < 1.7, because there's no horizontal splitting available in earlier versions.
re-educate our users to use new keyboard shortcuts/commands.
I'd say it's not that much the Output Channel API that we really need, but the UI that comes with it. If it was possible to display a document provided by the TextDocumentContentProvider in the bottom panel where the output channels output is displayed, it could be a solution for us. So that we:
have the nice panel available by the View Output shortcut,
don't have to manage the layout, because it's nicely managed for us by VS Code, and can not conflict with other extensions.
So TextDocumentContentProvider is a nice use for those who would like to display a custom output in read-only editor, with line numbers, and have the flexibility to display it anywhere or the flexibility to manage its layout.
My expectations to the Output Channel were based on our previous experience, when we have used similar features when integrating with other IDEs (like IntelliJ/Visual Studio), and they don't restrict the usage of output channels to just tail -f-like usage. For example, using the very similar feature in Visual Studio we are able to provide 2 output channels, one with automatic scrolling:
and one without the automatic scrolling:
I'm wondering if is there any reason to keep the restriction in VS Code? I don't see any semantics in the API to keep the restriction.
Hey guys, adding the support of allowing to create an output channel that doesn't automatically scroll would be an enormous usability improvement in our extension, and that would make many of our user happier.
If you're ok with it, I'm happy to implement it and send the PR. What do you think about a new suppressAutoScrolling method in the OutputChannel?
Makes sense tho I favour a command in the output channel UX that allows a user to stop/resume auto scrolling. That puts the user in control and other places in which we use output will benefit from this. Given that the API is a second step and maybe not even needed anymore
Activity
isidorn commentedon Oct 3, 2016
Artem Govorov (@ArtemGovorov) this might be fixed in tomorrow's insiders since we have refactored when we reveal last line in output - more details #12937
ArtemGovorov commentedon Oct 3, 2016
Isidor Nikolic (@isidorn) Awesome, thanks for the update, will check it tomorrow.
ArtemGovorov commentedon Oct 5, 2016
Isidor Nikolic (@isidorn) Just tested with
Version 1.6.0-insider (1.6.0-insider) 602155bb781f509c7a4ddcd700b57cb9b9f5286dand unfortunately the issue is still present.isidorn commentedon Oct 5, 2016
Artem Govorov (@ArtemGovorov) my mistake - our insider build is frozen this week, which means only next week those changes will be rolled out. I appologize.
If the issue is not fixed in next week's insider I will investigate more into fixing this
ArtemGovorov commentedon Oct 11, 2016
Isidor Nikolic (@isidorn) Just checked in the 1.7 insider and the issue is still there unfortunately. Could you please take a look?
isidorn commentedon Oct 26, 2016
Sorry for the slow reply, I only had time today to investigate into this further. After looking into it it has become clearer that what you are expecting from the output is not actually in the nature of our output channel.
For your use case you should use an editor since you what you want is to preserve the location and show it to the user. With the latest vscode release we are also supporting horizontal editor layout which can also be set from an extension. So you could simply open an additional editor underneath yours and present your content there. Instead of using the output channel - which feels like the wrong thing imho.
Thus closing this as designed as the output is designed to reveal the last line when content is set.
ArtemGovorov commentedon Oct 27, 2016
Thanks for the response.
Unfortunately, using an additional editor doesn't sound like a good option for the extension. From the very first release on the VS Code with extensions support we have used an output channel to display the test results.
So in order to migrate to the option of displaying a horizontal editor, we'll need to:
Essentially we'll need to re-implement the existing output channel features and the way it looks and feels, to just add that one feature we need: preserving the location between content updates. And, we will not be able to fully make it look like an output channel anyway with the custom layout and not the built-in layout of a standard output channel.
Could you please elaborate why using an output channel for some updatable/renewable output feels wrong? Neither the name nor the the output channel API semantics don't seem to restrict its usage to tailing the end of the output.
While I understand that revealing the last line when content is set, is a reasonable default option, I'm struggling to see how adding an option not to scroll the channel is against the nature of the output channel. The option could be exposed as a method of the OutputChannel API (like
supressAutoScrolling()) or passed as an option to theexport function createOutputChannel(name: string): OutputChannel;.Without the option, all extensions (including ourselves) with some updatable/renewable output are forced to re-implement output channel functionality in a horizontal editor layout just to get the option of not autoscrolling to the end, and it doesn't seem to be a good solution for the reasons I have listed above.
Thoughts? /cc Isidor Nikolic (@isidorn) Johannes Rieken (@jrieken)
isidorn commentedon Oct 27, 2016
We will definetly not change anything for October since we are wrapping up the milestone today, but reopening and assigning to November so we can discuss further then.
3 remaining items
ArtemGovorov commentedon Oct 27, 2016
Thanks, I had a look into the
TextDocumentContentProviderbut it doesn't look like it's a good option, because with it we will need to:I'd say it's not that much the Output Channel API that we really need, but the UI that comes with it. If it was possible to display a document provided by the
TextDocumentContentProviderin the bottom panel where the output channels output is displayed, it could be a solution for us. So that we:So
TextDocumentContentProvideris a nice use for those who would like to display a custom output in read-only editor, with line numbers, and have the flexibility to display it anywhere or the flexibility to manage its layout.My expectations to the Output Channel were based on our previous experience, when we have used similar features when integrating with other IDEs (like IntelliJ/Visual Studio), and they don't restrict the usage of output channels to just
tail -f-like usage. For example, using the very similar feature in Visual Studio we are able to provide 2 output channels, one with automatic scrolling:and one without the automatic scrolling:

I'm wondering if is there any reason to keep the restriction in VS Code? I don't see any semantics in the API to keep the restriction.
isidorn commentedon Nov 30, 2016
Assigning to Johannes Rieken (@jrieken) to decide what is best to be done here
ArtemGovorov commentedon Jan 11, 2017
Hey guys, adding the support of allowing to create an output channel that doesn't automatically scroll would be an enormous usability improvement in our extension, and that would make many of our user happier.
If you're ok with it, I'm happy to implement it and send the PR. What do you think about a new
suppressAutoScrollingmethod in theOutputChannel?ArtemGovorov commentedon Jan 12, 2017
// cc Johannes Rieken (@jrieken) ?
jrieken commentedon Jan 13, 2017
Makes sense tho I favour a command in the output channel UX that allows a user to stop/resume auto scrolling. That puts the user in control and other places in which we use output will benefit from this. Given that the API is a second step and maybe not even needed anymore
isidorn commentedon Apr 11, 2017
This has been fixed via Artem Govorov (@ArtemGovorov) PR to add the output scroll lock action. Closing