Skip to content

Implement push diagnostics in terms of DocumentDiagnosticsRequest #902

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 1 commit into from
Oct 19, 2023

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Oct 13, 2023

Instead of listening for document updates sent from sourcekitd and sending a PublishDiagnosticsNotification based on the sourcekitd notification, wait for a little while and then execute an internal DocumentDiagnosticsRequest to load diagnostics and send them to the client.

This has two advantages:

  • It unifies the two diagnostic implementations
  • It removes the need to keep track of semantic diagnostics in SwiftLanguageServer
  • It gets us one step closed to opening and editing documents in syntactic_only mode. The only thing that is left now are semantic tokens.

@ahoppen
Copy link
Member Author

ahoppen commented Oct 13, 2023

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Oct 13, 2023

@swift-ci Please test Linux

@ahoppen
Copy link
Member Author

ahoppen commented Oct 13, 2023

@swift-ci Please test Windows

Copy link
Contributor

@bnbarham bnbarham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳

@ahoppen ahoppen force-pushed the ahoppen/unify-diagnostics branch 2 times, most recently from fd6dcbb to 47a6f5a Compare October 17, 2023 18:21
@ahoppen
Copy link
Member Author

ahoppen commented Oct 17, 2023

@swift-ci Please test

Instead of listening for document updates sent from `sourcekitd` and sending a `PublishDiagnosticsNotification` based on the `sourcekitd` notification, wait for a little while and then execute an internal `DocumentDiagnosticsRequest` to load diagnostics and send them to the client.

This has two advantages:
- It unifies the two diagnostic implementations
- It removes the need to keep track of semantic diagnostics in `SwiftLanguageServer`
- It gets us one step closed to opening and editing documents in `syntactic_only` mode. The only thing that is left now are semantic tokens.
@ahoppen ahoppen force-pushed the ahoppen/unify-diagnostics branch from 47a6f5a to 4086874 Compare October 18, 2023 20:48
@ahoppen
Copy link
Member Author

ahoppen commented Oct 18, 2023

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Oct 18, 2023

@swift-ci Please test Windows

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.

3 participants