-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
FormattingOptions should match the LSP's #97343
Comments
I don't think that's needed, all those trimming features are built into VS Code itselves and no formatter is needed for that. We have a "catch-all" signature for various different options: Lines 3417 to 3420 in af3c79e
I honestly think that enough, because it kinda matches what vs code offers by default and other options can be defined (and read) by extensions themselves |
Hi ! Thank you for your answer :) There is a mismatch between protocol usage and vscode itself. And although the interface exposes more, VSCode only passes part of that information to the provider here, because modes.FormattingOptions is a more restricted type than the one exposed in Not being able to use these parameters creates a discrepancy between vscode and other editors which may pass the information there. It would be ok for vscode not to implement and pass them, but then the protocol should probably also deprecate these parameters and ask the server implementers to go lookup in the workspace configuration for these options. |
This isn't a problem of VS Code but the LSP client library. It is free to add whatever option it wants. fyi @dbaeumer |
In LSP we added theses options for editor which don't have built in support for this and need to depend on a formatter. |
Hi!
The LSP describes more formatting features than what VSCode can provide. Therefore, the LanguageClient can only handle part of the protocol's available parameters (see the related issue : microsoft/vscode-languageserver-node#617)
In particular, the FormattingOptions interface should contain more fields:
If there is also a way to pass more options (the
[key: string]: boolean | number | string;
part of the protocol) it would be extra nice, but I don't know if that should be done by vscode of handled directly by the language-client lib.Also, since we're here, maybe this type and the protocol's should be extended with a
lineWidth
parameter which is common to a lot of formatters and we need in the case of the OCaml LSP (see issues on ocaml-lsp and on the ocaml-vscode plugin)The text was updated successfully, but these errors were encountered: