Skip to content

[4.2] [sourcekit] Send compile notifications when argument parsing files #16922

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 31, 2018

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