Skip to content

Use dynamic registration for folding range options #413

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
Jul 1, 2021

Conversation

DavidGoldman
Copy link
Contributor

@DavidGoldman DavidGoldman commented Jul 1, 2021

Dynamically register because clangd doesn't currently support it, but may in the future. Without this change, we don't provide any code folding in Objective-C files because our empty results override's VS Code's default implementation.

Dynamically register because clangd doesn't currently support it, but
may in the future.

Change-Id: I2bf139ea8aad09b58232ba9d09dfddcd89b977cd
@DavidGoldman DavidGoldman requested a review from benlangmuir as a code owner July 1, 2021 20:37
@DavidGoldman
Copy link
Contributor Author

LMK what you think, I can also swap over to use the TextDocumentAndStaticRegistrationOptions option only for Swift, but written this way, whenever clangd adds support we will automatically get it.

@DavidGoldman
Copy link
Contributor Author

@swift-ci please test

@DavidGoldman
Copy link
Contributor Author

Hmm, actually gonna see if there's an easier way - maybe VS Code will ignore our results if we instead return an error?

@DavidGoldman
Copy link
Contributor Author

Nope, VS Code still hides its own folding ranges when we return an error.

@benlangmuir
Copy link
Contributor

@swift-ci please test

@benlangmuir benlangmuir merged commit 13d3d93 into swiftlang:main Jul 1, 2021
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.

2 participants