Skip to content

Conversation

@benlangmuir
Copy link
Contributor

Cherry-pick #16895


When swift command-line argument parsing fails in sourcekit, make sure we can still send a compile notification including the diagnostic about the incorrect arguments.

rdar://39225180

…g fails

For now we don't get a diagnostic, but at least there is a will-compile
containing the arguments.
… any reason

Refactors the diagnostic code to be run whenever a compilation
notification has been started and there are diagnostics available in the
consumer. This allows us to capture diagnostics on all exit paths, and
specifically when code-completion fails because of invalid arguments.

Note: the editor.open code path still doesn't report invalid arguments
because it fails before even trying to create an AST.
…ditor.open

Since we will not reach `createAST` where we would normally send the
notification, send one from `getInvocation` when it fails.

rdar://39225180
@benlangmuir
Copy link
Contributor Author

@swift-ci please test

@benlangmuir benlangmuir merged commit 4e9a92f into swiftlang:swift-4.2-branch May 31, 2018
@benlangmuir benlangmuir deleted the note-42 branch May 31, 2018 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant