feat(opencode): biome LSP sensible defaults and LSP server message visibility#17709
Open
trollkotze wants to merge 8 commits intoanomalyco:devfrom
Open
feat(opencode): biome LSP sensible defaults and LSP server message visibility#17709trollkotze wants to merge 8 commits intoanomalyco:devfrom
trollkotze wants to merge 8 commits intoanomalyco:devfrom
Conversation
Contributor
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
…tus, warnings, errors.
a7f90d8 to
6cdd374
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #17656
Type of change
What does this PR do?
The PR offers configuration options for built-in, active by default LSPs (like biome) through opencode.json(c).
Since Biome LSP is active by default, even for projects that don't have biome configured by themselves, its default rules should be configurable on a global OpenCode level (i.e. through the global opencode.json(c)), and have more relaxed default rules for such projects which were not configured for biome and were likely not built for obeying to biome's sometimes overly strict default standards. (Same goes for other LSPs that may be active by default and where turning them off is just an inconvenient little extra step, but I haven't defined a default config for those, because they didn't annoy me like biome).
LSP configuration errors should also be clearer to see and debug. So I added that to the existing LSP status indicator as well as a dropdown, showing the last info and error messages when clicking on them, and also adding an orange light for LSP warnings that are not errors.
Such LSP messages (that are not diagnostics messages, i.e. probably mostly configuration errors or warnings) are now also being logged, including a verbose debug log (when logLevel === "debug" to quickly be able to spot and fix LSP config issues.
Biome LSP now sends a default inlineConfig when the project has no biome.json/biome.jsonc. Currently that only disables annoying complaints about Array.prototype.forEach callbacks returning a value, which is very common. But probably there are more rules that could/should be more relaxed by default.
That configuration stuff also brought some existing potential race conditions to the surface that could happen during LSP initializations when passing a config, that should be mitigated pretty okay now.
The OpenCode config schema now accepts overrides for built-in LSP servers, without also specifying the binary, so users can more easily globally customize Biome workspace settings in opencode.json without providing a full command override and also without putting a biome.json everywhere.
How did you verify your code works?
I tried it out a little bit. I also followed the implementation process (of course "vibe-coded") very closely and had to debug that race condition more by hand. Here is the shared opencode sssion: https://opncd.ai/share/EQ2Xb6xA
Screenshots / recordings
Checklist
I hope this time your PR guideline compliance bot can recognize that I checked all the requirements.
There was a closing "]" missing.
Hmm... okay, maybe the spaces inside the [ ] were the problem. Let's see.
Yes, bro, I have tested my changes locally.
No, I have not included unrelated changes in this PR.