swiftlang / vscode-swift

Visual Studio Code Extension for Swift
https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang
Apache License 2.0
708 stars 47 forks source link

Relaunching the LSP Server doesn't clean up the output sections #839

Closed nmggithub closed 4 weeks ago

nmggithub commented 1 month ago

Describe the bug I am working on a complex Swift package, and I sometimes need to relaunch the LSP in order to see changes I make propagate. Doing so, however, seems to add an entry to the Output section in VSCode every time.

To Reproduce Steps to reproduce the behavior:

  1. Go to the Output tab in the bottom panel in VSCode
  2. Open the dropdown of output sections
  3. Observe a single entry of "Swift" and a single entry of "SourceKit Language Server"
  4. Press Command-Shift-P and find the "Swift: Restart LSP Server" option and select it
  5. Go back to the dropdown and observe a second entry of "SourceKit Language Server"
  6. Repeat step 4 and observe a new entry each time.

Expected behavior Restarting the LSP server should not add an entry each time, or, at the very least, these entries should be distinguished from each other.

Environment

adam-fowler commented 4 weeks ago

I think this is probably a bug with VSCode, I don't control the display of this view. I'll have a look to see if there is anyway I can clear this. Hopefully with Swift 6 you won't need to restart the server so much. There have been many improvements to SourceKit-LSP which will become available then.

plemarquand commented 4 weeks ago

@adam-fowler I had some luck here disposing the old client's output channel on a restart in #841. This removes the entry from the output list.