Skip to content
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

bug: If logOutputChannel is created again after being disposed, it will disappear #214048

Closed
xiyaowong opened this issue Jun 1, 2024 · 2 comments · Fixed by #225709
Closed

bug: If logOutputChannel is created again after being disposed, it will disappear #214048

xiyaowong opened this issue Jun 1, 2024 · 2 comments · Fixed by #225709
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders output Output channel system issues verified Verification succeeded
Milestone

Comments

@xiyaowong
Copy link

Does this issue occur when all extensions are disabled?: Yes/No

Version: 1.90.0-insider
Commit: ca688da
Date: 2024-05-31T01:05:41.342Z
Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Code-Insiders/1.90.0-insider Chrome/122.0.6261.156 Electron/29.4.0 Safari/537.36

Steps to Reproduce:

extension.js

import { window } from 'vscode'

export function activate() {
  const log = window.createOutputChannel('test-log-channel', { log: true })
  setTimeout(() => {
    log.dispose()
    window.createOutputChannel('test-log-channel', { log: true })
  }, 1000)
}

There is no test-log-channel in the output panel.

@vscodenpa vscodenpa added the stale Issues that have not been triaged in an appropriate amount of time label Jun 8, 2024
@connor4312 connor4312 assigned sandy081 and unassigned connor4312 Jun 8, 2024
@vscodenpa vscodenpa removed triage-needed stale Issues that have not been triaged in an appropriate amount of time labels Jun 8, 2024
@sandy081 sandy081 added bug Issue identified by VS Code Team member as probable bug output Output channel system issues labels Jun 17, 2024
@sandy081 sandy081 added this to the June 2024 milestone Jun 17, 2024
@sandy081 sandy081 modified the milestones: June 2024, July 2024 Jun 25, 2024
@sandy081 sandy081 modified the milestones: July 2024, August 2024 Jul 24, 2024
@c3danielxu
Copy link

Thanks for reporting this @xiyaowong, I have the exact same issue. In the meantime I have a workaround:

import { window } from 'vscode'

export function activate() {
  const log = window.createOutputChannel('test-log-channel', { log: true })
  setTimeout(() => {
    // log.dispose()
    window.createOutputChannel('test-log-channel', { log: true })
    window.createOutputChannel('test-log-channel', { log: true })
  }, 1000)
}

I was surprised this does not throw, usually if you create something that was not previously disposed, it will throw an error like "command was already registered" or "notebook controller already exists". I am currently commenting out my dispose() line in my extension. It's not ideal though.

@jeanp413
Copy link
Contributor

PR fixing it #225709

@sandy081 sandy081 modified the milestones: August 2024, September 2024 Aug 26, 2024
@sandy081 sandy081 modified the milestones: September 2024, October 2024 Sep 23, 2024
sandy081 added a commit that referenced this issue Sep 27, 2024
…l disappear (#225709)

Fix #214048

Co-authored-by: Sandeep Somavarapu <sasomava@microsoft.com>
@vs-code-engineering vs-code-engineering bot added the unreleased Patch has not yet been released in VS Code Insiders label Sep 27, 2024
sandy081 added a commit that referenced this issue Sep 27, 2024
sandy081 added a commit that referenced this issue Sep 27, 2024
@vs-code-engineering vs-code-engineering bot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Oct 3, 2024
@connor4312 connor4312 added the verified Verification succeeded label Oct 23, 2024
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Nov 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders output Output channel system issues verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants