Skip to content
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

Unable to specify document selectors for formatting requests during the initial initialization #2088

Open
rcjsuen opened this issue Jan 29, 2025 · 2 comments
Labels
info-needed Issue requires more information from poster

Comments

@rcjsuen
Copy link
Contributor

rcjsuen commented Jan 29, 2025

/**
* The server provides document formatting.
*/
documentFormattingProvider?: boolean | DocumentFormattingOptions;

/**
* The server provides selection range support.
*
* @since 3.15.0
*/
selectionRangeProvider?: boolean | SelectionRangeOptions
| SelectionRangeRegistrationOptions;

For ServerCapabilities I can include SelectionRangeRegistrationOptions in the original response to the initialize request but I cannot include DocumentFormattingRegistrationOptions because only DocumentFormattingOptions is allowed.

Would it make sense to update ServerCapabilities so that it supports declaring registration options for textDocument/formatting and other such features?

@dbaeumer
Copy link
Member

The reason here is backwards compatibility. If we do that it must go behind a client capability since it might be unexpected for older clients. I never did this since you can achieve the same with dynamic registration.

I actually opt to leave it as is.

@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Feb 10, 2025
@rcjsuen
Copy link
Contributor Author

rcjsuen commented Feb 10, 2025

The reason here is backwards compatibility.

Yeah, I figured as much. It is what it is. I'm okay with closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants