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

🐛 JSONC Not supported? #364

Open
1 of 3 tasks
tylerlaprade opened this issue Sep 23, 2024 · 6 comments
Open
1 of 3 tasks

🐛 JSONC Not supported? #364

tylerlaprade opened this issue Sep 23, 2024 · 6 comments
Labels

Comments

@tylerlaprade
Copy link
Contributor

tylerlaprade commented Sep 23, 2024

VS Code version

1.93.1

Extension version

v2024.9.200949 (pre-release)

Biome version

Operating system

  • Windows
  • macOS
  • Linux

Description

image

Steps to reproduce

Open settings.json that has comments on some lines

Expected behavior

The extension should not complain about "JSON with Comments"

Does this issue occur when using the CLI directly?

No

Link to a minimal reproduction

No response

Logs

2024-09-18 15:09:43.873 [info] 





2024-09-18 15:09:43.873 [info] Biome extension 2024.9.161829 activated
2024-09-18 15:09:45.322 [error] Could not find the Biome binary
2024-09-18 15:16:33.058 [error] Could not find the Biome binary
2024-09-18 15:16:33.062 [error] Failed to start Biome extension
2024-09-18 15:16:33.063 [info] Biome extension started
2024-09-18 15:16:33.065 [info] User-facing commands registered
2024-09-18 15:16:33.065 [info] Started listening for lockfile changes
2024-09-18 15:16:33.065 [info] Started listening for configuration changes
2024-09-18 15:16:33.066 [info] Started listening for active text editor changes
2024-09-18 15:16:48.334 [info] Biome extension stopped
2024-09-18 15:16:50.871 [info] 





2024-09-18 15:16:50.871 [info] Biome extension 2024.9.161829 activated
2024-09-18 15:16:51.560 [error] Could not find the Biome binary
2024-09-18 15:16:55.349 [error] Failed to start Biome extension
2024-09-18 15:16:55.349 [info] Biome extension started
2024-09-18 15:16:55.349 [info] User-facing commands registered
2024-09-18 15:16:55.349 [info] Started listening for lockfile changes
2024-09-18 15:16:55.349 [info] Started listening for configuration changes
2024-09-18 15:16:55.349 [info] Started listening for active text editor changes
2024-09-18 15:16:58.344 [info] 





2024-09-18 15:16:58.344 [info] Biome extension 2024.9.161829 activated
2024-09-18 15:16:59.377 [error] Could not find the Biome binary
2024-09-18 15:17:03.129 [error] Failed to start Biome extension
2024-09-18 15:17:03.129 [info] Biome extension started
2024-09-18 15:17:03.130 [info] User-facing commands registered
2024-09-18 15:17:03.130 [info] Started listening for lockfile changes
2024-09-18 15:17:03.130 [info] Started listening for configuration changes
2024-09-18 15:17:03.130 [info] Started listening for active text editor changes
2024-09-18 15:17:15.341 [info] 





2024-09-18 15:17:15.341 [info] Biome extension 2024.9.161829 activated
2024-09-18 15:17:16.004 [error] Could not find the Biome binary
2024-09-18 15:17:17.959 [error] Could not find the Biome binary
2024-09-18 15:17:17.959 [error] Failed to start Biome extension
2024-09-18 15:17:17.960 [info] Biome extension started
2024-09-18 15:17:17.960 [info] User-facing commands registered
2024-09-18 15:17:17.960 [info] Started listening for lockfile changes
2024-09-18 15:17:17.960 [info] Started listening for configuration changes
2024-09-18 15:17:17.960 [info] Started listening for active text editor changes
2024-09-18 15:17:28.389 [info] Biome extension stopped
2024-09-18 15:17:39.942 [info] 





2024-09-18 15:17:39.942 [info] Biome extension 2024.9.161829 activated
2024-09-18 15:17:40.529 [error] Could not find the Biome binary
2024-09-18 15:20:39.989 [error] Could not find the Biome binary
2024-09-18 15:20:39.989 [error] Failed to start Biome extension
2024-09-18 15:20:39.989 [info] Biome extension started
2024-09-18 15:20:39.990 [info] User-facing commands registered
2024-09-18 15:20:39.990 [info] Started listening for lockfile changes
2024-09-18 15:20:39.990 [info] Started listening for configuration changes
2024-09-18 15:20:39.990 [info] Started listening for active text editor changes
2024-09-18 18:16:21.751 [info] Lockfile /Users/tyler/Code/condor/paqarina/package-lock.json changed.
2024-09-18 18:16:22.102 [info] Lockfile /Users/tyler/Code/condor/paqarina/package-lock.json changed.
2024-09-18 18:16:24.692 [error] Could not find the Biome binary
2024-09-18 18:16:27.218 [error] Could not find the Biome binary
2024-09-18 18:16:27.219 [error] Failed to start Biome extension
2024-09-18 18:16:27.219 [info] Biome extension restarted
2024-09-18 22:45:09.926 [info] Biome extension stopped
2024-09-18 22:45:15.504 [info] 





2024-09-18 22:45:15.504 [info] Biome extension 2024.9.161829 activated
2024-09-18 22:45:16.099 [error] Could not find the Biome binary
2024-09-18 22:45:19.128 [error] Could not find the Biome binary
2024-09-18 22:45:19.128 [error] Failed to start Biome extension
2024-09-18 22:45:19.128 [info] Biome extension started
2024-09-18 22:45:19.129 [info] User-facing commands registered
2024-09-18 22:45:19.129 [info] Started listening for lockfile changes
2024-09-18 22:45:19.129 [info] Started listening for configuration changes
2024-09-18 22:45:19.129 [info] Started listening for active text editor changes
2024-09-18 22:45:57.793 [info] Biome extension stopped
2024-09-18 22:46:07.980 [info] 





2024-09-18 22:46:07.980 [info] Biome extension 2024.9.161829 activated
2024-09-18 22:46:10.105 [error] Could not find the Biome binary
2024-09-18 22:46:15.900 [error] Could not find the Biome binary
2024-09-18 22:46:15.900 [error] Failed to start Biome extension
2024-09-18 22:46:15.900 [info] Biome extension started
2024-09-18 22:46:15.902 [info] User-facing commands registered
2024-09-18 22:46:15.902 [info] Started listening for lockfile changes
2024-09-18 22:46:15.902 [info] Started listening for configuration changes
2024-09-18 22:46:15.902 [info] Started listening for active text editor changes
2024-09-18 22:46:38.017 [info] Lockfile /Users/tyler/Code/condor/paqarina/package-lock.json changed.
2024-09-18 22:46:39.530 [error] Could not find the Biome binary
2024-09-18 22:46:42.405 [error] Could not find the Biome binary
2024-09-18 22:46:42.406 [error] Failed to start Biome extension
2024-09-18 22:46:42.406 [info] Biome extension restarted
2024-09-19 11:32:56.844 [info] Lockfile /Users/tyler/Code/condor/hanaq/package-lock.json created.
2024-09-19 11:32:58.350 [error] Could not find the Biome binary
2024-09-19 11:33:06.362 [info] Lockfile /Users/tyler/Code/condor/package-lock.json created.
2024-09-19 11:33:12.223 [info] Lockfile /Users/tyler/Code/condor/hanaq/package-lock.json deleted.
2024-09-19 11:33:13.974 [info] Lockfile /Users/tyler/Code/condor/package-lock.json deleted.
2024-09-19 11:33:19.623 [info] Lockfile /Users/tyler/Code/condor/paqarina/package-lock.json changed.
2024-09-19 11:33:47.932 [error] Could not find the Biome binary
2024-09-19 11:33:47.933 [error] Failed to start Biome extension
2024-09-19 11:33:47.933 [info] Biome extension restarted
2024-09-19 12:30:38.763 [info] Biome extension stopped
2024-09-19 12:30:52.039 [info] 





2024-09-19 12:30:52.039 [info] Biome extension 2024.9.161829 activated
2024-09-19 12:30:53.603 [error] Could not find the Biome binary
2024-09-19 12:30:55.614 [error] Could not find the Biome binary
2024-09-19 12:30:55.614 [error] Failed to start Biome extension
2024-09-19 12:30:55.614 [info] Biome extension started
2024-09-19 12:30:55.614 [info] User-facing commands registered
2024-09-19 12:30:55.614 [info] Started listening for lockfile changes
2024-09-19 12:30:55.615 [info] Started listening for configuration changes
2024-09-19 12:30:55.615 [info] Started listening for active text editor changes
2024-09-19 13:05:48.258 [info] Biome extension stopped
2024-09-19 13:05:53.523 [info] 





2024-09-19 13:05:53.523 [info] Biome extension 2024.9.161829 activated
2024-09-19 13:05:54.131 [error] Could not find the Biome binary
2024-09-19 13:06:00.457 [error] Could not find the Biome binary
2024-09-19 13:06:00.458 [error] Failed to start Biome extension
2024-09-19 13:06:00.458 [info] Biome extension started
2024-09-19 13:06:00.458 [info] User-facing commands registered
2024-09-19 13:06:00.458 [info] Started listening for lockfile changes
2024-09-19 13:06:00.458 [info] Started listening for configuration changes
2024-09-19 13:06:00.458 [info] Started listening for active text editor changes
2024-09-19 15:30:45.920 [info] Lockfile /Users/tyler/Code/condor/paqarina/package-lock.json changed.
2024-09-19 15:30:47.864 [error] Could not find the Biome binary
2024-09-19 15:31:15.882 [error] Could not find the Biome binary
2024-09-19 15:31:15.882 [error] Failed to start Biome extension
2024-09-19 15:31:15.882 [info] Biome extension restarted
2024-09-20 09:08:10.041 [info] Biome extension stopped
2024-09-20 09:08:18.273 [info] 





2024-09-20 09:08:18.273 [info] Biome extension 2024.9.161829 activated
2024-09-20 09:08:19.766 [error] Could not find the Biome binary
2024-09-20 09:08:25.283 [error] Could not find the Biome binary
2024-09-20 09:08:25.283 [error] Failed to start Biome extension
2024-09-20 09:08:25.283 [info] Biome extension started
2024-09-20 09:08:25.284 [info] User-facing commands registered
2024-09-20 09:08:25.284 [info] Started listening for lockfile changes
2024-09-20 09:08:25.284 [info] Started listening for configuration changes
2024-09-20 09:08:25.284 [info] Started listening for active text editor changes
2024-09-20 09:09:21.320 [info] Biome extension stopped
2024-09-20 09:09:29.234 [info] 





2024-09-20 09:09:29.234 [info] Biome extension 2024.9.161829 activated
2024-09-20 09:09:30.670 [error] Could not find the Biome binary
2024-09-20 09:09:39.424 [error] Could not find the Biome binary
2024-09-20 09:09:39.425 [error] Failed to start Biome extension
2024-09-20 09:09:39.425 [info] Biome extension started
2024-09-20 09:09:39.426 [info] User-facing commands registered
2024-09-20 09:09:39.426 [info] Started listening for lockfile changes
2024-09-20 09:09:39.426 [info] Started listening for configuration changes
2024-09-20 09:09:39.426 [info] Started listening for active text editor changes
2024-09-20 09:11:49.207 [info] Biome extension stopped
2024-09-20 09:11:57.042 [info] 





2024-09-20 09:11:57.042 [info] Biome extension 2024.9.161829 activated
2024-09-20 09:11:58.141 [error] Could not find the Biome binary
2024-09-20 09:13:01.193 [error] Failed to start Biome extension
2024-09-20 09:13:01.196 [info] Biome extension started
2024-09-20 09:13:01.197 [info] User-facing commands registered
2024-09-20 09:13:01.197 [info] Started listening for lockfile changes
2024-09-20 09:13:01.197 [info] Started listening for configuration changes
2024-09-20 09:13:01.197 [info] Started listening for active text editor changes
2024-09-20 09:13:09.471 [info] 





2024-09-20 09:13:09.471 [info] Biome extension 2024.9.161829 activated
2024-09-20 09:13:10.950 [error] Could not find the Biome binary
2024-09-20 09:13:16.905 [error] Could not find the Biome binary
2024-09-20 09:13:16.905 [error] Failed to start Biome extension
2024-09-20 09:13:16.905 [info] Biome extension started
2024-09-20 09:13:16.906 [info] User-facing commands registered
2024-09-20 09:13:16.906 [info] Started listening for lockfile changes
2024-09-20 09:13:16.906 [info] Started listening for configuration changes
2024-09-20 09:13:16.906 [info] Started listening for active text editor changes
2024-09-20 09:19:16.185 [info] Biome extension stopped
2024-09-20 09:19:26.290 [info] 





2024-09-20 09:19:26.290 [info] Biome extension 2024.9.161829 activated
2024-09-20 09:19:27.461 [error] Could not find the Biome binary
2024-09-20 09:21:28.496 [error] Failed to start Biome extension
2024-09-20 09:21:28.499 [info] Biome extension started
2024-09-20 09:21:28.499 [info] User-facing commands registered
2024-09-20 09:21:28.499 [info] Started listening for lockfile changes
2024-09-20 09:21:28.499 [info] Started listening for configuration changes
2024-09-20 09:21:28.499 [info] Started listening for active text editor changes
2024-09-20 09:21:48.272 [info] 





2024-09-20 09:21:48.272 [info] Biome extension 2024.9.161829 activated
2024-09-20 09:21:49.491 [error] Could not find the Biome binary
2024-09-20 09:22:11.986 [error] Could not find the Biome binary
2024-09-20 09:22:11.986 [error] Failed to start Biome extension
2024-09-20 09:22:11.986 [info] Biome extension started
2024-09-20 09:22:11.987 [info] User-facing commands registered
2024-09-20 09:22:11.987 [info] Started listening for lockfile changes
2024-09-20 09:22:11.987 [info] Started listening for configuration changes
2024-09-20 09:22:11.987 [info] Started listening for active text editor changes
2024-09-20 13:20:17.856 [info] Biome extension stopped
2024-09-20 13:20:34.786 [info] 





2024-09-20 13:20:34.787 [info] Biome extension 2024.9.200949 activated
2024-09-20 13:20:36.263 [error] Could not find the Biome binary
2024-09-20 13:23:52.691 [error] Failed to start Biome extension
2024-09-20 13:23:52.693 [info] Biome extension started
2024-09-20 13:23:52.694 [info] User-facing commands registered
2024-09-20 13:23:52.694 [info] Started listening for lockfile changes
2024-09-20 13:23:52.694 [info] Started listening for configuration changes
2024-09-20 13:23:52.694 [info] Started listening for active text editor changes
2024-09-20 13:23:57.911 [info] 





2024-09-20 13:23:57.911 [info] Biome extension 2024.9.200949 activated
2024-09-20 13:23:58.795 [error] Could not find the Biome binary
2024-09-20 13:24:03.399 [error] Could not find the Biome binary
2024-09-20 13:24:03.399 [error] Failed to start Biome extension
2024-09-20 13:24:03.399 [info] Biome extension started
2024-09-20 13:24:03.400 [info] User-facing commands registered
2024-09-20 13:24:03.400 [info] Started listening for lockfile changes
2024-09-20 13:24:03.400 [info] Started listening for configuration changes
2024-09-20 13:24:03.400 [info] Started listening for active text editor changes
2024-09-20 14:02:35.748 [info] Biome extension stopped
2024-09-20 14:02:52.061 [info] 





2024-09-20 14:02:52.061 [info] Biome extension 2024.9.200949 activated
2024-09-20 14:02:53.981 [error] Could not find the Biome binary
2024-09-20 14:03:12.787 [error] Could not find the Biome binary
2024-09-20 14:03:12.788 [error] Failed to start Biome extension
2024-09-20 14:03:12.788 [info] Biome extension started
2024-09-20 14:03:12.788 [info] User-facing commands registered
2024-09-20 14:03:12.788 [info] Started listening for lockfile changes
2024-09-20 14:03:12.788 [info] Started listening for configuration changes
2024-09-20 14:03:12.788 [info] Started listening for active text editor changes
2024-09-20 16:16:19.396 [info] Biome extension stopped
2024-09-20 16:16:35.228 [info] 





2024-09-20 16:16:35.228 [info] Biome extension 2024.9.200949 activated
2024-09-20 16:16:37.001 [error] Could not find the Biome binary
2024-09-20 16:37:27.526 [error] Failed to start Biome extension
2024-09-20 16:37:27.529 [info] Biome extension started
2024-09-20 16:37:27.530 [info] User-facing commands registered
2024-09-20 16:37:27.530 [info] Started listening for lockfile changes
2024-09-20 16:37:27.530 [info] Started listening for configuration changes
2024-09-20 16:37:27.530 [info] Started listening for active text editor changes
2024-09-20 16:37:36.692 [info] 





2024-09-20 16:37:36.692 [info] Biome extension 2024.9.200949 activated
2024-09-20 16:37:38.171 [error] Could not find the Biome binary
2024-09-20 16:37:56.700 [error] Could not find the Biome binary
2024-09-20 16:37:56.700 [error] Failed to start Biome extension
2024-09-20 16:37:56.700 [info] Biome extension started
2024-09-20 16:37:56.701 [info] User-facing commands registered
2024-09-20 16:37:56.701 [info] Started listening for lockfile changes
2024-09-20 16:37:56.701 [info] Started listening for configuration changes
2024-09-20 16:37:56.701 [info] Started listening for active text editor changes
2024-09-20 16:40:42.470 [info] Biome extension stopped
2024-09-20 16:40:46.671 [info] 





2024-09-20 16:40:46.671 [info] Biome extension 2024.9.200949 activated
2024-09-20 16:40:47.664 [error] Could not find the Biome binary
2024-09-20 16:41:04.628 [error] Failed to start Biome extension
2024-09-20 16:41:04.630 [info] Biome extension started
2024-09-20 16:41:04.631 [info] User-facing commands registered
2024-09-20 16:41:04.631 [info] Started listening for lockfile changes
2024-09-20 16:41:04.631 [info] Started listening for configuration changes
2024-09-20 16:41:04.631 [info] Started listening for active text editor changes
2024-09-20 16:41:08.305 [info] 





2024-09-20 16:41:08.305 [info] Biome extension 2024.9.200949 activated
2024-09-20 16:41:09.186 [error] Could not find the Biome binary
2024-09-23 15:38:30.435 [error] Failed to start Biome extension
2024-09-23 15:38:30.435 [info] Biome extension started
2024-09-23 15:38:30.436 [info] User-facing commands registered
2024-09-23 15:38:30.436 [info] Started listening for lockfile changes
2024-09-23 15:38:30.436 [info] Started listening for configuration changes
2024-09-23 15:38:30.436 [info] Started listening for active text editor changes
2024-09-23 15:38:46.314 [info] 





2024-09-23 15:38:46.314 [info] Biome extension 2024.9.200949 activated
2024-09-23 15:38:48.874 [error] Could not find the Biome binary
2024-09-23 17:03:56.277 [error] Failed to start Biome extension
2024-09-23 17:03:56.277 [info] Biome extension started
2024-09-23 17:03:56.279 [info] User-facing commands registered
2024-09-23 17:03:56.279 [info] Started listening for lockfile changes
2024-09-23 17:03:56.279 [info] Started listening for configuration changes
2024-09-23 17:03:56.279 [info] Started listening for active text editor changes
2024-09-23 17:04:13.258 [info] 





2024-09-23 17:04:13.258 [info] Biome extension 2024.9.200949 activated
2024-09-23 17:04:15.076 [error] Could not find the Biome binary
@ematipico ematipico added Needs reproduction Needs a reproduction and removed Triage labels Sep 24, 2024
@ematipico
Copy link
Member

Thank you for the report, can you provide a reproduction?

To create a reproduction, you can use our new CLI tool, which should help you to create a very quick repository with what you need: npm create @biomejs/biome-reproduction

@tylerlaprade
Copy link
Contributor Author

Hmm, I'm not able to repro even in my main project today. I wonder if it's because I changed my biome.projects setting.

@EthanPintoA
Copy link

EthanPintoA commented Oct 31, 2024

I encountered a similar issue; however, it only causes some inconvenience when using the Biome extension for the first time.

Steps to Reproduce:

  1. Install the Biome extension (without the Biome binary/package installed).
  2. Ignore the notification to install the Biome binary or package.
    • Note: It’s possible that the notification didn’t appear, or I closed it by accident, but I haven’t been able to reproduce this.
  3. Add the following to settings.json: "[jsonc]": { "editor.defaultFormatter": "biomejs.biome" }.
  4. Attempt to format settings.json, triggering an alert/popup/dialog that states Biome cannot format JSONC files.

Although this displays as a popup instead of a notification, I believe it's related based on logs provided in this issue, as they suggest that the Biome extension fails to start due to a missing binary.

Instead of stopping, it might be more helpful if a notification could inform users that the binary or package is missing when they attempt to format, rather than just at start-up.

@nhedger
Copy link
Member

nhedger commented Oct 31, 2024

As far as I know this isn't possible because the LSP session needs to have been started for Biome to be registered as a formater.

@EthanPintoA
Copy link

I just encountered another similar issue.

When I open my settings.json from my command palette, specifically using "Preferences: Open User Settings (JSON)", Biome on the Status Bar says, "The current file is not supported or ignored by Biome".

This also happens with files opened using "Preferences: Open Workspace Settings (JSON)". However, Biome works fine when using "Preferences: Open Workspace Settings (JSON)", "File: Open File...", and most other methods.

I'm on Windows if that helps.

@nhedger
Copy link
Member

nhedger commented Nov 30, 2024

@tylerlaprade JSONC is supported. You see this message because the extension fails to start the LSP session, which means the formatter doesn't get registered.

You should be able to troubleshoot why by setting the logging level of VS Code to Debug using the Developer: Set log level... command.


@EthanPintoA The issue you're experiencing seems unrelated; please open another issue if you're still experiencing the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants