-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
Sending output to an OutputChannel in a for loop seems to duplicate most of the information #2857
Comments
@havremunken by the last one before that you mean 10.7 (insiders) or 10.6? FYI @dbaeumer |
Sorry about not being more specific - I didn't use the insiders version so previous to me would be 10.6. |
I also encounter this issue on developing my extension mitaki28/vscode-clang#4 (source). Environment
However, it will occur in any environment because it seems to be a bug of Condition
ProblemIf we execute the following let chan = vscode.window.createOutputChannel('Test');
vscode.commands.registerCommand('test.command', () => {
chan.append('1');
chan.append('2');
chan.show();
}); then, an "Output" pane will be opened and it will show not CauseFirstly, I found that
When So the above example works as below: chan.append('1'); // OutputService.getOutput() == '1', queue == ''
// `OutputService` sends '1' immediately because it is first call of `OutputService.append`.
// `OutputEditorInput` does nothing because `OutputEditorInput` have not listen `OutputService` yet.
chan.append('2'); // OutputService.getOutput() == '12', queue == '2'
chan.show();
// `OutputEditorInput` starts listening `OutputService`
// "Output" pane is created
// `OutputEditorInput` shows `OutputService.getOutput()` (== '12')
// `OutputService` sends '2' (after some delay)
// `OutputEditorInput` receives and appends '2', so it shows '122' |
This has nothing to do with tasks. It is either our extensions API that doesn't work correctly or the output channel itself. Starting with Joh as the owner of the extensions API. |
I found another bug caused by the same reason. let chan = vscode.window.createOutputChannel('Test');
vscode.commands.registerCommand('test.command2', () => {
chan.append('1');
chan.append('2');
chan.clear();
chan.show();
}); then, an "Output" pane shows |
HI |
Sorry, I notified these commits by mistake. This issue can be fixed by excluding |
@bpasero did something change there? I quite sure this used to work some time ago? |
@isidorn can you answer? |
This seem to happen when the output panel wasn't visible and a command like above is run. I cannot repo once the output has been visible |
I touched code in that area and can investigate |
@bpasero also please code review |
@isidorn I filed #3896 and #3897 which are not really related to your change. There is also #3609 (comment) which seems to indicate high CPU usage when an extension spams with output. Maybe you could also take a look and experiment a) with lots of spam per millisecond and b) with very large output content (above 10k lines). I noticed today that all of VS Code became unresponsive when having the typescript compile task producing tons of errors. I think the two bugs I opened would help in that case. |
@bpasero thanks! I'll look into the three issues. |
Hi there,
This happens in 10.8, and it also happened in the last one before that.
How to reproduce;
At least on my machine, this correctly finds the expected lines. The console log output is called only once per line.
However, in the OutputChannel, I see something strange. Let us for clarity say that this was the expected output:
Then this would be the actual output:
In other words, it duplicates all the output lines except for the first one.
I created a new test project to reproduce this and it behaved the same way.
The text was updated successfully, but these errors were encountered: