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

LSP: Formatting ignores passed formatting options #23257

Closed
mkhl opened this issue Apr 6, 2024 · 1 comment · Fixed by #24181
Closed

LSP: Formatting ignores passed formatting options #23257

mkhl opened this issue Apr 6, 2024 · 1 comment · Fixed by #24181
Labels
bug Something isn't working correctly lsp related to the language server

Comments

@mkhl
Copy link

mkhl commented Apr 6, 2024

Version: Deno 1.42.0

When the Deno LSP receives a textDocument/formatting request, it receives an optional set of formatting options with that request, see DocumentFormattingParams and FormattingOptions in the LSP spec.

The request gets handled by the formatting function, and it receives the DocumentFormattingParams but only handles the contained reference to the text document and ignores the formatting options, instead generating its own formatting options for the document.

The expected behavior should be that it instead respects the received formatting options and formats the document according to them, falling back on defaults it provides itself.

@heygarrett
Copy link

heygarrett commented Nov 17, 2024

Expanding on my comment here, the editor settings taking priority over the project settings feels backwards. When I use Prettier or Biome, my editor formats according to the project settings, and I'm sure most people would expect Deno to function similarly. Otherwise, one would need to manually change their editor settings to match the project settings for each project they're contributing to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly lsp related to the language server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants