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

Misleading error message when Language Server doesn't support range formatting #188441

Closed
rotu opened this issue Jul 21, 2023 · 5 comments
Closed
Assignees
Labels
feature-request Request for new features or functionality formatting Source formatter issues insiders-released Patch has been released in VS Code Insiders polish Cleanup and polish issue verification-needed Verification of issue is requested verified Verification succeeded

Comments

@rotu
Copy link

rotu commented Jul 21, 2023

Type: Bug

  1. Install extension denoland.vscode-deno and enable it for a project.
  2. Open a TypeScript file.
  3. Select a range, choose "Format Selection With..." and choose the Deno extension

Observe the error message:

Extension 'Deno' is configured as formatter but it cannot format 'TypeScript'-files

This is misleading, as the Deno Language Server does support TypeScript files. It supports document formatting but not range formatting.

Further, setting editor.formatOnSaveMode: "modificationsIfAvailable" or "modifications" gives the same misleading error message on save.

Originally reported at denoland/vscode_deno#860

VS Code version: Code 1.80.1 (74f6148, 2023-07-12T17:20:58.115Z)
OS version: Darwin arm64 23.0.0
Modes:

@jrieken jrieken added the formatting Source formatter issues label Jul 21, 2023
@jrieken jrieken added the info-needed Issue requires more information from poster label Dec 4, 2023
@jrieken
Copy link
Member

jrieken commented Dec 4, 2023

Select a range, choose "Format Selection With..." and choose the Deno extension

This doesn't reproduce for me, having TS and deno installed and I do not see that option because not two or more range formatter are installed, it's just TS

@rotu
Copy link
Author

rotu commented Dec 4, 2023

@jrieken repro is slightly different for me with the latest versions (VS Code 1.84.2, denoland.vscode-deno 3.28.0). I too can no longer see Deno in the "Format Selection With..." dropdown.

I can still repro by having Deno as my default formatter and then choosing the "Format Selection" Command.

@jrieken jrieken removed the info-needed Issue requires more information from poster label Dec 4, 2023
@jrieken
Copy link
Member

jrieken commented Dec 4, 2023

Thanks, I can reproduce with

  • install deno
  • configure as default formatter (see below)
  • make a selection
  • trigger format selection
  • 🐛 message blames deno in an unpresice way
 "[typescript]": {
    "editor.defaultFormatter": "denoland.vscode-deno"
  },

@jrieken jrieken added feature-request Request for new features or functionality polish Cleanup and polish issue labels Dec 4, 2023
@vscodenpa vscodenpa added this to the Backlog Candidates milestone Dec 4, 2023
@vscodenpa
Copy link

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@jrieken jrieken modified the milestones: Backlog Candidates, Backlog, December 2023 Dec 4, 2023
jrieken added a commit that referenced this issue Dec 4, 2023
@jrieken jrieken closed this as completed in 23f2763 Dec 4, 2023
@vscodenpa vscodenpa added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Dec 4, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 18, 2024
@jrieken jrieken added the verification-needed Verification of issue is requested label Jan 22, 2024
@jrieken
Copy link
Member

jrieken commented Jan 22, 2024

To verify follow these steps #188441 (comment) and ensure the message is good

@andreamah andreamah added the verified Verification succeeded label Jan 24, 2024
@aiday-mar aiday-mar added this to the December / January 2024 milestone Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality formatting Source formatter issues insiders-released Patch has been released in VS Code Insiders polish Cleanup and polish issue verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants