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

Add Swift: Capture VSCode Swift Diagnostic Logs command #830

Closed plemarquand closed 2 weeks ago

plemarquand commented 1 month ago

Adds a new command that users can use to help generate bug reports for the extension itself. The Capture VSCode Swift Diagnostic Logs command will create a new folder in a temporary directory that contains:

Users can copy the folder path or, if they're on macOS, open it in Finder. From there they can zip and attach these files to a GitHub issue. We'll want to update the New Issue Template with instructions on how to capture and attach these logs.

Fixes #842

adam-fowler commented 1 month ago

I have virtually never needed the diagnostics in the problems page when someone is submitting an issue. Things that are useful are swift log (which already includes swift version and paths), sourcekit-lsp log, user settings.

plemarquand commented 4 weeks ago

@adam-fowler I've added sourcekit-lsp logs and user settings to the diagnostics. Sourcekit-lsp logs will only be captured if the user has the trace level turned on in their settings.

plemarquand commented 3 weeks ago

@ahoppen it looks like it should be pretty straightforward to watch the work done progress events. However, there is only title and message on the work progress messages, meaning I'd have to check if title === 'SourceKit-LSP: Restoring functionality', which seems brittle. I guess we can use it if we can guarantee that string wont change

ahoppen commented 3 weeks ago

I can totally add an ID for this to the work done progress that we can check for. Just wanted to verify that it’s possible on the VS Code side before I extend LSP. Let’s do this in a follow-up PR.

plemarquand commented 2 weeks ago

@swift-server-bot test this please