swiftlang / vscode-swift

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

Parser serialized diagnostic file instead of scraping diagnostics from the build log #670

Open ahoppen opened 7 months ago

ahoppen commented 7 months ago

Instead of scraping the build log for errors/warnings/notes using a regex, it would be cleaner if the VS Code extension would read the diagnostic file emitted by -serialize-diagnostics-path. That way VS Code could also show notes that are attached to errors as their children, instead of displaying them as a top level problem.

adam-fowler commented 7 months ago

When did this go in? I know it was being planned but didn't know what state it was in.

ahoppen commented 7 months ago

What do you mean by “this“? AFAIK the Swift compiler has been able to emit serialized diagnostic files for quite a while, possibly forever.

adam-fowler commented 7 months ago

Ok I didn't know about it. Anyway VSCode expects extensions to be parsing compiler output to produce the output of the problems pane. It doesn't really have an interface for extensions to add problems, well at least not a publicly advertised one. What you are suggesting kinda goes against what VSCode expects of extensions. I'll leave this open , as there might be a way, but can't guarantee anything.

ahoppen commented 7 months ago

Oh, interesting. I would have expected that other languages also used serialized diagnostics to produce structured diagnostics.

daveyc123 commented 4 months ago

This relates to #750 and the coordination between diagnostics that come from parsing the output of a task and the diagnostics that come out of source kit lsp.

award999 commented 4 months ago

happy to grab this one