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

allow intellij project to work with different biome configs #53

Merged
merged 4 commits into from
May 1, 2024

Conversation

APshenkin
Copy link
Contributor

Hi

I really liked the speed and easy use of biome. But unfortunately without pretty support in IDE it's really hard to bring it to my company now. So I tried to solve current issues, that block.

  1. Reformat with Biome Plugin does not work #44
    The problem is that in case if file wasn't saved first, it was deleted entirely. Also I think it should be valid to use all options (applySafeFixesOnSave, applyUnsafeFixesOnSave) when Reformat with Biome is triggered, cause this is something that everyone expect.

  2. Biome plugin in intellij not respecting settings in biome.json #42
    This is done for Automatic setup. I didn't come up with something better, that lookup to biome config from file upwards the project root. So it will use this file as config for formatting and LSP then. LSP will restart, if editor will be focused on newfile that will have different biome config. I saw this issue in main biome 📎 LSP: support for Workspaces biome#1573. But currently LSP proxy is not supporting workspaces. Also for me workspaces looks less flexible, as for example I can specify several biome conf now in one workspace (let's say for different folders for some reasons). Also as in large codebases there could be the case, that biome will be enabled not on root level, I stop LSP in cases, if there is no biome config. Otherwise it can create noise to some other projects within your workspace.

class BiomeLspServerManagerListener(val project: Project) : LspServerManagerListener {
override fun serverStateChanged(lspServer: LspServer) {
if (lspServer.descriptor is BiomeLspServerDescriptor && lspServer.state == LspServerState.ShutdownUnexpectedly) {
// restart again if the server was shutdown unexpectedly.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great comment!

@APshenkin
Copy link
Contributor Author

@ematipico curious, when this will be merged/published?

@ematipico ematipico merged commit 22395cb into biomejs:main May 1, 2024
1 check passed
@ematipico
Copy link
Member

@APshenkin, your PR was merged, and your changes should be available in version 1.1.0 of the plugin

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

Successfully merging this pull request may close these issues.

2 participants