-
-
Notifications
You must be signed in to change notification settings - Fork 511
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
🐛 Format the content of an in-memory editor in VS Code without configuration #1394
Comments
I think I see the problem here. I think the Biome extension didn't start because you didn't trigger any of the events that start the extension. That's why you couldn't see any logs Try to open a JavaScript/JSX/TypeScript/JSON file, and then create a new file. |
Hi @ematipico: Maybe this requires changing the strategic logic for extension activation? 🤷
I tried this approach in workspace with a At this point it seems like there might be additional debugging in order — but first I want to clarify the expectations that prompted my initial comment: When I set any VS Code extension as the default formatter for a language, I expect that it will be able to operate on the document content of any text editor that is in that language mode — whether that's associated with a workspace or not — whether or not there are any filesystem artifacts (like a config file), etc. The formatter functionality of such an extension should be independent of any of those variables and should be completely self-contained: it downloads any required binaries, allows default configuration via the VS Code extension settings, etc. If an extension supports custom behavior based on things like resolving configuration via files relative to a local (filesystem) workspace — those should be optional features, but not dependencies for operation. I tried to illustrate this concept with the Aside: I've only been experimenting with Biome for a few days so far and haven't researched the roadmap, etc. — but it seems like this could be important in other scenarios, too — e.g. if Biome ever plans to offer a web extension. |
That's something I always wanted to have, and with WebAssembly we should achieve it. Hopefully someone will help us :) |
From biomejs/biome-vscode#25 (comment) — @ematipico asked me to create this here
Environment information
output of
biome rage --daemon-logs
What happened?
It would be useful for Biome to be able to format the content of an editor which has never been saved (one which has no corresponding FS file). Here's an example:
Performing these steps results in an error modal with the following message:
Expected result
However, it could accomplish this by treating the content the same way it does
stdin
and use the editor's current language mode to determine language.In pseudo-code, the CLI operation that represents what I'm describing would be:
Which would result in:
Code of Conduct
The text was updated successfully, but these errors were encountered: