-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
GH-7347: Added scroll-lock to the Output view #7570
Conversation
fdd86b7
to
b71c29b
Compare
The locked behavior feels weird: in VS Code, it just disables auto-scrolling, but you can still manually scroll around. This implementation prevents me from manually scrolling elsewhere. Is this intended? |
9fd843f
to
fec6c49
Compare
fec6c49
to
02067fb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODOs for me. None of them should affect the functional behavior.
93e5264
to
d3d20bf
Compare
Yes. Otherwise, you cannot keep the scroll-bar. |
VS Code does not keep it as well and use only one Monaco editor. I also don't like an idea of having many Monaco editors later. I've seen before in profiling session that |
Yes, but I have not changed that within this PR. |
On master we never render a channel if it is not selected and visible. With this PR whenever the ouput view is attached all channels get constantly rendered making situation much worse. Plus if we switch to Monaco editor it forces us to have many instances instead of only one editor which content gets replaced when a channel is switched. |
d3d20bf
to
657b25c
Compare
@akosyakov, I could not pull in the |
We are going to drop monaco-languageclient then |
What should we do before we drop |
@akosyakov, ping. |
I can create Output commands and invoke them from |
We could align the new commands with the current VS Code |
#7100 It is in plans to work on it next months. cc @svenefftinge @marcdumais-work |
a94e465
to
72fd6c1
Compare
The PR is ready for the review, please see the updated description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, tried what you listed under How To Test
and everything worked.
Thanks for asking! It's intentional. Actually, I do not mind if it's there or not, I won't ever use it, but I wanted to align the context-menu with VS Code: VS Code has it as Comannd Palette..., we call it Find Commands.... I leave the decision to the community. |
I noticed the context menu on MAC seems different than the one in UBUNTU. I have the same as @marechal-p above. I vote to keep the command palette. Note: When I add a new plugins ( vscode-coverage-gutters-2.4.3.vsix) , I noticed that the context menu is modified in VSCode, but the context menu in Theia is not modified. Note2: I think it would be nice also to have in the context menu an entry: "Copy all" to copy all the data from that output channel or "Select all" |
FYI: My screenshot was from VS Code, and not Theia.
👍 Feel free to open a feature request for it.
Sounds great, can you please file a feature request so that we won't forget to implement it. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New issues ( #7911 and #7912 ) added according to the features request
Works fine, tested on UBUNTU 18.04 and Chrome
Thanks @kittaakos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm uncomfortable with many new contribution points introduced to satisfy a single use case. Usually we need at least 3 to generalize something. I added comments with proposals how to simplify new concepts.
72fd6c1
to
928adf4
Compare
|
||
createModel( | ||
resource: Resource, | ||
m2p: MonacoToProtocolConverter, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to pass converters. They can be injected by subclasses. Or we can convert interface to abstract class to replace interface + symbol and inject converters for all subclasses.
return false; | ||
open(uri: URI, options?: OpenerOptions): Promise<OutputWidget> { | ||
return new Promise<OutputWidget>((resolve, reject) => { | ||
if (!OutputUri.is(uri)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not to use async/await
? this method will hang if something goes wrong in openView
or setInptu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, that's a great improvement to the output view!
@kittaakos does it resolves #2702 and #2385 as well? |
928adf4
to
acb7be7
Compare
acb7be7
to
7048b1a
Compare
Thank you all for the review! |
class NoopDragOverDockPanel extends DockPanel { | ||
|
||
constructor(options?: DockPanel.IOptions) { | ||
super(options); | ||
NoopDragOverDockPanel.prototype['_evtDragOver'] = (event: IDragEvent) => { | ||
event.preventDefault(); | ||
event.stopPropagation(); | ||
event.dropAction = 'none'; | ||
}; | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kittaakos, it looks like this code is responsible for #10932. Do you recall the motivation for making the Output view undroppable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking care of this!
it looks like this code is responsible for #10932.
Do you want to have the same behavior as the Problem view? Split the view like this:
other_widget.mp4
It is not possible with the Output view; it's a bug.
The main reason I used a custom panel implementation was to avoid dropping an editor into the panel. Like this:
output.mp4
I hope this helps. Let me know if there is anything I can assist you with fixing this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the screen casts; they help clarify things quite a bit. I didn't realize the Output widget behaved as a panel with each of the channels as a child widget. I think it would be nice if the Output view could allow drops as other widgets do, to either place the new widget on the bottom tabbar or split the bottom pane. Otherwise, it feels like a bug, even though it's deliberate, since it isn't clear to users why the Output widget would be different from other widgets in this respect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like something like this might do the trick:
/**
* Customized `DockPanel` that does not allow dropping widgets into it.
* Intercepts `'p-dragover'` events, and sets the desired drop action to `'none'`.
*/
class NoopDragOverDockPanel extends DockPanel { }
const noop = () => { };
NoopDragOverDockPanel.prototype['_evtDragOver'] = noop;
NoopDragOverDockPanel.prototype['_evtDrop'] = noop;
NoopDragOverDockPanel.prototype['_evtDragLeave'] = noop;
By preventing the Output widget from handling any of those events, we pass them up to the bottom pane dock panel and allow it to handle them. What do you think of that?
What it does
@theia/output
dependency from the@theia/languages
extension,monaco
editor,<no output yet>
when there is no output on the selected channel,monaco.editor.ITextModel
,append
(previously it was supported withappendLine
only),OutputChannel
API with VS Code (via commands), andHow to test
Output: Close Output Channel...
command), refresh the browser, make a memory snapshot, verify that the previously disposed channel is not in the snapshot.Feel free using the interim commands for populating the output channels with some dummy inputs:
API Sample: Post Date.now() to the 'X' channel.
API Sample: Stop Date.now() on 'X' channel.
Closes #7347.
Closes #7008.
Review checklist
Reminder for reviewers