vscode-swift
vscode-swift copied to clipboard
Report errors in Package.swift in problems view
If swift package describe returns errors we should report these in the problems view
This could be resolved by #25 which posts errors created by the resolve operation
This is problematic as swift package resolve does not return errors in a standard format. We cannot extract the file name for the Package.swift from the error given it only includes the folder the Package.swift is in
@adam-fowler can you tell us more about the kind of structured information you would want? maybe that is something we can add / change in SwiftPM
cc @abertelrud
@adam-fowler can you tell us more about the kind of structured information you would want? maybe that is something we can add / change in SwiftPM
cc @abertelrud
Most error strings are of the format.
${filename}:${linenumber}:${column}: [error/warning]: ${message}
This is the kind of error a problem matcher is expecting. It uses regular expressions to extract all the details it needs. Syntax errors in a Package.swift produce something similar.
If you have something like a version clash or bad dependency in a Package.swift you get an error in a different form
$(folder) error: ${message}
I can't extract the Package.swift filename from this.
There are two things that'd help here
- The error string should always include the full filename (not just the folder). This is a simple change
- If you can extract the offending line, column numbers for version clashes etc report that as well. This I imagine is not so easy