Skip to content

When output channel is cleared and new content is written, it is always scrolled to the last line #12257

Closed

Description

  • VSCode Version: 1.6
  • OS Version: all

Steps to Reproduce:

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.

vsc

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.

/cc Isidor Nikolic (@isidorn)

Activity

  1. added
    bug
    on Sep 19, 2016
  2. isidorn commented on Oct 3, 2016

    @isidorn

    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

  3. ArtemGovorov commented on Oct 3, 2016

    @ArtemGovorov
    ContributorAuthor

    Isidor Nikolic (@isidorn) Awesome, thanks for the update, will check it tomorrow.

  4. ArtemGovorov commented on Oct 5, 2016

    @ArtemGovorov
    ContributorAuthor

    Isidor Nikolic (@isidorn) Just tested with Version 1.6.0-insider (1.6.0-insider) 602155bb781f509c7a4ddcd700b57cb9b9f5286d and unfortunately the issue is still present.

  5. isidorn commented on Oct 5, 2016

    @isidorn

    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

  6. ArtemGovorov commented on Oct 11, 2016

    @ArtemGovorov
    ContributorAuthor

    Isidor Nikolic (@isidorn) Just checked in the 1.7 insider and the issue is still there unfortunately. Could you please take a look?

  7. isidorn commented on Oct 26, 2016

    @isidorn

    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.

  8. ArtemGovorov commented on Oct 27, 2016

    @ArtemGovorov
    ContributorAuthor

    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:

    • 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.

    Thoughts? /cc Isidor Nikolic (@isidorn) Johannes Rieken (@jrieken)

  9. isidorn commented on Oct 27, 2016

    @isidorn

    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.

  10. 3 remaining items

  11. ArtemGovorov commented on Oct 27, 2016

    @ArtemGovorov
    ContributorAuthor

    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:

    screen shot 2016-10-28 at 9 29 21 am

    and one without the automatic scrolling:
    screen shot 2016-10-28 at 9 29 00 am

    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.

  12. isidorn commented on Nov 30, 2016

    @isidorn

    Assigning to Johannes Rieken (@jrieken) to decide what is best to be done here

  13. added
    feature-request
    and removed
    bug
    on Dec 13, 2016
  14. ArtemGovorov commented on Jan 11, 2017

    @ArtemGovorov
    ContributorAuthor

    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?

  15. ArtemGovorov commented on Jan 12, 2017

    @ArtemGovorov
    ContributorAuthor
  16. jrieken commented on Jan 13, 2017

    @jrieken
    Contributor

    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

  17. isidorn commented on Apr 11, 2017

    @isidorn

    This has been fixed via Artem Govorov (@ArtemGovorov) PR to add the output scroll lock action. Closing

  18. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions